UNPKG

@genkit-ai/anthropic

Version:

Genkit AI framework plugin for Anthropic APIs.

1 lines 21 kB
{"version":3,"sources":["../../src/runner/stable.ts"],"sourcesContent":["/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MessageStream } from '@anthropic-ai/sdk/lib/MessageStream.js';\nimport type {\n ContentBlock,\n DocumentBlockParam,\n ImageBlockParam,\n Message,\n MessageCreateParams,\n MessageCreateParamsNonStreaming,\n MessageCreateParamsStreaming,\n MessageParam,\n MessageStreamEvent,\n RedactedThinkingBlockParam,\n TextBlockParam,\n ThinkingBlockParam,\n Tool,\n ToolResultBlockParam,\n ToolUseBlockParam,\n} from '@anthropic-ai/sdk/resources/messages';\nimport type {\n GenerateRequest,\n GenerateResponseData,\n ModelResponseData,\n Part,\n} from 'genkit';\nimport { logger } from 'genkit/logging';\n\nimport {\n AnthropicConfigSchema,\n type AnthropicDocumentOptions,\n type ClaudeRunnerParams,\n} from '../types.mjs';\nimport { checkModelName, removeUndefinedProperties } from '../utils.mjs';\nimport { BaseRunner } from './base.mjs';\nimport {\n citationsDeltaToPart,\n redactedThinkingBlockToPart,\n textBlockToPart,\n textDeltaToPart,\n thinkingBlockToPart,\n thinkingDeltaToPart,\n toolUseBlockToPart,\n webSearchToolResultBlockToPart,\n} from './converters/shared.mjs';\nimport {\n serverToolUseBlockToPart,\n toDocumentBlock,\n} from './converters/stable.mjs';\nimport { RunnerTypes as BaseRunnerTypes } from './types.mjs';\n\ninterface RunnerTypes extends BaseRunnerTypes {\n Message: Message;\n Stream: MessageStream;\n StreamEvent: MessageStreamEvent;\n RequestBody: MessageCreateParamsNonStreaming;\n StreamingRequestBody: MessageCreateParamsStreaming;\n Tool: Tool;\n MessageParam: MessageParam;\n ToolResponseContent: TextBlockParam | ImageBlockParam;\n ContentBlockParam:\n | TextBlockParam\n | ImageBlockParam\n | DocumentBlockParam\n | ToolUseBlockParam\n | ToolResultBlockParam\n | ThinkingBlockParam\n | RedactedThinkingBlockParam;\n}\n\nexport class Runner extends BaseRunner<RunnerTypes> {\n constructor(params: ClaudeRunnerParams) {\n super(params);\n }\n\n protected toAnthropicMessageContent(\n part: Part\n ):\n | TextBlockParam\n | ImageBlockParam\n | DocumentBlockParam\n | ToolUseBlockParam\n | ToolResultBlockParam\n | ThinkingBlockParam\n | RedactedThinkingBlockParam {\n if (part.reasoning) {\n const signature = this.getThinkingSignature(part);\n if (!signature) {\n throw new Error(\n 'Anthropic thinking parts require a signature when sending back to the API. Preserve the `metadata.thoughtSignature` value from the original response.'\n );\n }\n return {\n type: 'thinking',\n thinking: part.reasoning,\n signature,\n };\n }\n\n const redactedThinking = this.getRedactedThinkingData(part);\n if (redactedThinking !== undefined) {\n return {\n type: 'redacted_thinking',\n data: redactedThinking,\n };\n }\n\n if (part.text) {\n return {\n type: 'text',\n text: part.text,\n citations: null,\n // This is intentional. `part.metadata?.cache_control` is unknown, and casting it to the relevant type of the property makes it more robust to Anthropic SDK API changes.\n cache_control: part.metadata\n ?.cache_control as TextBlockParam['cache_control'],\n };\n }\n\n // Custom document (for citations support)\n if (part.custom?.anthropicDocument) {\n return toDocumentBlock(\n part.custom.anthropicDocument as AnthropicDocumentOptions\n );\n }\n\n if (part.media) {\n if (part.media.contentType === 'application/pdf') {\n return {\n type: 'document',\n source: this.toPdfDocumentSource(part.media),\n cache_control: part.metadata\n ?.cache_control as DocumentBlockParam['cache_control'],\n };\n }\n\n const source = this.toImageSource(part.media);\n if (source.kind === 'base64') {\n return {\n type: 'image',\n source: {\n type: 'base64',\n data: source.data,\n media_type: source.mediaType,\n },\n cache_control: part.metadata\n ?.cache_control as ImageBlockParam['cache_control'],\n };\n }\n return {\n type: 'image',\n source: {\n type: 'url',\n url: source.url,\n },\n cache_control: part.metadata\n ?.cache_control as ImageBlockParam['cache_control'],\n };\n }\n\n if (part.toolRequest) {\n if (!part.toolRequest.ref) {\n throw new Error(\n `Tool request ref is required for Anthropic API. Part: ${JSON.stringify(\n part.toolRequest\n )}`\n );\n }\n return {\n type: 'tool_use',\n id: part.toolRequest.ref,\n name: part.toolRequest.name,\n input: part.toolRequest.input,\n cache_control: part.metadata\n ?.cache_control as ToolUseBlockParam['cache_control'],\n };\n }\n\n if (part.toolResponse) {\n if (!part.toolResponse.ref) {\n throw new Error(\n `Tool response ref is required for Anthropic API. Part: ${JSON.stringify(\n part.toolResponse\n )}`\n );\n }\n return {\n type: 'tool_result',\n tool_use_id: part.toolResponse.ref,\n content: [this.toAnthropicToolResponseContent(part)],\n cache_control: part.metadata\n ?.cache_control as ToolResultBlockParam['cache_control'],\n };\n }\n\n throw new Error(\n `Unsupported genkit part fields encountered for current message role: ${JSON.stringify(\n part\n )}.`\n );\n }\n\n protected toAnthropicRequestBody(\n modelName: string,\n request: GenerateRequest<typeof AnthropicConfigSchema>\n ): MessageCreateParamsNonStreaming {\n if (request.output?.format && request.output.format !== 'text') {\n throw new Error(\n `Only text output format is supported for Claude models currently`\n );\n }\n\n const { system, messages } = this.toAnthropicMessages(request.messages);\n const mappedModelName =\n request.config?.version ?? checkModelName(modelName);\n\n const thinkingConfig = this.toAnthropicThinkingConfig(\n request.config?.thinking\n ) as MessageCreateParams['thinking'] | undefined;\n\n // Need to extract topP and topK from request.config to avoid duplicate properties being added to the body\n // This happens because topP and topK have different property names (top_p and top_k) in the Anthropic API.\n // Thinking is extracted separately to avoid type issues.\n // ApiVersion is extracted separately as it's not a valid property for the Anthropic API.\n const {\n topP,\n topK,\n apiVersion: _1,\n thinking: _2,\n maxOutputTokens,\n stopSequences,\n version,\n apiKey,\n ...restConfig\n } = request.config ?? {};\n\n const body: MessageCreateParamsNonStreaming = {\n model: mappedModelName,\n max_tokens: maxOutputTokens ?? this.DEFAULT_MAX_OUTPUT_TOKENS,\n messages,\n system: system as TextBlockParam[],\n stop_sequences: stopSequences,\n temperature: request.config?.temperature,\n top_k: topK,\n top_p: topP,\n tool_choice: request.config?.tool_choice,\n metadata: request.config?.metadata,\n tools: request.tools?.map((tool) => this.toAnthropicTool(tool)),\n thinking: thinkingConfig,\n ...restConfig,\n };\n\n return removeUndefinedProperties(body);\n }\n\n protected toAnthropicStreamingRequestBody(\n modelName: string,\n request: GenerateRequest<typeof AnthropicConfigSchema>\n ): MessageCreateParamsStreaming {\n if (request.output?.format && request.output.format !== 'text') {\n throw new Error(\n `Only text output format is supported for Claude models currently`\n );\n }\n\n const { system, messages } = this.toAnthropicMessages(request.messages);\n const mappedModelName =\n request.config?.version ?? checkModelName(modelName);\n\n const thinkingConfig = this.toAnthropicThinkingConfig(\n request.config?.thinking\n ) as MessageCreateParams['thinking'] | undefined;\n\n // Need to extract topP and topK from request.config to avoid duplicate properties being added to the body\n // This happens because topP and topK have different property names (top_p and top_k) in the Anthropic API.\n // Thinking is extracted separately to avoid type issues.\n // ApiVersion is extracted separately as it's not a valid property for the Anthropic API.\n const {\n topP,\n topK,\n apiVersion: _1,\n thinking: _2,\n maxOutputTokens,\n stopSequences,\n version,\n apiKey,\n ...restConfig\n } = request.config ?? {};\n\n const body: MessageCreateParamsStreaming = {\n model: mappedModelName,\n max_tokens:\n request.config?.maxOutputTokens ?? this.DEFAULT_MAX_OUTPUT_TOKENS,\n messages,\n stream: true,\n system: system as TextBlockParam[],\n stop_sequences: request.config?.stopSequences,\n temperature: request.config?.temperature,\n top_k: topK,\n top_p: topP,\n tool_choice: request.config?.tool_choice,\n metadata: request.config?.metadata,\n tools: request.tools?.map((tool) => this.toAnthropicTool(tool)),\n thinking: thinkingConfig,\n ...restConfig,\n };\n\n return removeUndefinedProperties(body);\n }\n\n protected async createMessage(\n body: MessageCreateParamsNonStreaming,\n abortSignal: AbortSignal\n ): Promise<Message> {\n return await this.client.messages.create(body, { signal: abortSignal });\n }\n\n protected streamMessages(\n body: MessageCreateParamsStreaming,\n abortSignal: AbortSignal\n ): MessageStream {\n return this.client.messages.stream(body, { signal: abortSignal });\n }\n\n protected toGenkitResponse(message: Message): GenerateResponseData {\n return this.fromAnthropicResponse(message);\n }\n\n protected toGenkitPart(event: MessageStreamEvent): Part | undefined {\n return this.fromAnthropicContentBlockChunk(event);\n }\n\n protected fromAnthropicContentBlockChunk(\n event: MessageStreamEvent\n ): Part | undefined {\n // Handle content_block_delta events\n if (event.type === 'content_block_delta') {\n const delta = event.delta;\n\n if (delta.type === 'text_delta') {\n return textDeltaToPart(delta);\n }\n\n if (delta.type === 'thinking_delta') {\n return thinkingDeltaToPart(delta);\n }\n\n if (delta.type === 'citations_delta') {\n return citationsDeltaToPart(delta);\n }\n\n // input_json_delta - ignore\n // signature_delta - ignore\n return undefined;\n }\n\n // Handle content_block_start events\n if (event.type === 'content_block_start') {\n const block = event.content_block;\n\n switch (block.type) {\n case 'text':\n return textBlockToPart(block);\n\n case 'tool_use':\n return toolUseBlockToPart(block);\n\n case 'thinking':\n return thinkingBlockToPart(block);\n\n case 'redacted_thinking':\n return redactedThinkingBlockToPart(block);\n\n case 'server_tool_use':\n return serverToolUseBlockToPart(block);\n\n case 'web_search_tool_result':\n return webSearchToolResultBlockToPart(block);\n\n default: {\n const unknownType = (block as { type: string }).type;\n logger.warn(\n `Unexpected Anthropic content block type in stream: ${unknownType}. Returning undefined. Content block: ${JSON.stringify(block)}`\n );\n return undefined;\n }\n }\n }\n\n // Other event types (message_start, message_delta, etc.) - ignore\n return undefined;\n }\n\n protected fromAnthropicContentBlock(contentBlock: ContentBlock): Part {\n switch (contentBlock.type) {\n case 'text':\n return textBlockToPart(contentBlock);\n\n case 'tool_use':\n return toolUseBlockToPart(contentBlock);\n\n case 'thinking':\n return thinkingBlockToPart(contentBlock);\n\n case 'redacted_thinking':\n return redactedThinkingBlockToPart(contentBlock);\n\n case 'server_tool_use':\n return serverToolUseBlockToPart(contentBlock);\n\n case 'web_search_tool_result':\n return webSearchToolResultBlockToPart(contentBlock);\n\n default: {\n // Exhaustive check (uncomment when all types are handled):\n // const _exhaustive: never = contentBlock;\n // throw new Error(\n // `Unhandled block type: ${(_exhaustive as { type: string }).type}`\n // );\n const unknownType = (contentBlock as { type: string }).type;\n logger.warn(\n `Unexpected Anthropic content block type: ${unknownType}. Returning empty text. Content block: ${JSON.stringify(contentBlock)}`\n );\n return { text: '' };\n }\n }\n }\n\n protected fromAnthropicStopReason(\n reason: Message['stop_reason']\n ): ModelResponseData['finishReason'] {\n switch (reason) {\n case 'max_tokens':\n return 'length';\n case 'end_turn':\n // fall through\n case 'stop_sequence':\n // fall through\n case 'tool_use':\n return 'stop';\n case null:\n return 'unknown';\n default:\n return 'other';\n }\n }\n\n protected fromAnthropicResponse(response: Message): GenerateResponseData {\n return {\n candidates: [\n {\n index: 0,\n finishReason: this.fromAnthropicStopReason(response.stop_reason),\n message: {\n role: 'model',\n content: response.content.map((block) =>\n this.fromAnthropicContentBlock(block)\n ),\n },\n },\n ],\n usage: {\n inputTokens: response.usage.input_tokens,\n outputTokens: response.usage.output_tokens,\n custom: {\n cache_creation_input_tokens:\n response.usage.cache_creation_input_tokens ?? 0,\n cache_read_input_tokens: response.usage.cache_read_input_tokens ?? 0,\n ephemeral_5m_input_tokens:\n response.usage.cache_creation?.ephemeral_5m_input_tokens ?? 0,\n ephemeral_1h_input_tokens:\n response.usage.cache_creation?.ephemeral_1h_input_tokens ?? 0,\n },\n },\n custom: response,\n raw: response,\n };\n }\n}\n"],"mappings":"AAwCA,SAAS,cAAc;AAOvB,SAAS,gBAAgB,iCAAiC;AAC1D,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;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