@langchain/google 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/chat_models/base.cjs +39 -21
- package/dist/chat_models/base.cjs.map +1 -1
- package/dist/chat_models/base.d.cts +1 -3
- package/dist/chat_models/base.d.ts +1 -3
- package/dist/chat_models/base.js +39 -22
- package/dist/chat_models/base.js.map +1 -1
- package/dist/chat_models/index.cjs.map +1 -1
- package/dist/chat_models/index.d.cts +0 -1
- package/dist/chat_models/index.d.ts +0 -1
- package/dist/chat_models/index.js.map +1 -1
- package/dist/chat_models/node.cjs +1 -1
- package/dist/chat_models/node.cjs.map +1 -1
- package/dist/chat_models/node.d.cts +1 -2
- package/dist/chat_models/node.d.ts +1 -2
- package/dist/chat_models/node.js +1 -1
- package/dist/chat_models/node.js.map +1 -1
- package/dist/chat_models/profiles.cjs.map +1 -1
- package/dist/chat_models/profiles.js.map +1 -1
- package/dist/chat_models/types.cjs.map +1 -1
- package/dist/chat_models/types.d.cts +1 -2
- package/dist/chat_models/types.d.ts +1 -2
- package/dist/chat_models/types.js.map +1 -1
- package/dist/clients/index.cjs +1 -0
- package/dist/clients/index.cjs.map +1 -1
- package/dist/clients/index.js +1 -0
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/node.cjs +1 -0
- package/dist/clients/node.cjs.map +1 -1
- package/dist/clients/node.d.cts +0 -1
- package/dist/clients/node.d.ts +0 -1
- package/dist/clients/node.js +1 -0
- package/dist/clients/node.js.map +1 -1
- package/dist/const.cjs.map +1 -1
- package/dist/const.js.map +1 -1
- package/dist/converters/messages.cjs +2 -0
- package/dist/converters/messages.cjs.map +1 -1
- package/dist/converters/messages.js +1 -1
- package/dist/converters/messages.js.map +1 -1
- package/dist/converters/params.cjs +5 -0
- package/dist/converters/params.cjs.map +1 -1
- package/dist/converters/params.js +1 -1
- package/dist/converters/params.js.map +1 -1
- package/dist/converters/tools.cjs +1 -0
- package/dist/converters/tools.cjs.map +1 -1
- package/dist/converters/tools.js +1 -1
- package/dist/converters/tools.js.map +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +1 -1
- package/dist/utils/errors.cjs +27 -10
- package/dist/utils/errors.cjs.map +1 -1
- package/dist/utils/errors.js +28 -12
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/gcp-auth.cjs +2 -0
- package/dist/utils/gcp-auth.cjs.map +1 -1
- package/dist/utils/gcp-auth.js +1 -1
- package/dist/utils/gcp-auth.js.map +1 -1
- package/dist/utils/handler.cjs.map +1 -1
- package/dist/utils/handler.d.cts +0 -1
- package/dist/utils/handler.d.ts +0 -1
- package/dist/utils/handler.js.map +1 -1
- package/dist/utils/metadata.cjs.map +1 -1
- package/dist/utils/metadata.js.map +1 -1
- package/dist/utils/misc.cjs.map +1 -1
- package/dist/utils/misc.d.cts +1 -1
- package/dist/utils/misc.d.ts +1 -1
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/stream.cjs.map +1 -1
- package/dist/utils/stream.js.map +1 -1
- package/dist/utils/stream_events.cjs.map +1 -1
- package/dist/utils/stream_events.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","names":[],"sources":["../../src/chat_models/base.ts"],"sourcesContent":["import {\n BaseChatModel,\n type BaseChatModelCallOptions,\n type LangSmithParams,\n type BaseChatModelParams,\n} from \"@langchain/core/language_models/chat_models\";\nimport {\n AIMessage,\n AIMessageChunk,\n AIMessageChunkFields,\n BaseMessage,\n type UsageMetadata,\n} from \"@langchain/core/messages\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport type { ChatModelStreamEvent } from \"@langchain/core/language_models/event\";\nimport { convertGoogleGeminiStream } from \"../utils/stream_events.js\";\nimport { concat } from \"@langchain/core/utils/stream\";\nimport { ChatGenerationChunk, ChatResult } from \"@langchain/core/outputs\";\nimport { EventSourceParserStream } from \"eventsource-parser/stream\";\nimport type { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nimport PROFILES from \"./profiles.js\";\nimport type {\n BaseLanguageModelInput,\n StructuredOutputMethodOptions,\n} from \"@langchain/core/language_models/base\";\nimport { Runnable, RunnableLambda } from \"@langchain/core/runnables\";\nimport {\n toJsonSchema,\n type JsonSchema7Type,\n} from \"@langchain/core/utils/json_schema\";\nimport {\n InteropZodType,\n isInteropZodSchema,\n} from \"@langchain/core/utils/types\";\n\nimport { ApiClient } from \"../clients/index.js\";\nimport { ChatGoogleFields, settableServiceTier } from \"./types.js\";\nimport { SafeJsonEventParserStream } from \"../utils/stream.js\";\nimport {\n convertAIMessageToText,\n convertGeminiCandidateToAIMessage,\n convertGeminiGenerateContentResponseToUsageMetadata,\n convertGeminiPartsToToolCalls,\n convertMessagesToGeminiContents,\n convertMessagesToGeminiSystemInstruction,\n} from \"../converters/messages.js\";\nimport {\n ConfigurationError,\n MalformedOutputError,\n NoCandidatesError,\n PromptBlockedError,\n RequestError,\n} from \"../utils/errors.js\";\nimport {\n convertToolsToGeminiTools,\n convertToolChoiceToGeminiConfig,\n schemaToGeminiParameters,\n} from \"../converters/tools.js\";\nimport {\n convertParamsToPlatformType,\n convertFieldsToSpeechConfig,\n convertFieldsToThinkingConfig,\n convertFieldsToServiceTier,\n} from \"../converters/params.js\";\nimport { Gemini } from \"./api-types.js\";\nimport { subtractUsageMetadata } from \"../utils/metadata.js\";\nimport {\n isSerializableSchema,\n SerializableSchema,\n} from \"@langchain/core/utils/standard_schema\";\nimport {\n assembleStructuredOutputPipeline,\n createContentParser,\n createFunctionCallingParser,\n} from \"@langchain/core/language_models/structured_output\";\nimport { iife } from \"../utils/misc\";\nimport ServiceTier = Gemini.ServiceTier;\n\nexport type GooglePlatformType = \"gai\" | \"gcp\";\n\nexport function getPlatformType(\n platform: GooglePlatformType | undefined,\n hasApiKey: boolean\n): GooglePlatformType {\n if (typeof platform !== \"undefined\") {\n return platform;\n } else if (hasApiKey) {\n return \"gai\";\n } else {\n return \"gcp\";\n }\n}\n\nfunction usageMetadataToTokenUsage(usageMetadata: UsageMetadata) {\n return {\n promptTokens: usageMetadata.input_tokens,\n completionTokens: usageMetadata.output_tokens,\n totalTokens: usageMetadata.total_tokens,\n };\n}\n\nfunction mapDetailToMediaResolution(\n detail?: ChatGoogleFields[\"detail\"]\n): Gemini.GenerationConfig[\"mediaResolution\"] | undefined {\n switch (detail) {\n case \"low\":\n return \"MEDIA_RESOLUTION_LOW\";\n case \"high\":\n return \"MEDIA_RESOLUTION_HIGH\";\n default:\n return undefined;\n }\n}\n\nexport interface BaseChatGoogleParams\n extends BaseChatModelParams, ChatGoogleFields {\n /**\n * The name of the Gemini model to use.\n *\n * Example: \"gemini-3-pro-preview\"\n */\n model: string;\n\n /**\n * Optional. The API client implementation for making HTTP requests to the Gemini API.\n * If not set, a default client will be used based on the runtime environment.\n */\n apiClient?: ApiClient;\n\n /**\n * Hostname for the API call (if this is running on GCP)\n * Usually this is computed based on location and platformType.\n **/\n endpoint?: string;\n\n /**\n * Region where the LLM is stored (if this is running on GCP)\n * Defaults to \"global\"\n **/\n location?: string;\n\n /**\n * The version of the API functions. Part of the path.\n * Usually this is computed based on platformType.\n **/\n apiVersion?: string;\n\n /**\n * What platform to run the service on.\n * If not specified, the class should determine this from other\n * means. Either way, the platform actually used will be in\n * the \"platform\" getter.\n */\n platformType?: GooglePlatformType;\n\n /**\n * For compatibility with Google's libraries, should this use Vertex?\n * The \"platformType\" parmeter takes precedence.\n */\n vertexai?: boolean;\n\n /**\n * Backwards compatibility.\n * @deprecated in favor of using `disableStreaming` or `.stream()`\n */\n streaming?: boolean;\n\n streamUsage?: boolean;\n}\n\nexport interface BaseChatGoogleCallOptions\n extends BaseChatModelCallOptions, ChatGoogleFields {}\n\nexport abstract class BaseChatGoogle<\n CallOptions extends BaseChatGoogleCallOptions = BaseChatGoogleCallOptions,\n> extends BaseChatModel<CallOptions, AIMessageChunk> {\n model: string;\n\n streaming: boolean;\n\n disableStreaming: boolean;\n\n streamUsage: boolean = true;\n\n protected _platform?: GooglePlatformType;\n\n protected _endpoint?: string;\n\n protected _customHeaders?: Record<string, string>;\n\n protected _location?: string;\n\n protected _apiVersion?: string;\n\n protected apiClient: ApiClient;\n\n constructor(protected params: BaseChatGoogleParams) {\n super(params);\n this._addVersion(\"@langchain/google\", __PKG_VERSION__);\n\n if (!params.apiClient) {\n throw new ConfigurationError(\n \"BaseChatGoogle requires an apiClient. This should be provided automatically by ChatGoogle constructors. If you're extending BaseChatGoogle directly, please provide an apiClient instance.\"\n );\n }\n this.apiClient = params.apiClient;\n\n this.model = params.model;\n this._platform = convertParamsToPlatformType(params);\n this._endpoint = params.endpoint;\n this._customHeaders = params.customHeaders;\n this._location = params.location;\n this._apiVersion = params.apiVersion;\n\n this.disableStreaming = params?.disableStreaming === true;\n this.streaming = params?.streaming === true;\n if (this.disableStreaming) this.streaming = false;\n // disable streaming in BaseChatModel if explicitly disabled\n if (params?.streaming === false) this.disableStreaming = true;\n\n this.streamUsage = params?.streamUsage ?? this.streamUsage;\n if (this.disableStreaming) this.streamUsage = false;\n }\n\n _llmType(): string {\n return \"google\";\n }\n\n protected get platformType(): GooglePlatformType | undefined {\n return this._platform;\n }\n\n protected get platform(): GooglePlatformType {\n return getPlatformType(this._platform, this.apiClient.hasApiKey());\n }\n\n protected get isVertexExpress(): boolean {\n return this.platform === \"gcp\" && this.apiClient.hasApiKey();\n }\n\n protected get apiVersion(): string {\n if (typeof this._apiVersion !== \"undefined\") {\n return this._apiVersion;\n } else if (this.platform === \"gai\") {\n return \"v1beta\";\n } else {\n return \"v1\";\n }\n }\n\n protected get location(): string {\n return this._location || \"global\";\n }\n\n protected get endpoint(): string {\n if (typeof this._endpoint !== \"undefined\") {\n return this._endpoint;\n } else if (this.platform === \"gai\") {\n return \"generativelanguage.googleapis.com\";\n } else if (this.isVertexExpress) {\n return \"aiplatform.googleapis.com\";\n } else if (this.location === \"global\") {\n // See https://docs.cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#use_the_global_endpoint\n return \"aiplatform.googleapis.com\";\n } else {\n return `${this.location}-aiplatform.googleapis.com`;\n }\n }\n\n protected get publisher(): string {\n return \"google\";\n }\n\n protected get urlMethod(): string {\n return this.streaming ? \"streamGenerateContent?alt=sse\" : \"generateContent\";\n }\n\n /**\n * Returns the model profile for this instance's model, describing its\n * capabilities and constraints (e.g. max tokens, input/output modalities,\n * tool calling support).\n *\n * @example\n * ```typescript\n * const model = new ChatGoogle({ model: \"gemini-2.5-pro\" });\n * const profile = model.profile;\n * console.log(profile.maxInputTokens); // 1048576\n * console.log(profile.imageInputs); // true\n * ```\n */\n get profile(): ModelProfile {\n return PROFILES[this.model] ?? {};\n }\n\n protected async buildUrlGemini(urlMethod?: string): Promise<string> {\n return `https://${this.endpoint}/${this.apiVersion}/models/${this.model}:${\n urlMethod ?? this.urlMethod\n }`;\n }\n\n protected async buildUrlVertexExpress(urlMethod?: string): Promise<string> {\n return `https://${this.endpoint}/${this.apiVersion}/publishers/${\n this.publisher\n }/models/${this.model}:${urlMethod ?? this.urlMethod}`;\n }\n\n protected async buildUrlVertexLocation(urlMethod?: string): Promise<string> {\n const projectId = await this.apiClient.getProjectId();\n return `https://${this.endpoint}/${\n this.apiVersion\n }/projects/${projectId}/locations/${this.location}/publishers/${\n this.publisher\n }/models/${this.model}:${urlMethod ?? this.urlMethod}`;\n }\n\n protected async buildUrlVertex(urlMethod?: string): Promise<string> {\n if (this.isVertexExpress) {\n return this.buildUrlVertexExpress(urlMethod);\n } else {\n return this.buildUrlVertexLocation(urlMethod);\n }\n }\n\n protected async buildUrl(urlMethod?: string): Promise<string> {\n switch (this.platform) {\n case \"gai\":\n return this.buildUrlGemini(urlMethod);\n default:\n return this.buildUrlVertex(urlMethod);\n }\n }\n\n override invocationParams(options: this[\"ParsedCallOptions\"]) {\n const fields = combineGoogleChatModelFields(this.params, options);\n const mediaResolution =\n fields.mediaResolution ?? mapDetailToMediaResolution(fields.detail);\n\n // Convert tools to Gemini format\n const tools = fields.tools\n ? convertToolsToGeminiTools(fields.tools)\n : undefined;\n\n // Convert tool choice to Gemini function calling config\n const toolConfig = convertToolChoiceToGeminiConfig(\n options.tool_choice,\n !!(tools && tools.length > 0)\n );\n\n let responseJsonSchema:\n | JsonSchema7Type\n | Record<string, unknown>\n | undefined;\n let responseMimeType: string | undefined;\n\n if (fields.responseSchema) {\n // Convert Zod schema to JSON Schema if needed\n if (\n isInteropZodSchema(fields.responseSchema) ||\n isSerializableSchema(fields.responseSchema)\n ) {\n responseJsonSchema = toJsonSchema(fields.responseSchema);\n } else {\n responseJsonSchema = fields.responseSchema as Record<string, unknown>;\n }\n // Automatically set responseMimeType to \"application/json\" when schema is provided\n responseMimeType = \"application/json\";\n }\n\n return {\n ...(tools && tools.length > 0 ? { tools } : {}),\n ...(toolConfig ? { toolConfig } : {}),\n safetySettings: fields.safetySettings,\n generationConfig: {\n temperature: fields.temperature,\n topP: fields.topP,\n topK: fields.topK,\n maxOutputTokens: fields.maxOutputTokens,\n presencePenalty: fields.presencePenalty,\n frequencyPenalty: fields.frequencyPenalty,\n stopSequences: fields.stopSequences,\n ...(responseMimeType ? { responseMimeType } : {}),\n ...(responseJsonSchema ? { responseJsonSchema } : {}),\n ...(fields.responseModalities && fields.responseModalities.length > 0\n ? { responseModalities: fields.responseModalities }\n : {}),\n candidateCount: 1,\n seed: fields.seed,\n responseLogprobs: fields.responseLogprobs,\n logprobs: fields.logprobs,\n ...(fields.enableEnhancedCivicAnswers !== undefined\n ? { enableEnhancedCivicAnswers: fields.enableEnhancedCivicAnswers }\n : {}),\n thinkingConfig: convertFieldsToThinkingConfig(this.model, fields),\n speechConfig: convertFieldsToSpeechConfig(fields),\n ...(fields.imageConfig ? { imageConfig: fields.imageConfig } : {}),\n ...(mediaResolution ? { mediaResolution } : {}),\n },\n ...convertFieldsToServiceTier(this.platform, fields),\n };\n }\n\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams {\n const params = this.invocationParams(options);\n return {\n ls_provider: this.platform === \"gcp\" ? \"google_vertexai\" : \"google_genai\",\n ls_model_name: this.model,\n ls_model_type: \"chat\",\n ls_temperature: params.generationConfig?.temperature ?? undefined,\n ls_max_tokens: params.generationConfig?.maxOutputTokens ?? undefined,\n ls_stop: options.stop,\n };\n }\n\n getHeaders(options: this[\"ParsedCallOptions\"]): HeadersInit {\n const fields = combineGoogleChatModelFields(this.params, options);\n\n // The priority type is set via header only for Vertex\n const priorityHeaders: Record<string, string> =\n this.platform === \"gcp\" &&\n typeof fields.serviceTier !== \"undefined\" &&\n settableServiceTier.includes(fields.serviceTier)\n ? { \"X-Vertex-AI-LLM-Shared-Request-Type\": fields.serviceTier }\n : {};\n\n return {\n \"Content-Type\": \"application/json\",\n ...priorityHeaders,\n ...this._customHeaders,\n ...options.customHeaders,\n };\n }\n\n async _generate(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager?: CallbackManagerForLLMRun\n ): Promise<ChatResult> {\n if (this.streaming) {\n const stream = await this._streamResponseChunks(\n messages,\n options,\n runManager\n );\n let finalChunk: ChatGenerationChunk | null = null;\n for await (const chunk of stream) {\n finalChunk = !finalChunk ? chunk : concat(finalChunk, chunk);\n }\n if (\n typeof finalChunk?.message?.content === \"string\" &&\n typeof (\n finalChunk?.message?.additional_kwargs\n ?.originalTextContentBlock as Record<string, unknown>\n )?.text === \"string\"\n ) {\n (\n finalChunk.message.additional_kwargs\n .originalTextContentBlock as Record<string, unknown>\n ).text = finalChunk.message.content;\n }\n return {\n generations: finalChunk ? [finalChunk] : [],\n };\n }\n\n const url = await this.buildUrl();\n const headers = this.getHeaders(options);\n const body = {\n ...this.invocationParams(options),\n systemInstruction: convertMessagesToGeminiSystemInstruction(messages),\n contents: convertMessagesToGeminiContents(messages),\n };\n\n const moduleName = this.constructor.name;\n await runManager?.handleCustomEvent(`google-request-${moduleName}`, {\n url,\n headers,\n body,\n });\n\n const response = await this.apiClient.fetch(\n new Request(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n signal: options.signal,\n })\n );\n\n if (!response.ok) {\n const error = await RequestError.fromResponse(response);\n await runManager?.handleCustomEvent(`google-response-${moduleName}`, {\n error,\n });\n throw error;\n }\n\n const data: Gemini.GenerateContentResponse = await response.json();\n await runManager?.handleCustomEvent(`google-response-${moduleName}`, {\n data,\n url: response.url,\n headers: Array.from(response.headers.entries()),\n status: response.status,\n statusText: response.statusText,\n });\n\n // Check for prompt feedback errors\n if (data.promptFeedback?.blockReason) {\n throw PromptBlockedError.fromPromptFeedback(data.promptFeedback);\n }\n\n // Check if we have candidates\n if (!data.candidates || data.candidates.length === 0) {\n throw new NoCandidatesError();\n }\n\n // Use the first candidate\n const candidate = data.candidates[0];\n const message = convertGeminiCandidateToAIMessage(candidate);\n\n // Extract text content from the message\n const text = convertAIMessageToText(message);\n\n const usageMetadata =\n convertGeminiGenerateContentResponseToUsageMetadata(data);\n message.usage_metadata = usageMetadata;\n\n const serviceTier: ServiceTier = iife((): ServiceTier => {\n // @ts-expect-error - trafficType is defined on Vertex, so isn't in the OpenAPI spec\n const trafficType: string | undefined = data.usageMetadata?.trafficType;\n\n // AI Studio replies with actual service type in the header\n const serviceTierHeader: string | null = response.headers.get(\n \"x-gemini-service-tier\"\n );\n\n if (trafficType?.startsWith(\"ON_DEMAND_\")) {\n return trafficType?.substring(\"ON_DEMAND_\".length).toLowerCase();\n }\n return serviceTierHeader || \"standard\";\n });\n\n return {\n generations: [\n {\n text,\n message,\n generationInfo: {\n finishReason: candidate.finishReason,\n finishMessage: candidate.finishMessage,\n safetyRatings: candidate.safetyRatings,\n citationMetadata: candidate.citationMetadata,\n tokenCount: candidate.tokenCount,\n },\n },\n ],\n llmOutput: {\n tokenUsage: usageMetadataToTokenUsage(usageMetadata),\n model: data.modelVersion,\n responseId: data.responseId,\n usageMetadata,\n serviceTier,\n },\n };\n }\n\n async *_streamChatModelEvents(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n _runManager?: CallbackManagerForLLMRun\n ): AsyncGenerator<ChatModelStreamEvent> {\n const body = {\n ...this.invocationParams(options),\n systemInstruction: convertMessagesToGeminiSystemInstruction(messages),\n contents: convertMessagesToGeminiContents(messages),\n };\n\n const url = await this.buildUrl(\"streamGenerateContent?alt=sse\");\n const headers = this.getHeaders(options);\n\n const response = await this.apiClient.fetch(\n new Request(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n signal: options.signal,\n })\n );\n\n if (!response.ok) {\n throw await RequestError.fromResponse(response);\n }\n\n if (!response.body) {\n return;\n }\n\n const eventStream = response.body\n .pipeThrough(new TextDecoderStream())\n .pipeThrough(new EventSourceParserStream())\n .pipeThrough(\n new SafeJsonEventParserStream<Gemini.GenerateContentResponse>()\n );\n\n const shouldStreamUsage =\n this.streamUsage !== false && options.streamUsage !== false;\n\n async function* geminiChunks(\n stream: ReadableStream<Gemini.GenerateContentResponse | null>,\n signal?: AbortSignal\n ) {\n const reader = stream.getReader();\n try {\n while (true) {\n if (signal?.aborted) {\n return;\n }\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n if (value !== null) {\n yield value;\n }\n }\n } finally {\n reader.releaseLock();\n }\n }\n\n yield* convertGoogleGeminiStream(\n geminiChunks(eventStream, options.signal),\n {\n streamUsage: shouldStreamUsage,\n }\n );\n }\n\n async *_streamResponseChunks(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager?: CallbackManagerForLLMRun\n ): AsyncGenerator<ChatGenerationChunk> {\n const streamUsage: boolean = this.streamUsage ?? true;\n\n const body = {\n ...this.invocationParams(options),\n systemInstruction: convertMessagesToGeminiSystemInstruction(messages),\n contents: convertMessagesToGeminiContents(messages),\n };\n\n const url = await this.buildUrl(\"streamGenerateContent?alt=sse\");\n const headers = this.getHeaders(options);\n const moduleName = this.constructor.name;\n await runManager?.handleCustomEvent(`google-request-${moduleName}`, {\n url,\n headers,\n body,\n });\n\n const response = await this.apiClient.fetch(\n new Request(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n signal: options.signal,\n })\n );\n\n await runManager?.handleCustomEvent(`google-response-${moduleName}`, {\n url: response.url,\n headers: Array.from(response.headers.entries()),\n status: response.status,\n statusText: response.statusText,\n });\n\n if (!response.ok) {\n const error = await RequestError.fromResponse(response);\n await runManager?.handleCustomEvent(`google-response-${moduleName}`, {\n error,\n });\n throw error;\n }\n\n if (response.body) {\n let previousUsage: UsageMetadata | undefined;\n const stream = response.body\n .pipeThrough(new TextDecoderStream())\n .pipeThrough(new EventSourceParserStream())\n .pipeThrough(\n new SafeJsonEventParserStream<Gemini.GenerateContentResponse>()\n )\n .pipeThrough(\n new TransformStream<\n Gemini.GenerateContentResponse,\n ChatGenerationChunk\n >({\n transform(chunk, controller) {\n // oxlint-disable-next-line no-void\n void runManager?.handleCustomEvent(`google-chunk-${moduleName}`, {\n chunk,\n });\n if (chunk === null) {\n controller.enqueue(\n new ChatGenerationChunk({\n text: \"\",\n message: new AIMessageChunk({ content: \"\" }),\n generationInfo: { finishReason: \"stop\" },\n })\n );\n return;\n }\n\n // Extract text delta from the chunk\n const candidate = chunk.candidates?.[0];\n if (!candidate) {\n return;\n }\n\n const message = convertGeminiCandidateToAIMessage(candidate);\n const text = convertAIMessageToText(message);\n\n const parts = candidate.content?.parts ?? [];\n const toolCalls = convertGeminiPartsToToolCalls(parts);\n\n // Only emit if we have content\n if (parts.length > 0 || candidate.finishReason) {\n const messageChunkParams: AIMessageChunkFields = {\n content: message.content,\n tool_calls: toolCalls,\n response_metadata: {\n model_provider: \"google\",\n },\n additional_kwargs: {\n ...(message.additional_kwargs.originalTextContentBlock\n ? {\n originalTextContentBlock:\n message.additional_kwargs.originalTextContentBlock,\n }\n : {}),\n ...(candidate.finishReason\n ? {\n finishReason: candidate.finishReason,\n finishMessage: candidate.finishMessage,\n }\n : {}),\n },\n };\n\n if (chunk?.usageMetadata && streamUsage) {\n const cumulative =\n convertGeminiGenerateContentResponseToUsageMetadata(chunk);\n messageChunkParams.usage_metadata = subtractUsageMetadata(\n cumulative,\n previousUsage\n );\n previousUsage = cumulative;\n }\n const messageChunk = new AIMessageChunk(messageChunkParams);\n\n controller.enqueue(\n new ChatGenerationChunk({\n text: text,\n message: messageChunk,\n generationInfo: {\n ...(candidate.finishReason && {\n finishReason: candidate.finishReason,\n finishMessage: candidate.finishMessage,\n }),\n ...(candidate.safetyRatings && {\n safetyRatings: candidate.safetyRatings,\n }),\n },\n })\n );\n }\n },\n })\n );\n\n const reader = stream.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n yield value;\n await runManager?.handleLLMNewToken(\n value.text ?? \"\",\n undefined,\n undefined,\n undefined,\n undefined,\n { chunk: value }\n );\n }\n } finally {\n reader.releaseLock();\n }\n }\n }\n\n /**\n * Bind tool-like objects to this chat model.\n *\n * @param tools A list of tool definitions to bind to this chat model.\n * Can be a structured tool, an OpenAI formatted tool, or a Gemini function declaration.\n * @param kwargs Any additional parameters to bind.\n */\n bindTools(\n tools: BindToolsInput[],\n kwargs?: Partial<CallOptions>\n ): Runnable<BaseMessage[], AIMessageChunk, CallOptions> {\n return this.withConfig({\n ...kwargs,\n tools,\n } as Partial<CallOptions>);\n }\n\n withStructuredOutput<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<false>\n ): Runnable<BaseLanguageModelInput, RunOutput>;\n\n withStructuredOutput<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<true>\n ): Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }>;\n\n withStructuredOutput<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<boolean>\n ):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }>;\n\n /**\n * Get structured output from the model based on a schema.\n *\n * This method supports two modes:\n * - `jsonMode`: Uses `responseSchema` to get JSON responses directly (preferred for structured outputs)\n * - `functionCalling`: Uses function calling with tools (default, for compatibility)\n *\n * @param outputSchema - The schema to use for structured output (Zod schema or JSON Schema)\n * @param config - Configuration options including method and whether to include raw response\n * @returns A Runnable that returns the parsed structured output\n */\n withStructuredOutput<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<boolean>\n ):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n > {\n let llm: Runnable<BaseMessage[], AIMessageChunk, CallOptions>;\n let outputParser: Runnable<BaseMessage, RunOutput>;\n\n const { schema, name, includeRaw } = {\n ...config,\n schema: outputSchema,\n };\n let method = config?.method ?? \"functionCalling\";\n\n if (method === \"jsonMode\") {\n console.warn(\n `\"jsonMode\" is not supported for Google models. Falling back to \"jsonSchema\".`\n );\n method = \"jsonSchema\";\n }\n\n if (method === \"jsonSchema\") {\n // Use JSON mode with responseSchema\n llm = this.withConfig({\n responseSchema: schema,\n } as Partial<CallOptions>);\n\n outputParser = RunnableLambda.from<BaseMessage, RunOutput>(\n async (input: BaseMessage): Promise<RunOutput> => {\n if (\n !AIMessage.isInstance(input) &&\n !AIMessageChunk.isInstance(input)\n ) {\n throw new MalformedOutputError({\n message: \"Input is not an AIMessage or AIMessageChunk.\",\n });\n }\n\n if (!input.text) {\n throw new MalformedOutputError({\n message:\n \"No content found in response. Cannot parse structured output.\",\n });\n }\n\n // Parse JSON and validate with schema\n const parser = createContentParser(schema);\n return await parser.parse(input.text);\n }\n );\n } else if (method === \"functionCalling\") {\n // Use function calling mode\n let functionName = name ?? \"extract\";\n let geminiFunctionDeclaration: Gemini.Tools.FunctionDeclaration;\n\n if (isInteropZodSchema(schema) || isSerializableSchema(schema)) {\n const jsonSchema = schemaToGeminiParameters(schema);\n const description =\n typeof jsonSchema.description === \"string\"\n ? jsonSchema.description\n : \"A function available to call.\";\n geminiFunctionDeclaration = {\n name: functionName,\n description,\n parameters: jsonSchema as Gemini.Tools.Schema,\n };\n } else if (\n typeof schema.name === \"string\" &&\n typeof schema.parameters === \"object\" &&\n schema.parameters != null\n ) {\n geminiFunctionDeclaration = schema as Gemini.Tools.FunctionDeclaration;\n functionName = schema.name;\n } else {\n // We are providing the schema for *just* the parameters\n const parameters = schemaToGeminiParameters(schema);\n geminiFunctionDeclaration = {\n name: functionName,\n description: (schema as { description?: string }).description ?? \"\",\n parameters,\n };\n }\n\n const tools: Gemini.Tool[] = [\n {\n functionDeclarations: [geminiFunctionDeclaration],\n },\n ];\n llm = this.bindTools(tools).withConfig({\n tool_choice: functionName,\n } as Partial<CallOptions>);\n\n outputParser = createFunctionCallingParser(schema, functionName);\n } else {\n throw new ConfigurationError(\n `Unrecognized structured output method '${method}'. Expected 'functionCalling' or 'jsonSchema'`\n );\n }\n\n return assembleStructuredOutputPipeline(\n llm,\n outputParser,\n includeRaw,\n includeRaw\n ? \"ChatGoogleStructuredOutputRunnable\"\n : \"ChatGoogleStructuredOutput\"\n );\n }\n}\n\ntype CombinableFields = Omit<BaseChatGoogleParams, \"model\">;\n\nexport function combineGoogleChatModelFields(\n a: CombinableFields,\n b: CombinableFields,\n ...rest: CombinableFields[]\n): CombinableFields {\n const combined: CombinableFields = {\n temperature: b.temperature ?? a.temperature,\n topP: b.topP ?? a.topP,\n topK: b.topK ?? a.topK,\n maxOutputTokens: b.maxOutputTokens ?? a.maxOutputTokens,\n presencePenalty: b.presencePenalty ?? a.presencePenalty,\n frequencyPenalty: b.frequencyPenalty ?? a.frequencyPenalty,\n stopSequences: b.stopSequences ?? a.stopSequences,\n seed: b.seed ?? a.seed,\n responseLogprobs: b.responseLogprobs ?? a.responseLogprobs,\n logprobs: b.logprobs ?? a.logprobs,\n safetySettings: b.safetySettings ?? a.safetySettings,\n responseSchema: b.responseSchema ?? a.responseSchema,\n tools: b.tools ?? a.tools,\n responseModalities: b.responseModalities ?? a.responseModalities,\n enableEnhancedCivicAnswers:\n b.enableEnhancedCivicAnswers ?? a.enableEnhancedCivicAnswers,\n speechConfig: b.speechConfig ?? a.speechConfig,\n imageConfig: b.imageConfig ?? a.imageConfig,\n mediaResolution: b.mediaResolution ?? a.mediaResolution,\n detail: b.detail ?? a.detail,\n maxReasoningTokens: b.maxReasoningTokens ?? a.maxReasoningTokens,\n thinkingBudget: b.thinkingBudget ?? a.thinkingBudget,\n reasoningEffort: b.reasoningEffort ?? a.reasoningEffort,\n thinkingLevel: b.thinkingLevel ?? a.thinkingLevel,\n serviceTier: b.serviceTier ?? a.serviceTier,\n };\n if (rest.length > 0) {\n return combineGoogleChatModelFields(combined, rest[0], ...rest.slice(1));\n }\n return combined;\n}\n\nexport function getGoogleChatModelParams<TParams extends BaseChatGoogleParams>(\n modelOrParams: string | TParams,\n paramsArg?: Omit<TParams, \"model\">\n): TParams {\n const model =\n typeof modelOrParams === \"string\" ? modelOrParams : modelOrParams.model;\n const params = typeof modelOrParams === \"string\" ? paramsArg : modelOrParams;\n return {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;EACxC,iBAAiB,EAAE,mBAAmB,EAAE;EACxC,kBAAkB,EAAE,oBAAoB,EAAE;EAC1C,eAAe,EAAE,iBAAiB,EAAE;EACpC,MAAM,EAAE,QAAQ,EAAE;EAClB,kBAAkB,EAAE,oBAAoB,EAAE;EAC1C,UAAU,EAAE,YAAY,EAAE;EAC1B,gBAAgB,EAAE,kBAAkB,EAAE;EACtC,gBAAgB,EAAE,kBAAkB,EAAE;EACtC,OAAO,EAAE,SAAS,EAAE;EACpB,oBAAoB,EAAE,sBAAsB,EAAE;EAC9C,4BACE,EAAE,8BAA8B,EAAE;EACpC,cAAc,EAAE,gBAAgB,EAAE;EAClC,aAAa,EAAE,eAAe,EAAE;EAChC,iBAAiB,EAAE,mBAAmB,EAAE;EACxC,QAAQ,EAAE,UAAU,EAAE;EACtB,oBAAoB,EAAE,sBAAsB,EAAE;EAC9C,gBAAgB,EAAE,kBAAkB,EAAE;EACtC,iBAAiB,EAAE,mBAAmB,EAAE;EACxC,eAAe,EAAE,iBAAiB,EAAE;EACpC,aAAa,EAAE,eAAe,EAAE;EACjC;AACD,KAAI,KAAK,SAAS,EAChB,QAAO,6BAA6B,UAAU,KAAK,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;AAE1E,QAAO;;AAGT,SAAgB,yBACd,eACA,WACS;AAIT,QAAO;EAAE,OAFP,OAAO,kBAAkB,WAAW,gBAAgB,cAAc;EAEpD,GADD,OAAO,kBAAkB,WAAW,YAAY;EACpC"}
|
|
1
|
+
{"version":3,"file":"base.js","names":[],"sources":["../../src/chat_models/base.ts"],"sourcesContent":["import {\n BaseChatModel,\n type BaseChatModelCallOptions,\n type LangSmithParams,\n type BaseChatModelParams,\n} from \"@langchain/core/language_models/chat_models\";\nimport {\n AIMessage,\n AIMessageChunk,\n AIMessageChunkFields,\n BaseMessage,\n type UsageMetadata,\n} from \"@langchain/core/messages\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport type { ChatModelStreamEvent } from \"@langchain/core/language_models/event\";\nimport { convertGoogleGeminiStream } from \"../utils/stream_events.js\";\nimport { concat } from \"@langchain/core/utils/stream\";\nimport { ChatGenerationChunk, ChatResult } from \"@langchain/core/outputs\";\nimport { EventSourceParserStream } from \"eventsource-parser/stream\";\nimport type { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nimport PROFILES from \"./profiles.js\";\nimport type {\n BaseLanguageModelInput,\n StructuredOutputMethodOptions,\n} from \"@langchain/core/language_models/base\";\nimport { Runnable, RunnableLambda } from \"@langchain/core/runnables\";\nimport {\n toJsonSchema,\n type JsonSchema7Type,\n} from \"@langchain/core/utils/json_schema\";\nimport {\n InteropZodType,\n isInteropZodSchema,\n} from \"@langchain/core/utils/types\";\n\nimport { ApiClient } from \"../clients/index.js\";\nimport { ChatGoogleFields, settableServiceTier } from \"./types.js\";\nimport { SafeJsonEventParserStream } from \"../utils/stream.js\";\nimport {\n convertAIMessageToText,\n convertGeminiCandidateToAIMessage,\n convertGeminiGenerateContentResponseToUsageMetadata,\n convertGeminiPartsToToolCalls,\n convertMessagesToGeminiContents,\n convertMessagesToGeminiSystemInstruction,\n} from \"../converters/messages.js\";\nimport {\n ConfigurationError,\n MalformedOutputError,\n NoCandidatesError,\n PromptBlockedError,\n RequestError,\n} from \"../utils/errors.js\";\nimport {\n convertToolsToGeminiTools,\n convertToolChoiceToGeminiConfig,\n schemaToGeminiParameters,\n} from \"../converters/tools.js\";\nimport {\n convertParamsToPlatformType,\n convertFieldsToSpeechConfig,\n convertFieldsToThinkingConfig,\n convertFieldsToServiceTier,\n} from \"../converters/params.js\";\nimport { Gemini } from \"./api-types.js\";\nimport { subtractUsageMetadata } from \"../utils/metadata.js\";\nimport {\n isSerializableSchema,\n SerializableSchema,\n} from \"@langchain/core/utils/standard_schema\";\nimport {\n assembleStructuredOutputPipeline,\n createContentParser,\n createFunctionCallingParser,\n} from \"@langchain/core/language_models/structured_output\";\nimport { iife } from \"../utils/misc\";\nimport ServiceTier = Gemini.ServiceTier;\n\nexport type GooglePlatformType = \"gai\" | \"gcp\";\n\nexport function getPlatformType(\n platform: GooglePlatformType | undefined,\n hasApiKey: boolean\n): GooglePlatformType {\n if (typeof platform !== \"undefined\") {\n return platform;\n } else if (hasApiKey) {\n return \"gai\";\n } else {\n return \"gcp\";\n }\n}\n\nfunction usageMetadataToTokenUsage(usageMetadata: UsageMetadata) {\n return {\n promptTokens: usageMetadata.input_tokens,\n completionTokens: usageMetadata.output_tokens,\n totalTokens: usageMetadata.total_tokens,\n };\n}\n\nfunction mapDetailToMediaResolution(\n detail?: ChatGoogleFields[\"detail\"]\n): Gemini.GenerationConfig[\"mediaResolution\"] | undefined {\n switch (detail) {\n case \"low\":\n return \"MEDIA_RESOLUTION_LOW\";\n case \"high\":\n return \"MEDIA_RESOLUTION_HIGH\";\n default:\n return undefined;\n }\n}\n\nexport interface BaseChatGoogleParams\n extends BaseChatModelParams, ChatGoogleFields {\n /**\n * The name of the Gemini model to use.\n *\n * Example: \"gemini-3-pro-preview\"\n */\n model: string;\n\n /**\n * Optional. The API client implementation for making HTTP requests to the Gemini API.\n * If not set, a default client will be used based on the runtime environment.\n */\n apiClient?: ApiClient;\n\n /**\n * Hostname for the API call (if this is running on GCP)\n * Usually this is computed based on location and platformType.\n **/\n endpoint?: string;\n\n /**\n * Region where the LLM is stored (if this is running on GCP)\n * Defaults to \"global\"\n **/\n location?: string;\n\n /**\n * The version of the API functions. Part of the path.\n * Usually this is computed based on platformType.\n **/\n apiVersion?: string;\n\n /**\n * What platform to run the service on.\n * If not specified, the class should determine this from other\n * means. Either way, the platform actually used will be in\n * the \"platform\" getter.\n */\n platformType?: GooglePlatformType;\n\n /**\n * For compatibility with Google's libraries, should this use Vertex?\n * The \"platformType\" parmeter takes precedence.\n */\n vertexai?: boolean;\n\n /**\n * Backwards compatibility.\n * @deprecated in favor of using `disableStreaming` or `.stream()`\n */\n streaming?: boolean;\n\n streamUsage?: boolean;\n}\n\nexport interface BaseChatGoogleCallOptions\n extends BaseChatModelCallOptions, ChatGoogleFields {}\n\nexport abstract class BaseChatGoogle<\n CallOptions extends BaseChatGoogleCallOptions = BaseChatGoogleCallOptions,\n> extends BaseChatModel<CallOptions, AIMessageChunk> {\n model: string;\n\n streaming: boolean;\n\n disableStreaming: boolean;\n\n streamUsage: boolean = true;\n\n protected _platform?: GooglePlatformType;\n\n protected _endpoint?: string;\n\n protected _customHeaders?: Record<string, string>;\n\n protected _location?: string;\n\n protected _apiVersion?: string;\n\n protected apiClient: ApiClient;\n\n constructor(protected params: BaseChatGoogleParams) {\n super(params);\n this._addVersion(\"@langchain/google\", __PKG_VERSION__);\n\n if (!params.apiClient) {\n throw new ConfigurationError(\n \"BaseChatGoogle requires an apiClient. This should be provided automatically by ChatGoogle constructors. If you're extending BaseChatGoogle directly, please provide an apiClient instance.\"\n );\n }\n this.apiClient = params.apiClient;\n\n this.model = params.model;\n this._platform = convertParamsToPlatformType(params);\n this._endpoint = params.endpoint;\n this._customHeaders = params.customHeaders;\n this._location = params.location;\n this._apiVersion = params.apiVersion;\n\n this.disableStreaming = params?.disableStreaming === true;\n this.streaming = params?.streaming === true;\n if (this.disableStreaming) this.streaming = false;\n // disable streaming in BaseChatModel if explicitly disabled\n if (params?.streaming === false) this.disableStreaming = true;\n\n this.streamUsage = params?.streamUsage ?? this.streamUsage;\n if (this.disableStreaming) this.streamUsage = false;\n }\n\n _llmType(): string {\n return \"google\";\n }\n\n protected get platformType(): GooglePlatformType | undefined {\n return this._platform;\n }\n\n protected get platform(): GooglePlatformType {\n return getPlatformType(this._platform, this.apiClient.hasApiKey());\n }\n\n protected get isVertexExpress(): boolean {\n return this.platform === \"gcp\" && this.apiClient.hasApiKey();\n }\n\n protected get apiVersion(): string {\n if (typeof this._apiVersion !== \"undefined\") {\n return this._apiVersion;\n } else if (this.platform === \"gai\") {\n return \"v1beta\";\n } else {\n return \"v1\";\n }\n }\n\n protected get location(): string {\n return this._location || \"global\";\n }\n\n protected get endpoint(): string {\n if (typeof this._endpoint !== \"undefined\") {\n return this._endpoint;\n } else if (this.platform === \"gai\") {\n return \"generativelanguage.googleapis.com\";\n } else if (this.isVertexExpress) {\n return \"aiplatform.googleapis.com\";\n } else if (this.location === \"global\") {\n // See https://docs.cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#use_the_global_endpoint\n return \"aiplatform.googleapis.com\";\n } else {\n return `${this.location}-aiplatform.googleapis.com`;\n }\n }\n\n protected get publisher(): string {\n return \"google\";\n }\n\n protected get urlMethod(): string {\n return this.streaming ? \"streamGenerateContent?alt=sse\" : \"generateContent\";\n }\n\n /**\n * Returns the model profile for this instance's model, describing its\n * capabilities and constraints (e.g. max tokens, input/output modalities,\n * tool calling support).\n *\n * @example\n * ```typescript\n * const model = new ChatGoogle({ model: \"gemini-2.5-pro\" });\n * const profile = model.profile;\n * console.log(profile.maxInputTokens); // 1048576\n * console.log(profile.imageInputs); // true\n * ```\n */\n get profile(): ModelProfile {\n return PROFILES[this.model] ?? {};\n }\n\n protected async buildUrlGemini(urlMethod?: string): Promise<string> {\n return `https://${this.endpoint}/${this.apiVersion}/models/${this.model}:${\n urlMethod ?? this.urlMethod\n }`;\n }\n\n protected async buildUrlVertexExpress(urlMethod?: string): Promise<string> {\n return `https://${this.endpoint}/${this.apiVersion}/publishers/${\n this.publisher\n }/models/${this.model}:${urlMethod ?? this.urlMethod}`;\n }\n\n protected async buildUrlVertexLocation(urlMethod?: string): Promise<string> {\n const projectId = await this.apiClient.getProjectId();\n return `https://${this.endpoint}/${\n this.apiVersion\n }/projects/${projectId}/locations/${this.location}/publishers/${\n this.publisher\n }/models/${this.model}:${urlMethod ?? this.urlMethod}`;\n }\n\n protected async buildUrlVertex(urlMethod?: string): Promise<string> {\n if (this.isVertexExpress) {\n return this.buildUrlVertexExpress(urlMethod);\n } else {\n return this.buildUrlVertexLocation(urlMethod);\n }\n }\n\n protected async buildUrl(urlMethod?: string): Promise<string> {\n switch (this.platform) {\n case \"gai\":\n return this.buildUrlGemini(urlMethod);\n default:\n return this.buildUrlVertex(urlMethod);\n }\n }\n\n override invocationParams(options: this[\"ParsedCallOptions\"]) {\n const fields = combineGoogleChatModelFields(this.params, options);\n const mediaResolution =\n fields.mediaResolution ?? mapDetailToMediaResolution(fields.detail);\n\n // Convert tools to Gemini format\n const tools = fields.tools\n ? convertToolsToGeminiTools(fields.tools)\n : undefined;\n\n // Convert tool choice to Gemini function calling config\n const toolConfig = convertToolChoiceToGeminiConfig(\n options.tool_choice,\n !!(tools && tools.length > 0)\n );\n\n let responseJsonSchema:\n | JsonSchema7Type\n | Record<string, unknown>\n | undefined;\n let responseMimeType: string | undefined;\n\n if (fields.responseSchema) {\n // Convert Zod schema to JSON Schema if needed\n if (\n isInteropZodSchema(fields.responseSchema) ||\n isSerializableSchema(fields.responseSchema)\n ) {\n responseJsonSchema = toJsonSchema(fields.responseSchema);\n } else {\n responseJsonSchema = fields.responseSchema as Record<string, unknown>;\n }\n // Automatically set responseMimeType to \"application/json\" when schema is provided\n responseMimeType = \"application/json\";\n }\n\n return {\n ...(tools && tools.length > 0 ? { tools } : {}),\n ...(toolConfig ? { toolConfig } : {}),\n safetySettings: fields.safetySettings,\n generationConfig: {\n temperature: fields.temperature,\n topP: fields.topP,\n topK: fields.topK,\n maxOutputTokens: fields.maxOutputTokens,\n presencePenalty: fields.presencePenalty,\n frequencyPenalty: fields.frequencyPenalty,\n stopSequences: fields.stopSequences,\n ...(responseMimeType ? { responseMimeType } : {}),\n ...(responseJsonSchema ? { responseJsonSchema } : {}),\n ...(fields.responseModalities && fields.responseModalities.length > 0\n ? { responseModalities: fields.responseModalities }\n : {}),\n candidateCount: 1,\n seed: fields.seed,\n responseLogprobs: fields.responseLogprobs,\n logprobs: fields.logprobs,\n ...(fields.enableEnhancedCivicAnswers !== undefined\n ? { enableEnhancedCivicAnswers: fields.enableEnhancedCivicAnswers }\n : {}),\n thinkingConfig: convertFieldsToThinkingConfig(this.model, fields),\n speechConfig: convertFieldsToSpeechConfig(fields),\n ...(fields.imageConfig ? { imageConfig: fields.imageConfig } : {}),\n ...(mediaResolution ? { mediaResolution } : {}),\n },\n ...convertFieldsToServiceTier(this.platform, fields),\n };\n }\n\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams {\n const params = this.invocationParams(options);\n return {\n ls_provider: this.platform === \"gcp\" ? \"google_vertexai\" : \"google_genai\",\n ls_model_name: this.model,\n ls_model_type: \"chat\",\n ls_temperature: params.generationConfig?.temperature ?? undefined,\n ls_max_tokens: params.generationConfig?.maxOutputTokens ?? undefined,\n ls_stop: options.stop,\n };\n }\n\n getHeaders(options: this[\"ParsedCallOptions\"]): HeadersInit {\n const fields = combineGoogleChatModelFields(this.params, options);\n\n // The priority type is set via header only for Vertex\n const priorityHeaders: Record<string, string> =\n this.platform === \"gcp\" &&\n typeof fields.serviceTier !== \"undefined\" &&\n settableServiceTier.includes(fields.serviceTier)\n ? { \"X-Vertex-AI-LLM-Shared-Request-Type\": fields.serviceTier }\n : {};\n\n return {\n \"Content-Type\": \"application/json\",\n ...priorityHeaders,\n ...this._customHeaders,\n ...options.customHeaders,\n };\n }\n\n async _generate(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager?: CallbackManagerForLLMRun\n ): Promise<ChatResult> {\n if (this.streaming) {\n const stream = await this._streamResponseChunks(\n messages,\n options,\n runManager\n );\n let finalChunk: ChatGenerationChunk | null = null;\n for await (const chunk of stream) {\n finalChunk = !finalChunk ? chunk : concat(finalChunk, chunk);\n }\n if (\n typeof finalChunk?.message?.content === \"string\" &&\n typeof (\n finalChunk?.message?.additional_kwargs\n ?.originalTextContentBlock as Record<string, unknown>\n )?.text === \"string\"\n ) {\n (\n finalChunk.message.additional_kwargs\n .originalTextContentBlock as Record<string, unknown>\n ).text = finalChunk.message.content;\n }\n return {\n generations: finalChunk ? [finalChunk] : [],\n };\n }\n\n const url = await this.buildUrl();\n const headers = this.getHeaders(options);\n const body = {\n ...this.invocationParams(options),\n systemInstruction: convertMessagesToGeminiSystemInstruction(messages),\n contents: convertMessagesToGeminiContents(messages),\n };\n\n const moduleName = this.constructor.name;\n await runManager?.handleCustomEvent(`google-request-${moduleName}`, {\n url,\n headers,\n body,\n });\n\n let response: Response;\n try {\n response = await this.caller.callWithOptions(\n { signal: options.signal, maxRetries: options.maxRetries },\n async () => {\n const nextResponse = await this.apiClient.fetch(\n new Request(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n signal: options.signal,\n })\n );\n\n if (!nextResponse.ok) {\n throw await RequestError.fromResponse(nextResponse);\n }\n\n return nextResponse;\n }\n );\n } catch (error) {\n await runManager?.handleCustomEvent(`google-response-${moduleName}`, {\n error,\n });\n throw error;\n }\n\n const data: Gemini.GenerateContentResponse = await response.json();\n await runManager?.handleCustomEvent(`google-response-${moduleName}`, {\n data,\n url: response.url,\n headers: Array.from(response.headers.entries()),\n status: response.status,\n statusText: response.statusText,\n });\n\n // Check for prompt feedback errors\n if (data.promptFeedback?.blockReason) {\n throw PromptBlockedError.fromPromptFeedback(data.promptFeedback);\n }\n\n // Check if we have candidates\n if (!data.candidates || data.candidates.length === 0) {\n throw new NoCandidatesError();\n }\n\n // Use the first candidate\n const candidate = data.candidates[0];\n const message = convertGeminiCandidateToAIMessage(candidate);\n\n // Extract text content from the message\n const text = convertAIMessageToText(message);\n\n const usageMetadata =\n convertGeminiGenerateContentResponseToUsageMetadata(data);\n message.usage_metadata = usageMetadata;\n\n const serviceTier: ServiceTier = iife((): ServiceTier => {\n // @ts-expect-error - trafficType is defined on Vertex, so isn't in the OpenAPI spec\n const trafficType: string | undefined = data.usageMetadata?.trafficType;\n\n // AI Studio replies with actual service type in the header\n const serviceTierHeader: string | null = response.headers.get(\n \"x-gemini-service-tier\"\n );\n\n if (trafficType?.startsWith(\"ON_DEMAND_\")) {\n return trafficType?.substring(\"ON_DEMAND_\".length).toLowerCase();\n }\n return serviceTierHeader || \"standard\";\n });\n\n return {\n generations: [\n {\n text,\n message,\n generationInfo: {\n finishReason: candidate.finishReason,\n finishMessage: candidate.finishMessage,\n safetyRatings: candidate.safetyRatings,\n citationMetadata: candidate.citationMetadata,\n tokenCount: candidate.tokenCount,\n },\n },\n ],\n llmOutput: {\n tokenUsage: usageMetadataToTokenUsage(usageMetadata),\n model: data.modelVersion,\n responseId: data.responseId,\n usageMetadata,\n serviceTier,\n },\n };\n }\n\n async *_streamChatModelEvents(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n _runManager?: CallbackManagerForLLMRun\n ): AsyncGenerator<ChatModelStreamEvent> {\n const body = {\n ...this.invocationParams(options),\n systemInstruction: convertMessagesToGeminiSystemInstruction(messages),\n contents: convertMessagesToGeminiContents(messages),\n };\n\n const url = await this.buildUrl(\"streamGenerateContent?alt=sse\");\n const headers = this.getHeaders(options);\n\n const response = await this.apiClient.fetch(\n new Request(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n signal: options.signal,\n })\n );\n\n if (!response.ok) {\n throw await RequestError.fromResponse(response);\n }\n\n if (!response.body) {\n return;\n }\n\n const eventStream = response.body\n .pipeThrough(new TextDecoderStream())\n .pipeThrough(new EventSourceParserStream())\n .pipeThrough(\n new SafeJsonEventParserStream<Gemini.GenerateContentResponse>()\n );\n\n const shouldStreamUsage =\n this.streamUsage !== false && options.streamUsage !== false;\n\n async function* geminiChunks(\n stream: ReadableStream<Gemini.GenerateContentResponse | null>,\n signal?: AbortSignal\n ) {\n const reader = stream.getReader();\n try {\n while (true) {\n if (signal?.aborted) {\n return;\n }\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n if (value !== null) {\n yield value;\n }\n }\n } finally {\n reader.releaseLock();\n }\n }\n\n yield* convertGoogleGeminiStream(\n geminiChunks(eventStream, options.signal),\n {\n streamUsage: shouldStreamUsage,\n }\n );\n }\n\n async *_streamResponseChunks(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager?: CallbackManagerForLLMRun\n ): AsyncGenerator<ChatGenerationChunk> {\n const streamUsage: boolean = this.streamUsage ?? true;\n\n const body = {\n ...this.invocationParams(options),\n systemInstruction: convertMessagesToGeminiSystemInstruction(messages),\n contents: convertMessagesToGeminiContents(messages),\n };\n\n const url = await this.buildUrl(\"streamGenerateContent?alt=sse\");\n const headers = this.getHeaders(options);\n const moduleName = this.constructor.name;\n await runManager?.handleCustomEvent(`google-request-${moduleName}`, {\n url,\n headers,\n body,\n });\n\n let response: Response;\n try {\n response = await this.caller.callWithOptions(\n { signal: options.signal, maxRetries: options.maxRetries },\n async () => {\n const nextResponse = await this.apiClient.fetch(\n new Request(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n signal: options.signal,\n })\n );\n\n if (!nextResponse.ok) {\n throw await RequestError.fromResponse(nextResponse);\n }\n\n return nextResponse;\n }\n );\n } catch (error) {\n await runManager?.handleCustomEvent(`google-response-${moduleName}`, {\n error,\n });\n throw error;\n }\n\n await runManager?.handleCustomEvent(`google-response-${moduleName}`, {\n url: response.url,\n headers: response.headers,\n status: response.status,\n statusText: response.statusText,\n });\n\n if (response.body) {\n let previousUsage: UsageMetadata | undefined;\n const stream = response.body\n .pipeThrough(new TextDecoderStream())\n .pipeThrough(new EventSourceParserStream())\n .pipeThrough(\n new SafeJsonEventParserStream<Gemini.GenerateContentResponse>()\n )\n .pipeThrough(\n new TransformStream<\n Gemini.GenerateContentResponse,\n ChatGenerationChunk\n >({\n transform(chunk, controller) {\n // oxlint-disable-next-line no-void\n void runManager?.handleCustomEvent(`google-chunk-${moduleName}`, {\n chunk,\n });\n if (chunk === null) {\n controller.enqueue(\n new ChatGenerationChunk({\n text: \"\",\n message: new AIMessageChunk({ content: \"\" }),\n generationInfo: { finishReason: \"stop\" },\n })\n );\n return;\n }\n\n // Extract text delta from the chunk\n const candidate = chunk.candidates?.[0];\n if (!candidate) {\n return;\n }\n\n const message = convertGeminiCandidateToAIMessage(candidate);\n const text = convertAIMessageToText(message);\n\n const parts = candidate.content?.parts ?? [];\n const toolCalls = convertGeminiPartsToToolCalls(parts);\n\n // Only emit if we have content\n if (parts.length > 0 || candidate.finishReason) {\n const messageChunkParams: AIMessageChunkFields = {\n content: message.content,\n tool_calls: toolCalls,\n response_metadata: {\n model_provider: \"google\",\n },\n additional_kwargs: {\n ...(message.additional_kwargs.originalTextContentBlock\n ? {\n originalTextContentBlock:\n message.additional_kwargs.originalTextContentBlock,\n }\n : {}),\n ...(candidate.finishReason\n ? {\n finishReason: candidate.finishReason,\n finishMessage: candidate.finishMessage,\n }\n : {}),\n },\n };\n\n if (chunk?.usageMetadata && streamUsage) {\n const cumulative =\n convertGeminiGenerateContentResponseToUsageMetadata(chunk);\n messageChunkParams.usage_metadata = subtractUsageMetadata(\n cumulative,\n previousUsage\n );\n previousUsage = cumulative;\n }\n const messageChunk = new AIMessageChunk(messageChunkParams);\n\n controller.enqueue(\n new ChatGenerationChunk({\n text: text,\n message: messageChunk,\n generationInfo: {\n ...(candidate.finishReason && {\n finishReason: candidate.finishReason,\n finishMessage: candidate.finishMessage,\n }),\n ...(candidate.safetyRatings && {\n safetyRatings: candidate.safetyRatings,\n }),\n },\n })\n );\n }\n },\n })\n );\n\n const reader = stream.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n yield value;\n await runManager?.handleLLMNewToken(\n value.text ?? \"\",\n undefined,\n undefined,\n undefined,\n undefined,\n { chunk: value }\n );\n }\n } finally {\n reader.releaseLock();\n }\n }\n }\n\n /**\n * Bind tool-like objects to this chat model.\n *\n * @param tools A list of tool definitions to bind to this chat model.\n * Can be a structured tool, an OpenAI formatted tool, or a Gemini function declaration.\n * @param kwargs Any additional parameters to bind.\n */\n bindTools(\n tools: BindToolsInput[],\n kwargs?: Partial<CallOptions>\n ): Runnable<BaseMessage[], AIMessageChunk, CallOptions> {\n return this.withConfig({\n ...kwargs,\n tools,\n } as Partial<CallOptions>);\n }\n\n withStructuredOutput<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<false>\n ): Runnable<BaseLanguageModelInput, RunOutput>;\n\n withStructuredOutput<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<true>\n ): Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }>;\n\n withStructuredOutput<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<boolean>\n ):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }>;\n\n /**\n * Get structured output from the model based on a schema.\n *\n * This method supports two modes:\n * - `jsonMode`: Uses `responseSchema` to get JSON responses directly (preferred for structured outputs)\n * - `functionCalling`: Uses function calling with tools (default, for compatibility)\n *\n * @param outputSchema - The schema to use for structured output (Zod schema or JSON Schema)\n * @param config - Configuration options including method and whether to include raw response\n * @returns A Runnable that returns the parsed structured output\n */\n withStructuredOutput<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<boolean>\n ):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n > {\n let llm: Runnable<BaseMessage[], AIMessageChunk, CallOptions>;\n let outputParser: Runnable<BaseMessage, RunOutput>;\n\n const { schema, name, includeRaw } = {\n ...config,\n schema: outputSchema,\n };\n let method = config?.method ?? \"functionCalling\";\n\n if (method === \"jsonMode\") {\n console.warn(\n `\"jsonMode\" is not supported for Google models. Falling back to \"jsonSchema\".`\n );\n method = \"jsonSchema\";\n }\n\n if (method === \"jsonSchema\") {\n // Use JSON mode with responseSchema\n llm = this.withConfig({\n responseSchema: schema,\n } as Partial<CallOptions>);\n\n outputParser = RunnableLambda.from<BaseMessage, RunOutput>(\n async (input: BaseMessage): Promise<RunOutput> => {\n if (\n !AIMessage.isInstance(input) &&\n !AIMessageChunk.isInstance(input)\n ) {\n throw new MalformedOutputError({\n message: \"Input is not an AIMessage or AIMessageChunk.\",\n });\n }\n\n if (!input.text) {\n throw new MalformedOutputError({\n message:\n \"No content found in response. Cannot parse structured output.\",\n });\n }\n\n // Parse JSON and validate with schema\n const parser = createContentParser(schema);\n return await parser.parse(input.text);\n }\n );\n } else if (method === \"functionCalling\") {\n // Use function calling mode\n let functionName = name ?? \"extract\";\n let geminiFunctionDeclaration: Gemini.Tools.FunctionDeclaration;\n\n if (isInteropZodSchema(schema) || isSerializableSchema(schema)) {\n const jsonSchema = schemaToGeminiParameters(schema);\n const description =\n typeof jsonSchema.description === \"string\"\n ? jsonSchema.description\n : \"A function available to call.\";\n geminiFunctionDeclaration = {\n name: functionName,\n description,\n parameters: jsonSchema as Gemini.Tools.Schema,\n };\n } else if (\n typeof schema.name === \"string\" &&\n typeof schema.parameters === \"object\" &&\n schema.parameters != null\n ) {\n geminiFunctionDeclaration = schema as Gemini.Tools.FunctionDeclaration;\n functionName = schema.name;\n } else {\n // We are providing the schema for *just* the parameters\n const parameters = schemaToGeminiParameters(schema);\n geminiFunctionDeclaration = {\n name: functionName,\n description: (schema as { description?: string }).description ?? \"\",\n parameters,\n };\n }\n\n const tools: Gemini.Tool[] = [\n {\n functionDeclarations: [geminiFunctionDeclaration],\n },\n ];\n llm = this.bindTools(tools).withConfig({\n tool_choice: functionName,\n } as Partial<CallOptions>);\n\n outputParser = createFunctionCallingParser(schema, functionName);\n } else {\n throw new ConfigurationError(\n `Unrecognized structured output method '${method}'. Expected 'functionCalling' or 'jsonSchema'`\n );\n }\n\n return assembleStructuredOutputPipeline(\n llm,\n outputParser,\n includeRaw,\n includeRaw\n ? \"ChatGoogleStructuredOutputRunnable\"\n : \"ChatGoogleStructuredOutput\"\n );\n }\n}\n\ntype CombinableFields = Omit<BaseChatGoogleParams, \"model\">;\n\nexport function combineGoogleChatModelFields(\n a: CombinableFields,\n b: CombinableFields,\n ...rest: CombinableFields[]\n): CombinableFields {\n const combined: CombinableFields = {\n temperature: b.temperature ?? a.temperature,\n topP: b.topP ?? a.topP,\n topK: b.topK ?? a.topK,\n maxOutputTokens: b.maxOutputTokens ?? a.maxOutputTokens,\n presencePenalty: b.presencePenalty ?? a.presencePenalty,\n frequencyPenalty: b.frequencyPenalty ?? a.frequencyPenalty,\n stopSequences: b.stopSequences ?? a.stopSequences,\n seed: b.seed ?? a.seed,\n responseLogprobs: b.responseLogprobs ?? a.responseLogprobs,\n logprobs: b.logprobs ?? a.logprobs,\n safetySettings: b.safetySettings ?? a.safetySettings,\n responseSchema: b.responseSchema ?? a.responseSchema,\n tools: b.tools ?? a.tools,\n responseModalities: b.responseModalities ?? a.responseModalities,\n enableEnhancedCivicAnswers:\n b.enableEnhancedCivicAnswers ?? a.enableEnhancedCivicAnswers,\n speechConfig: b.speechConfig ?? a.speechConfig,\n imageConfig: b.imageConfig ?? a.imageConfig,\n mediaResolution: b.mediaResolution ?? a.mediaResolution,\n detail: b.detail ?? a.detail,\n maxReasoningTokens: b.maxReasoningTokens ?? a.maxReasoningTokens,\n thinkingBudget: b.thinkingBudget ?? a.thinkingBudget,\n reasoningEffort: b.reasoningEffort ?? a.reasoningEffort,\n thinkingLevel: b.thinkingLevel ?? a.thinkingLevel,\n serviceTier: b.serviceTier ?? a.serviceTier,\n };\n if (rest.length > 0) {\n return combineGoogleChatModelFields(combined, rest[0], ...rest.slice(1));\n }\n return combined;\n}\n\nexport function getGoogleChatModelParams<TParams extends BaseChatGoogleParams>(\n modelOrParams: string | TParams,\n paramsArg?: Omit<TParams, \"model\">\n): TParams {\n const model =\n typeof modelOrParams === \"string\" ? modelOrParams : modelOrParams.model;\n const params = typeof modelOrParams === \"string\" ? paramsArg : modelOrParams;\n return { model, ...params } as TParams;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiFA,SAAgB,gBACd,UACA,WACoB;CACpB,IAAI,OAAO,aAAa,aACtB,OAAO;MACF,IAAI,WACT,OAAO;MAEP,OAAO;AAEX;AAEA,SAAS,0BAA0B,eAA8B;CAC/D,OAAO;EACL,cAAc,cAAc;EAC5B,kBAAkB,cAAc;EAChC,aAAa,cAAc;CAC7B;AACF;AAEA,SAAS,2BACP,QACwD;CACxD,QAAQ,QAAR;EACE,KAAK,OACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE;CACJ;AACF;AA6DA,IAAsB,iBAAtB,cAEU,cAA2C;CAqB7B;CApBtB;CAEA;CAEA;CAEA,cAAuB;CAEvB;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA,YAAY,QAAwC;EAClD,MAAM,MAAM;EADQ,KAAA,SAAA;EAEpB,KAAK,YAAY,qBAAA,OAAoC;EAErD,IAAI,CAAC,OAAO,WACV,MAAM,IAAI,mBACR,4LACF;EAEF,KAAK,YAAY,OAAO;EAExB,KAAK,QAAQ,OAAO;EACpB,KAAK,YAAY,4BAA4B,MAAM;EACnD,KAAK,YAAY,OAAO;EACxB,KAAK,iBAAiB,OAAO;EAC7B,KAAK,YAAY,OAAO;EACxB,KAAK,cAAc,OAAO;EAE1B,KAAK,mBAAmB,QAAQ,qBAAqB;EACrD,KAAK,YAAY,QAAQ,cAAc;EACvC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;EACpB,oBAAoB,EAAE,sBAAsB,EAAE;EAC9C,4BACE,EAAE,8BAA8B,EAAE;EACpC,cAAc,EAAE,gBAAgB,EAAE;EAClC,aAAa,EAAE,eAAe,EAAE;EAChC,iBAAiB,EAAE,mBAAmB,EAAE;EACxC,QAAQ,EAAE,UAAU,EAAE;EACtB,oBAAoB,EAAE,sBAAsB,EAAE;EAC9C,gBAAgB,EAAE,kBAAkB,EAAE;EACtC,iBAAiB,EAAE,mBAAmB,EAAE;EACxC,eAAe,EAAE,iBAAiB,EAAE;EACpC,aAAa,EAAE,eAAe,EAAE;CAClC;CACA,IAAI,KAAK,SAAS,GAChB,OAAO,6BAA6B,UAAU,KAAK,IAAI,GAAG,KAAK,MAAM,CAAC,CAAC;CAEzE,OAAO;AACT;AAEA,SAAgB,yBACd,eACA,WACS;CAIT,OAAO;EAAE,OAFP,OAAO,kBAAkB,WAAW,gBAAgB,cAAc;EAEpD,GADD,OAAO,kBAAkB,WAAW,YAAY;CACrC;AAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["BaseChatGoogle","getGoogleChatModelParams","WebApiClient"],"sources":["../../src/chat_models/index.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { WebApiClient } from \"../clients/index.js\";\nimport {\n BaseChatGoogle,\n BaseChatGoogleCallOptions,\n BaseChatGoogleParams,\n getGoogleChatModelParams,\n} from \"./base.js\";\n\n/**\n * Configuration parameters for the ChatGoogle model.\n *\n * This interface extends the base Google chat model parameters and adds\n * specific configuration options for the Generative AI API.\n */\nexport interface ChatGoogleParams extends BaseChatGoogleParams {\n /**\n * Google API key for authentication with the Generative AI API.\n *\n * If not provided, the model will attempt to use the `GOOGLE_API_KEY`\n * environment variable. You can obtain an API key from the\n * [Google AI Studio](https://makersuite.google.com/app/apikey).\n */\n apiKey?: string;\n\n /** @deprecated Import from `@langchain/google/node` to configure google auth options */\n authOptions?: never;\n}\n\n/**\n * Call options for the ChatGoogle model.\n *\n * This interface extends the base Google chat model call options and provides\n * configuration for individual model invocations. These options can be passed\n * when calling methods like `invoke()`, `stream()`, or `batch()` to customize\n * the behavior of a specific request.\n */\nexport interface ChatGoogleCallOptions extends BaseChatGoogleCallOptions {}\n\nexport class ChatGoogle extends BaseChatGoogle<ChatGoogleCallOptions> {\n apiKey?: string;\n\n constructor(model: string, params?: Omit<ChatGoogleParams, \"model\">);\n constructor(params: ChatGoogleParams);\n constructor(\n modelOrParams: string | ChatGoogleParams,\n paramsArg?: Omit<ChatGoogleParams, \"model\">\n ) {\n const params = getGoogleChatModelParams(modelOrParams, paramsArg);\n params.apiKey = params?.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n const apiClient = params?.apiClient ?? new WebApiClient(params);\n super({ ...params, apiClient });\n\n this.apiKey = params.apiKey;\n }\n}\n"],"mappings":";;;;AAuCA,IAAa,aAAb,cAAgCA,aAAAA,eAAsC;CACpE;CAIA,YACE,eACA,WACA;EACA,MAAM,SAASC,aAAAA,yBAAyB,eAAe,
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["BaseChatGoogle","getGoogleChatModelParams","WebApiClient"],"sources":["../../src/chat_models/index.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { WebApiClient } from \"../clients/index.js\";\nimport {\n BaseChatGoogle,\n BaseChatGoogleCallOptions,\n BaseChatGoogleParams,\n getGoogleChatModelParams,\n} from \"./base.js\";\n\n/**\n * Configuration parameters for the ChatGoogle model.\n *\n * This interface extends the base Google chat model parameters and adds\n * specific configuration options for the Generative AI API.\n */\nexport interface ChatGoogleParams extends BaseChatGoogleParams {\n /**\n * Google API key for authentication with the Generative AI API.\n *\n * If not provided, the model will attempt to use the `GOOGLE_API_KEY`\n * environment variable. You can obtain an API key from the\n * [Google AI Studio](https://makersuite.google.com/app/apikey).\n */\n apiKey?: string;\n\n /** @deprecated Import from `@langchain/google/node` to configure google auth options */\n authOptions?: never;\n}\n\n/**\n * Call options for the ChatGoogle model.\n *\n * This interface extends the base Google chat model call options and provides\n * configuration for individual model invocations. These options can be passed\n * when calling methods like `invoke()`, `stream()`, or `batch()` to customize\n * the behavior of a specific request.\n */\nexport interface ChatGoogleCallOptions extends BaseChatGoogleCallOptions {}\n\nexport class ChatGoogle extends BaseChatGoogle<ChatGoogleCallOptions> {\n apiKey?: string;\n\n constructor(model: string, params?: Omit<ChatGoogleParams, \"model\">);\n constructor(params: ChatGoogleParams);\n constructor(\n modelOrParams: string | ChatGoogleParams,\n paramsArg?: Omit<ChatGoogleParams, \"model\">\n ) {\n const params = getGoogleChatModelParams(modelOrParams, paramsArg);\n params.apiKey = params?.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n const apiClient = params?.apiClient ?? new WebApiClient(params);\n super({ ...params, apiClient });\n\n this.apiKey = params.apiKey;\n }\n}\n"],"mappings":";;;;AAuCA,IAAa,aAAb,cAAgCA,aAAAA,eAAsC;CACpE;CAIA,YACE,eACA,WACA;EACA,MAAM,SAASC,aAAAA,yBAAyB,eAAe,SAAS;EAChE,OAAO,SAAS,QAAQ,WAAA,GAAA,0BAAA,uBAAA,CAAiC,gBAAgB;EACzE,MAAM,YAAY,QAAQ,aAAa,IAAIC,cAAAA,aAAa,MAAM;EAC9D,MAAM;GAAE,GAAG;GAAQ;EAAU,CAAC;EAE9B,KAAK,SAAS,OAAO;CACvB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/chat_models/index.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { WebApiClient } from \"../clients/index.js\";\nimport {\n BaseChatGoogle,\n BaseChatGoogleCallOptions,\n BaseChatGoogleParams,\n getGoogleChatModelParams,\n} from \"./base.js\";\n\n/**\n * Configuration parameters for the ChatGoogle model.\n *\n * This interface extends the base Google chat model parameters and adds\n * specific configuration options for the Generative AI API.\n */\nexport interface ChatGoogleParams extends BaseChatGoogleParams {\n /**\n * Google API key for authentication with the Generative AI API.\n *\n * If not provided, the model will attempt to use the `GOOGLE_API_KEY`\n * environment variable. You can obtain an API key from the\n * [Google AI Studio](https://makersuite.google.com/app/apikey).\n */\n apiKey?: string;\n\n /** @deprecated Import from `@langchain/google/node` to configure google auth options */\n authOptions?: never;\n}\n\n/**\n * Call options for the ChatGoogle model.\n *\n * This interface extends the base Google chat model call options and provides\n * configuration for individual model invocations. These options can be passed\n * when calling methods like `invoke()`, `stream()`, or `batch()` to customize\n * the behavior of a specific request.\n */\nexport interface ChatGoogleCallOptions extends BaseChatGoogleCallOptions {}\n\nexport class ChatGoogle extends BaseChatGoogle<ChatGoogleCallOptions> {\n apiKey?: string;\n\n constructor(model: string, params?: Omit<ChatGoogleParams, \"model\">);\n constructor(params: ChatGoogleParams);\n constructor(\n modelOrParams: string | ChatGoogleParams,\n paramsArg?: Omit<ChatGoogleParams, \"model\">\n ) {\n const params = getGoogleChatModelParams(modelOrParams, paramsArg);\n params.apiKey = params?.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n const apiClient = params?.apiClient ?? new WebApiClient(params);\n super({ ...params, apiClient });\n\n this.apiKey = params.apiKey;\n }\n}\n"],"mappings":";;;;AAuCA,IAAa,aAAb,cAAgC,eAAsC;CACpE;CAIA,YACE,eACA,WACA;EACA,MAAM,SAAS,yBAAyB,eAAe,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/chat_models/index.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { WebApiClient } from \"../clients/index.js\";\nimport {\n BaseChatGoogle,\n BaseChatGoogleCallOptions,\n BaseChatGoogleParams,\n getGoogleChatModelParams,\n} from \"./base.js\";\n\n/**\n * Configuration parameters for the ChatGoogle model.\n *\n * This interface extends the base Google chat model parameters and adds\n * specific configuration options for the Generative AI API.\n */\nexport interface ChatGoogleParams extends BaseChatGoogleParams {\n /**\n * Google API key for authentication with the Generative AI API.\n *\n * If not provided, the model will attempt to use the `GOOGLE_API_KEY`\n * environment variable. You can obtain an API key from the\n * [Google AI Studio](https://makersuite.google.com/app/apikey).\n */\n apiKey?: string;\n\n /** @deprecated Import from `@langchain/google/node` to configure google auth options */\n authOptions?: never;\n}\n\n/**\n * Call options for the ChatGoogle model.\n *\n * This interface extends the base Google chat model call options and provides\n * configuration for individual model invocations. These options can be passed\n * when calling methods like `invoke()`, `stream()`, or `batch()` to customize\n * the behavior of a specific request.\n */\nexport interface ChatGoogleCallOptions extends BaseChatGoogleCallOptions {}\n\nexport class ChatGoogle extends BaseChatGoogle<ChatGoogleCallOptions> {\n apiKey?: string;\n\n constructor(model: string, params?: Omit<ChatGoogleParams, \"model\">);\n constructor(params: ChatGoogleParams);\n constructor(\n modelOrParams: string | ChatGoogleParams,\n paramsArg?: Omit<ChatGoogleParams, \"model\">\n ) {\n const params = getGoogleChatModelParams(modelOrParams, paramsArg);\n params.apiKey = params?.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n const apiClient = params?.apiClient ?? new WebApiClient(params);\n super({ ...params, apiClient });\n\n this.apiKey = params.apiKey;\n }\n}\n"],"mappings":";;;;AAuCA,IAAa,aAAb,cAAgC,eAAsC;CACpE;CAIA,YACE,eACA,WACA;EACA,MAAM,SAAS,yBAAyB,eAAe,SAAS;EAChE,OAAO,SAAS,QAAQ,UAAU,uBAAuB,gBAAgB;EACzE,MAAM,YAAY,QAAQ,aAAa,IAAI,aAAa,MAAM;EAC9D,MAAM;GAAE,GAAG;GAAQ;EAAU,CAAC;EAE9B,KAAK,SAAS,OAAO;CACvB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.cjs","names":["BaseChatGoogle","getGoogleChatModelParams","ensureAuthScopes","NodeApiClient","getPlatformType","convertParamsToPlatformType","GENERATIVE_AI_AUTH_SCOPES","VERTEX_AI_AUTH_SCOPES"],"sources":["../../src/chat_models/node.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { ChatGoogleParams } from \"./index.js\";\nimport {\n BaseChatGoogle,\n getGoogleChatModelParams,\n getPlatformType,\n} from \"./base.js\";\nimport { GENERATIVE_AI_AUTH_SCOPES, VERTEX_AI_AUTH_SCOPES } from \"../const.js\";\nimport {\n ensureAuthScopes,\n NodeApiClient,\n NodeApiClientParams,\n} from \"../clients/node.js\";\nimport { convertParamsToPlatformType } from \"../converters/params.js\";\n\ninterface ChatGoogleNodeParams extends NodeApiClientParams, ChatGoogleParams {}\n\nclass ChatGoogleNode extends BaseChatGoogle {\n constructor(model: string, params?: Omit<ChatGoogleNodeParams, \"model\">);\n constructor(params: ChatGoogleNodeParams);\n constructor(\n modelOrParams: string | ChatGoogleNodeParams,\n paramsArg?: Omit<ChatGoogleNodeParams, \"model\">\n ) {\n const params = getGoogleChatModelParams(modelOrParams, paramsArg);\n if (!params.googleAuthOptions) {\n params.apiKey = params.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n }\n const requiredScopes: string[] = getRequiredAuthScopes(params);\n if (params.googleAuthOptions) {\n params.googleAuthOptions = ensureAuthScopes(\n params.googleAuthOptions,\n requiredScopes\n );\n }\n const apiClient = params?.apiClient ?? new NodeApiClient(params);\n super({ ...params, apiClient });\n }\n}\n\nfunction getRequiredAuthScopes(params: ChatGoogleNodeParams): string[] {\n const hasApiKey = typeof params.apiKey !== \"undefined\";\n const platformType = convertParamsToPlatformType(params);\n const platform = getPlatformType(platformType, hasApiKey);\n switch (platform) {\n case \"gai\":\n return GENERATIVE_AI_AUTH_SCOPES;\n case \"gcp\":\n return VERTEX_AI_AUTH_SCOPES;\n default:\n return VERTEX_AI_AUTH_SCOPES;\n }\n}\n\nexport {\n type ChatGoogleNodeParams as ChatGoogleParams,\n ChatGoogleNode as ChatGoogle,\n};\n"],"mappings":";;;;;;AAiBA,IAAM,iBAAN,cAA6BA,aAAAA,eAAe;CAG1C,YACE,eACA,WACA;EACA,MAAM,SAASC,aAAAA,yBAAyB,eAAe,
|
|
1
|
+
{"version":3,"file":"node.cjs","names":["BaseChatGoogle","getGoogleChatModelParams","ensureAuthScopes","NodeApiClient","getPlatformType","convertParamsToPlatformType","GENERATIVE_AI_AUTH_SCOPES","VERTEX_AI_AUTH_SCOPES"],"sources":["../../src/chat_models/node.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { ChatGoogleParams } from \"./index.js\";\nimport {\n BaseChatGoogle,\n getGoogleChatModelParams,\n getPlatformType,\n} from \"./base.js\";\nimport { GENERATIVE_AI_AUTH_SCOPES, VERTEX_AI_AUTH_SCOPES } from \"../const.js\";\nimport {\n ensureAuthScopes,\n NodeApiClient,\n NodeApiClientParams,\n} from \"../clients/node.js\";\nimport { convertParamsToPlatformType } from \"../converters/params.js\";\n\ninterface ChatGoogleNodeParams extends NodeApiClientParams, ChatGoogleParams {}\n\nclass ChatGoogleNode extends BaseChatGoogle {\n constructor(model: string, params?: Omit<ChatGoogleNodeParams, \"model\">);\n constructor(params: ChatGoogleNodeParams);\n constructor(\n modelOrParams: string | ChatGoogleNodeParams,\n paramsArg?: Omit<ChatGoogleNodeParams, \"model\">\n ) {\n const params = getGoogleChatModelParams(modelOrParams, paramsArg);\n if (!params.googleAuthOptions) {\n params.apiKey = params.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n }\n const requiredScopes: string[] = getRequiredAuthScopes(params);\n if (params.googleAuthOptions) {\n params.googleAuthOptions = ensureAuthScopes(\n params.googleAuthOptions,\n requiredScopes\n );\n }\n const apiClient = params?.apiClient ?? new NodeApiClient(params);\n super({ ...params, apiClient });\n }\n}\n\nfunction getRequiredAuthScopes(params: ChatGoogleNodeParams): string[] {\n const hasApiKey = typeof params.apiKey !== \"undefined\";\n const platformType = convertParamsToPlatformType(params);\n const platform = getPlatformType(platformType, hasApiKey);\n switch (platform) {\n case \"gai\":\n return GENERATIVE_AI_AUTH_SCOPES;\n case \"gcp\":\n return VERTEX_AI_AUTH_SCOPES;\n default:\n return VERTEX_AI_AUTH_SCOPES;\n }\n}\n\nexport {\n type ChatGoogleNodeParams as ChatGoogleParams,\n ChatGoogleNode as ChatGoogle,\n};\n"],"mappings":";;;;;;AAiBA,IAAM,iBAAN,cAA6BA,aAAAA,eAAe;CAG1C,YACE,eACA,WACA;EACA,MAAM,SAASC,aAAAA,yBAAyB,eAAe,SAAS;EAChE,IAAI,CAAC,OAAO,mBACV,OAAO,SAAS,OAAO,WAAA,GAAA,0BAAA,uBAAA,CAAiC,gBAAgB;EAE1E,MAAM,iBAA2B,sBAAsB,MAAM;EAC7D,IAAI,OAAO,mBACT,OAAO,oBAAoBC,aAAAA,iBACzB,OAAO,mBACP,cACF;EAEF,MAAM,YAAY,QAAQ,aAAa,IAAIC,aAAAA,cAAc,MAAM;EAC/D,MAAM;GAAE,GAAG;GAAQ;EAAU,CAAC;CAChC;AACF;AAEA,SAAS,sBAAsB,QAAwC;CACrE,MAAM,YAAY,OAAO,OAAO,WAAW;CAG3C,QADiBC,aAAAA,gBADIC,eAAAA,4BAA4B,MACL,GAAG,SAChC,GAAf;EACE,KAAK,OACH,OAAOC,cAAAA;EACT,KAAK,OACH,OAAOC,cAAAA;EACT,SACE,OAAOA,cAAAA;CACX;AACF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseChatGoogle } from "./base.cjs";
|
|
2
2
|
import { ChatGoogleParams } from "./index.cjs";
|
|
3
3
|
import { NodeApiClientParams } from "../clients/node.cjs";
|
|
4
|
-
|
|
5
4
|
//#region src/chat_models/node.d.ts
|
|
6
5
|
interface ChatGoogleNodeParams extends NodeApiClientParams, ChatGoogleParams {}
|
|
7
6
|
declare class ChatGoogleNode extends BaseChatGoogle {
|
|
@@ -9,5 +8,5 @@ declare class ChatGoogleNode extends BaseChatGoogle {
|
|
|
9
8
|
constructor(params: ChatGoogleNodeParams);
|
|
10
9
|
}
|
|
11
10
|
//#endregion
|
|
12
|
-
export { ChatGoogleNode, ChatGoogleNodeParams };
|
|
11
|
+
export { ChatGoogleNode as ChatGoogle, type ChatGoogleNodeParams as ChatGoogleParams };
|
|
13
12
|
//# sourceMappingURL=node.d.cts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseChatGoogle } from "./base.js";
|
|
2
2
|
import { ChatGoogleParams } from "./index.js";
|
|
3
3
|
import { NodeApiClientParams } from "../clients/node.js";
|
|
4
|
-
|
|
5
4
|
//#region src/chat_models/node.d.ts
|
|
6
5
|
interface ChatGoogleNodeParams extends NodeApiClientParams, ChatGoogleParams {}
|
|
7
6
|
declare class ChatGoogleNode extends BaseChatGoogle {
|
|
@@ -9,5 +8,5 @@ declare class ChatGoogleNode extends BaseChatGoogle {
|
|
|
9
8
|
constructor(params: ChatGoogleNodeParams);
|
|
10
9
|
}
|
|
11
10
|
//#endregion
|
|
12
|
-
export { ChatGoogleNode, ChatGoogleNodeParams };
|
|
11
|
+
export { ChatGoogleNode as ChatGoogle, type ChatGoogleNodeParams as ChatGoogleParams };
|
|
13
12
|
//# sourceMappingURL=node.d.ts.map
|
package/dist/chat_models/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","names":[],"sources":["../../src/chat_models/node.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { ChatGoogleParams } from \"./index.js\";\nimport {\n BaseChatGoogle,\n getGoogleChatModelParams,\n getPlatformType,\n} from \"./base.js\";\nimport { GENERATIVE_AI_AUTH_SCOPES, VERTEX_AI_AUTH_SCOPES } from \"../const.js\";\nimport {\n ensureAuthScopes,\n NodeApiClient,\n NodeApiClientParams,\n} from \"../clients/node.js\";\nimport { convertParamsToPlatformType } from \"../converters/params.js\";\n\ninterface ChatGoogleNodeParams extends NodeApiClientParams, ChatGoogleParams {}\n\nclass ChatGoogleNode extends BaseChatGoogle {\n constructor(model: string, params?: Omit<ChatGoogleNodeParams, \"model\">);\n constructor(params: ChatGoogleNodeParams);\n constructor(\n modelOrParams: string | ChatGoogleNodeParams,\n paramsArg?: Omit<ChatGoogleNodeParams, \"model\">\n ) {\n const params = getGoogleChatModelParams(modelOrParams, paramsArg);\n if (!params.googleAuthOptions) {\n params.apiKey = params.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n }\n const requiredScopes: string[] = getRequiredAuthScopes(params);\n if (params.googleAuthOptions) {\n params.googleAuthOptions = ensureAuthScopes(\n params.googleAuthOptions,\n requiredScopes\n );\n }\n const apiClient = params?.apiClient ?? new NodeApiClient(params);\n super({ ...params, apiClient });\n }\n}\n\nfunction getRequiredAuthScopes(params: ChatGoogleNodeParams): string[] {\n const hasApiKey = typeof params.apiKey !== \"undefined\";\n const platformType = convertParamsToPlatformType(params);\n const platform = getPlatformType(platformType, hasApiKey);\n switch (platform) {\n case \"gai\":\n return GENERATIVE_AI_AUTH_SCOPES;\n case \"gcp\":\n return VERTEX_AI_AUTH_SCOPES;\n default:\n return VERTEX_AI_AUTH_SCOPES;\n }\n}\n\nexport {\n type ChatGoogleNodeParams as ChatGoogleParams,\n ChatGoogleNode as ChatGoogle,\n};\n"],"mappings":";;;;;;AAiBA,IAAM,iBAAN,cAA6B,eAAe;CAG1C,YACE,eACA,WACA;EACA,MAAM,SAAS,yBAAyB,eAAe,
|
|
1
|
+
{"version":3,"file":"node.js","names":[],"sources":["../../src/chat_models/node.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { ChatGoogleParams } from \"./index.js\";\nimport {\n BaseChatGoogle,\n getGoogleChatModelParams,\n getPlatformType,\n} from \"./base.js\";\nimport { GENERATIVE_AI_AUTH_SCOPES, VERTEX_AI_AUTH_SCOPES } from \"../const.js\";\nimport {\n ensureAuthScopes,\n NodeApiClient,\n NodeApiClientParams,\n} from \"../clients/node.js\";\nimport { convertParamsToPlatformType } from \"../converters/params.js\";\n\ninterface ChatGoogleNodeParams extends NodeApiClientParams, ChatGoogleParams {}\n\nclass ChatGoogleNode extends BaseChatGoogle {\n constructor(model: string, params?: Omit<ChatGoogleNodeParams, \"model\">);\n constructor(params: ChatGoogleNodeParams);\n constructor(\n modelOrParams: string | ChatGoogleNodeParams,\n paramsArg?: Omit<ChatGoogleNodeParams, \"model\">\n ) {\n const params = getGoogleChatModelParams(modelOrParams, paramsArg);\n if (!params.googleAuthOptions) {\n params.apiKey = params.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n }\n const requiredScopes: string[] = getRequiredAuthScopes(params);\n if (params.googleAuthOptions) {\n params.googleAuthOptions = ensureAuthScopes(\n params.googleAuthOptions,\n requiredScopes\n );\n }\n const apiClient = params?.apiClient ?? new NodeApiClient(params);\n super({ ...params, apiClient });\n }\n}\n\nfunction getRequiredAuthScopes(params: ChatGoogleNodeParams): string[] {\n const hasApiKey = typeof params.apiKey !== \"undefined\";\n const platformType = convertParamsToPlatformType(params);\n const platform = getPlatformType(platformType, hasApiKey);\n switch (platform) {\n case \"gai\":\n return GENERATIVE_AI_AUTH_SCOPES;\n case \"gcp\":\n return VERTEX_AI_AUTH_SCOPES;\n default:\n return VERTEX_AI_AUTH_SCOPES;\n }\n}\n\nexport {\n type ChatGoogleNodeParams as ChatGoogleParams,\n ChatGoogleNode as ChatGoogle,\n};\n"],"mappings":";;;;;;AAiBA,IAAM,iBAAN,cAA6B,eAAe;CAG1C,YACE,eACA,WACA;EACA,MAAM,SAAS,yBAAyB,eAAe,SAAS;EAChE,IAAI,CAAC,OAAO,mBACV,OAAO,SAAS,OAAO,UAAU,uBAAuB,gBAAgB;EAE1E,MAAM,iBAA2B,sBAAsB,MAAM;EAC7D,IAAI,OAAO,mBACT,OAAO,oBAAoB,iBACzB,OAAO,mBACP,cACF;EAEF,MAAM,YAAY,QAAQ,aAAa,IAAI,cAAc,MAAM;EAC/D,MAAM;GAAE,GAAG;GAAQ;EAAU,CAAC;CAChC;AACF;AAEA,SAAS,sBAAsB,QAAwC;CACrE,MAAM,YAAY,OAAO,OAAO,WAAW;CAG3C,QADiB,gBADI,4BAA4B,MACL,GAAG,SAChC,GAAf;EACE,KAAK,OACH,OAAO;EACT,KAAK,OACH,OAAO;EACT,SACE,OAAO;CACX;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.cjs","names":[],"sources":["../../src/chat_models/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"gemini-embedding-001\": {\n maxInputTokens: 2048,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 3072,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-lite-preview-09-2025\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro-preview-06-05\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-04-17\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-preview-09-2025\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro-preview-05-06\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-05-20\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-live-2.5-flash\": {\n maxInputTokens: 128000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-3-flash-preview\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-live-2.5-flash-preview-native-audio\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-lite\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-tts\": {\n maxInputTokens: 8000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 16000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-flash-latest\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-lite-preview-06-17\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-image\": {\n maxInputTokens: 32768,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 32768,\n reasoningOutput: true,\n imageOutputs: true,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-pro-preview-tts\": {\n maxInputTokens: 8000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 16000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-image-preview\": {\n maxInputTokens: 32768,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 32768,\n reasoningOutput: true,\n imageOutputs: true,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-1.5-flash-8b\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-3-pro-preview\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.0-flash-lite\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-1.5-flash\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-flash-lite-latest\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.0-flash\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-1.5-pro\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAM,WAAyC;CAC7C,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,yCAAyC;EACvC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oCAAoC;EAClC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,0BAA0B;EACxB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,8CAA8C;EAC5C,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,uBAAuB;EACrB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,uCAAuC;EACrC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,0BAA0B;EACxB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,8BAA8B;EAC5B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,uBAAuB;EACrB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,4BAA4B;EAC1B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kBAAkB;EAChB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kBAAkB;EAChB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACF"}
|
|
1
|
+
{"version":3,"file":"profiles.cjs","names":[],"sources":["../../src/chat_models/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"gemini-embedding-001\": {\n maxInputTokens: 2048,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 3072,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-lite-preview-09-2025\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro-preview-06-05\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-04-17\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-preview-09-2025\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro-preview-05-06\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-05-20\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-live-2.5-flash\": {\n maxInputTokens: 128000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-3-flash-preview\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-live-2.5-flash-preview-native-audio\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-lite\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-tts\": {\n maxInputTokens: 8000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 16000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-flash-latest\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-lite-preview-06-17\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-image\": {\n maxInputTokens: 32768,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 32768,\n reasoningOutput: true,\n imageOutputs: true,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-pro-preview-tts\": {\n maxInputTokens: 8000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 16000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-image-preview\": {\n maxInputTokens: 32768,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 32768,\n reasoningOutput: true,\n imageOutputs: true,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-1.5-flash-8b\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-3-pro-preview\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.0-flash-lite\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-1.5-flash\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-flash-lite-latest\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.0-flash\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-1.5-pro\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAM,WAAyC;CAC7C,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,yCAAyC;EACvC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,oCAAoC;EAClC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,0BAA0B;EACxB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,8CAA8C;EAC5C,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,uBAAuB;EACrB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,uCAAuC;EACrC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,0BAA0B;EACxB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,8BAA8B;EAC5B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,uBAAuB;EACrB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,4BAA4B;EAC1B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kBAAkB;EAChB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kBAAkB;EAChB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.js","names":[],"sources":["../../src/chat_models/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"gemini-embedding-001\": {\n maxInputTokens: 2048,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 3072,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-lite-preview-09-2025\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro-preview-06-05\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-04-17\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-preview-09-2025\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro-preview-05-06\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-05-20\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-live-2.5-flash\": {\n maxInputTokens: 128000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-3-flash-preview\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-live-2.5-flash-preview-native-audio\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-lite\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-tts\": {\n maxInputTokens: 8000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 16000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-flash-latest\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-lite-preview-06-17\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-image\": {\n maxInputTokens: 32768,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 32768,\n reasoningOutput: true,\n imageOutputs: true,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-pro-preview-tts\": {\n maxInputTokens: 8000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 16000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-image-preview\": {\n maxInputTokens: 32768,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 32768,\n reasoningOutput: true,\n imageOutputs: true,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-1.5-flash-8b\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-3-pro-preview\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.0-flash-lite\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-1.5-flash\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-flash-lite-latest\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.0-flash\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-1.5-pro\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAM,WAAyC;CAC7C,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,yCAAyC;EACvC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oCAAoC;EAClC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,0BAA0B;EACxB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,8CAA8C;EAC5C,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,uBAAuB;EACrB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,uCAAuC;EACrC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,0BAA0B;EACxB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,8BAA8B;EAC5B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,uBAAuB;EACrB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,4BAA4B;EAC1B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kBAAkB;EAChB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,kBAAkB;EAChB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACF"}
|
|
1
|
+
{"version":3,"file":"profiles.js","names":[],"sources":["../../src/chat_models/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"gemini-embedding-001\": {\n maxInputTokens: 2048,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 3072,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-lite-preview-09-2025\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro-preview-06-05\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-04-17\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-preview-09-2025\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro-preview-05-06\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-05-20\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-live-2.5-flash\": {\n maxInputTokens: 128000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-3-flash-preview\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-live-2.5-flash-preview-native-audio\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-lite\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-preview-tts\": {\n maxInputTokens: 8000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 16000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-flash-latest\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-flash-lite-preview-06-17\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-image\": {\n maxInputTokens: 32768,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 32768,\n reasoningOutput: true,\n imageOutputs: true,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-pro-preview-tts\": {\n maxInputTokens: 8000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 16000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: true,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-2.5-flash-image-preview\": {\n maxInputTokens: 32768,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 32768,\n reasoningOutput: true,\n imageOutputs: true,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: false,\n structuredOutput: false,\n },\n \"gemini-1.5-flash-8b\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-3-pro-preview\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.0-flash-lite\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-1.5-flash\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"gemini-flash-lite-latest\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.5-pro\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 65536,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-2.0-flash\": {\n maxInputTokens: 1048576,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: true,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: true,\n },\n \"gemini-1.5-pro\": {\n maxInputTokens: 1000000,\n imageInputs: true,\n audioInputs: true,\n pdfInputs: false,\n videoInputs: true,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAM,WAAyC;CAC7C,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,yCAAyC;EACvC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,oCAAoC;EAClC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,0BAA0B;EACxB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,8CAA8C;EAC5C,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,gCAAgC;EAC9B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,uBAAuB;EACrB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,uCAAuC;EACrC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,0BAA0B;EACxB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,8BAA8B;EAC5B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kCAAkC;EAChC,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,uBAAuB;EACrB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,yBAAyB;EACvB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,4BAA4B;EAC1B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kBAAkB;EAChB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;CACA,kBAAkB;EAChB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACpB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","names":[],"sources":["../../src/chat_models/types.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-namespace */\n\nimport type { InteropZodType } from \"@langchain/core/utils/types\";\nimport type { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nimport type { Gemini as GeminiBase } from \"./api-types.js\";\nimport type { LowercaseLiteral, Prettify } from \"../utils/misc.js\";\n\nexport interface ChatGoogleFields {\n /**\n * The temperature is used for sampling during response generation, which\n * occurs when topP and topK are applied. Temperature controls the degree of\n * randomness in token selection. Lower temperatures are good for prompts that\n * require a less open-ended or creative response, while higher temperatures\n * can lead to more diverse or creative results.\n *\n * Specify a lower value for less random responses and a higher value for more\n * random responses.\n */\n temperature?: number;\n\n /**\n * Top-P changes how the model selects tokens for output. Tokens are selected\n * from the most probable to least probable until the sum of their\n * probabilities equals the top-P value.\n *\n * Specify a lower value for less random responses and a higher value for more\n * random responses.\n */\n topP?: number;\n\n /**\n * Top-K changes how the model selects tokens for output. A top-K of 1 means\n * the selected token is the most probable among all tokens in the model's\n * vocabulary (also called greedy decoding), while a top-K of 3 means that the\n * next token is selected from among the 3 most probable tokens (using\n * temperature).\n */\n topK?: number;\n\n /**\n * Maximum number of tokens that can be generated in the response. A token is\n * approximately four characters. 100 tokens correspond to roughly 60-80 words.\n * Specify a lower value for shorter responses and a higher value for\n * potentially longer responses.\n */\n maxOutputTokens?: number;\n\n /**\n * Positive values penalize tokens that already appear in the generated text,\n * increasing the probability of generating more diverse content.\n */\n presencePenalty?: number;\n\n /**\n * Positive values penalize tokens that repeatedly appear in the generated\n * text, decreasing the probability of repeating content.\n */\n frequencyPenalty?: number;\n\n /**\n * Specifies a list of strings that tells the model to stop generating text if\n * one of the strings is encountered in the response. If a string appears\n * multiple times in the response, then the response truncates where it's\n * first encountered. The strings are case-sensitive.\n */\n stopSequences?: string[];\n\n /**\n * When seed is fixed to a specific value, the model makes a best effort to\n * provide the same response for repeated requests. Deterministic output isn't\n * guaranteed. Also, changing the model or parameter settings, such as the\n * temperature, can cause variations in the response even when you use the\n * same seed value. By default, a random seed value is used.\n */\n seed?: number;\n\n /**\n * If true, returns the log probabilities of the tokens that were chosen by\n * the model at each step. By default, this parameter is set to false.\n */\n responseLogprobs?: boolean;\n\n /**\n * Returns the log probabilities of the top candidate tokens at each generation\n * step. The model's chosen token might not be the same as the top candidate\n * token at each step. Specify the number of candidates to return by using an\n * integer value in the range of 1-20.\n */\n logprobs?: number;\n\n /**\n * Per request settings for blocking unsafe content\n */\n safetySettings?: Prettify<GeminiBase.SafetySetting>[];\n\n /**\n * Configuration for the model's thinking process\n */\n thinkingConfig?: Prettify<GeminiBase.ThinkingConfig>;\n\n /**\n * The schema that the generated response should match.\n * Can be a Zod schema or a JSON Schema object.\n * When set, the response will be structured according to this schema\n * and `responseMimeType` will automatically be set to \"application/json\".\n */\n responseSchema?: InteropZodType | Record<string, unknown>;\n\n /**\n * A list of tools the model may use to generate the next response.\n * Can be LangChain tools, OpenAI tools, or Gemini function declarations.\n */\n tools?: BindToolsInput[];\n\n /**\n * The requested modalities of the response.\n * Represents the set of modalities that the model can return.\n * An empty list is equivalent to requesting only text.\n */\n responseModalities?: Prettify<GeminiBase.GenerativeLanguageModality>[];\n\n /**\n * If true, enables enhanced civic answers feature.\n */\n enableEnhancedCivicAnswers?: boolean;\n\n /**\n * Speech generation configuration.\n * You can use either Google's definition of the speech configuration,\n * or a simplified version we've defined (which can be as simple\n * as the name of a pre-defined voice).\n */\n speechConfig?: Prettify<GeminiBase.SpeechConfig> | SimplifiedSpeechConfig;\n\n /**\n * Configuration for image generation.\n */\n imageConfig?: Prettify<GeminiBase.ImageConfig>;\n\n /**\n * Media resolution for input media processing.\n *\n * This maps to `generationConfig.mediaResolution`, which is a scalar enum-like\n * string value in the Gemini API.\n */\n mediaResolution?: GeminiBase.GenerationConfig[\"mediaResolution\"];\n\n /**\n * OpenAI-compatible alias for media input detail level.\n *\n * This is mapped to `generationConfig.mediaResolution`:\n * - `\"auto\"` => default Gemini behavior (`mediaResolution` omitted)\n * - `\"low\"` => `\"MEDIA_RESOLUTION_LOW\"`\n * - `\"high\"` => `\"MEDIA_RESOLUTION_HIGH\"`\n *\n * If both `mediaResolution` and `detail` are provided, `mediaResolution` wins.\n */\n detail?: \"auto\" | \"low\" | \"high\";\n\n /**\n * The number of reasoning tokens that the model should generate.\n * If explicitly set, then the reasoning blocks will be returned.\n */\n maxReasoningTokens?: number;\n\n /**\n * An alias for `maxReasoningTokens` for compatibility.\n */\n thinkingBudget?: number;\n\n /**\n * An alias for `maxReasoningTokens` under Gemini 2.5 or\n * the primary thinking/reasoning setting for Gemini 3.\n * If explicitly set, then the reasoning blocks will be returned.\n */\n reasoningEffort?: GeminiBase.ThinkingLevel;\n\n /**\n * An alias for `reasoningEffort` for compatibility.\n */\n thinkingLevel?: GeminiBase.ThinkingLevel;\n\n /**\n * Inference service tiers.\n * \"priority\" offers highest reliability for higher rates.\n * \"flex\" offers a discount for preemptable processing.\n * Other values are treated as the standard service tier.\n */\n serviceTier?: GeminiBase.ServiceTier;\n\n /**\n * Custom / additional headers to include with every request to the API.\n * When set on both constructor params and per-invocation call options,\n * per-invocation headers take precidence for matching keys.\n */\n customHeaders?: Record<string, string>;\n}\n\nexport type GooglePlatformType = \"gai\" | \"gcp\";\n\n// These are service tiers that we specifically need to send.\n// Other values will be ignored, resulting in the default\n// or \"standard\" setting.\nexport const settableServiceTier: GeminiBase.ServiceTier[] = [\n \"flex\",\n \"priority\",\n];\n\nexport { type Gemini } from \"./api-types.js\";\n\n// There's a fair number of utilities that we need to extract from the base\n// Gemini OpenAPI types, Adding these directly to the base types\n// would pollute the typegen output, so we're adding them here instead.\ndeclare module \"./api-types.js\" {\n export namespace Gemini {\n // Gemini parts are contained as one intersecting type\n // in the spec, so we need to pick out the specific parts we need.\n export namespace Part {\n export type CodeExecutionResult = Pick<\n GeminiBase.Part,\n \"codeExecutionResult\"\n >;\n export type ExecutableCode = Pick<GeminiBase.Part, \"executableCode\">;\n export type FileData = Pick<\n GeminiBase.Part,\n \"fileData\" | \"videoMetadata\"\n >;\n export type FunctionCall = Required<\n Pick<GeminiBase.Part, \"functionCall\">\n > &\n Pick<GeminiBase.Part, \"thoughtSignature\">;\n export type FunctionResponse = Pick<GeminiBase.Part, \"functionResponse\">;\n export type InlineData = Pick<\n GeminiBase.Part,\n \"inlineData\" | \"videoMetadata\"\n >;\n export type MediaResolution = Pick<GeminiBase.Part, \"mediaResolution\">;\n export type PartMetadata = Pick<GeminiBase.Part, \"partMetadata\">;\n export type Text = Pick<GeminiBase.Part, \"text\">;\n export type Thought = Pick<GeminiBase.Part, \"thought\">;\n export type ThoughtSignature = Pick<GeminiBase.Part, \"thoughtSignature\">;\n }\n\n export namespace PrebuiltVoiceConfig {\n /**\n * The name of a prebuilt voice that can be used for speech synthesis.\n *\n * Extracted as a non-nullable type from the GeminiBase.PrebuiltVoiceConfig[\"voiceName\"] property.\n */\n export type VoiceName = NonNullable<\n GeminiBase.PrebuiltVoiceConfig[\"voiceName\"]\n >;\n }\n\n export namespace SpeakerVoiceConfig {\n /**\n * The speaker identifier for a custom or multi-speaker TTS configuration.\n *\n * Extracted as a non-nullable type from the GeminiBase.SpeakerVoiceConfig[\"speaker\"] property.\n */\n export type Speaker = NonNullable<\n GeminiBase.SpeakerVoiceConfig[\"speaker\"]\n >;\n }\n\n export namespace SpeechConfig {\n /**\n * The BCP-47 language code for speech synthesis (e.g., \"en-US\").\n *\n * Extracted as a non-nullable type from the GeminiBase.SpeechConfig[\"languageCode\"] property.\n */\n export type LanguageCode = NonNullable<\n GeminiBase.SpeechConfig[\"languageCode\"]\n >;\n }\n\n /**\n * The level of \"thinking\" or reasoning configured for the model.\n *\n * Extends GeminiBase.ThinkingConfig[\"thinkingLevel\"] to also accept\n * lowercase variants (e.g. \"high\" in addition to \"HIGH\").\n */\n export type ThinkingLevel =\n | GeminiBase.ThinkingConfig[\"thinkingLevel\"]\n | LowercaseLiteral<GeminiBase.ThinkingConfig[\"thinkingLevel\"]>;\n\n /**\n * The role of a content message. The spec types this as `string`, but\n * the API only accepts these specific values.\n */\n export type Role = \"user\" | \"model\" | \"function\";\n\n /**\n * Alias for the unwieldy generated grounding support type name.\n */\n export type GroundingSupport =\n GeminiBase.GoogleAiGenerativelanguageV1betaGroundingSupport;\n\n /**\n * Alias for the unwieldy generated segment type name.\n */\n export type Segment = GeminiBase.GoogleAiGenerativelanguageV1betaSegment;\n\n export namespace Tools {\n /**\n * The mode for function calling configuration, extracted from the\n * FunctionCallingConfig interface.\n */\n export type FunctionCallingConfigMode =\n GeminiBase.Tools.FunctionCallingConfig[\"mode\"];\n }\n\n /**\n * Legacy URL retrieval metadata (predecessor of UrlContextMetadata).\n * Not in the current OpenAPI spec but still returned by the API.\n */\n export interface UrlRetrievalMetadata {\n urlRetrievalContexts?: Array<GeminiBase.UrlMetadata>;\n }\n\n // Augment Candidate with legacy field the API still returns.\n export interface Candidate {\n /** @deprecated Use urlContextMetadata instead. */\n readonly urlRetrievalMetadata?: UrlRetrievalMetadata;\n }\n }\n}\n\n/**\n * Simplified speaker/name pair for multi-speaker config.\n * - `speaker` derived from SpeakerVoiceConfig[\"speaker\"]\n * - `name` is the prebuilt voice name\n */\nexport interface SpeechSpeakerName {\n speaker: GeminiBase.SpeakerVoiceConfig.Speaker;\n name: GeminiBase.PrebuiltVoiceConfig.VoiceName;\n}\n\n/** A voice can be a prebuilt voice name, a speaker/name pair, or an array of pairs */\nexport type SpeechVoice =\n | GeminiBase.PrebuiltVoiceConfig.VoiceName\n | SpeechSpeakerName\n | SpeechSpeakerName[];\n\n/** Voice with language code (derived from SpeechConfig's languageCode) */\nexport interface SpeechVoiceLanguage {\n voice: SpeechVoice;\n languageCode: GeminiBase.SpeechConfig.LanguageCode;\n}\n\n/** Voices with language code */\nexport interface SpeechVoicesLanguage {\n voices: SpeechVoice;\n languageCode: GeminiBase.SpeechConfig.LanguageCode;\n}\n\n/** Simplified language config (with voice or voices) */\nexport type SimplifiedSpeechLanguageConfig =\n | SpeechVoiceLanguage\n | SpeechVoicesLanguage;\n\n/** Top-level simplified config: just a voice, or voice+language */\nexport type SimplifiedSpeechConfig =\n | SpeechVoice\n | SimplifiedSpeechLanguageConfig;\n"],"mappings":";AA2MA,MAAa,sBAAgD,CAC3D,QACA,WACD"}
|
|
1
|
+
{"version":3,"file":"types.cjs","names":[],"sources":["../../src/chat_models/types.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-namespace */\n\nimport type { InteropZodType } from \"@langchain/core/utils/types\";\nimport type { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nimport type { Gemini as GeminiBase } from \"./api-types.js\";\nimport type { LowercaseLiteral, Prettify } from \"../utils/misc.js\";\n\nexport interface ChatGoogleFields {\n /**\n * The temperature is used for sampling during response generation, which\n * occurs when topP and topK are applied. Temperature controls the degree of\n * randomness in token selection. Lower temperatures are good for prompts that\n * require a less open-ended or creative response, while higher temperatures\n * can lead to more diverse or creative results.\n *\n * Specify a lower value for less random responses and a higher value for more\n * random responses.\n */\n temperature?: number;\n\n /**\n * Top-P changes how the model selects tokens for output. Tokens are selected\n * from the most probable to least probable until the sum of their\n * probabilities equals the top-P value.\n *\n * Specify a lower value for less random responses and a higher value for more\n * random responses.\n */\n topP?: number;\n\n /**\n * Top-K changes how the model selects tokens for output. A top-K of 1 means\n * the selected token is the most probable among all tokens in the model's\n * vocabulary (also called greedy decoding), while a top-K of 3 means that the\n * next token is selected from among the 3 most probable tokens (using\n * temperature).\n */\n topK?: number;\n\n /**\n * Maximum number of tokens that can be generated in the response. A token is\n * approximately four characters. 100 tokens correspond to roughly 60-80 words.\n * Specify a lower value for shorter responses and a higher value for\n * potentially longer responses.\n */\n maxOutputTokens?: number;\n\n /**\n * Positive values penalize tokens that already appear in the generated text,\n * increasing the probability of generating more diverse content.\n */\n presencePenalty?: number;\n\n /**\n * Positive values penalize tokens that repeatedly appear in the generated\n * text, decreasing the probability of repeating content.\n */\n frequencyPenalty?: number;\n\n /**\n * Specifies a list of strings that tells the model to stop generating text if\n * one of the strings is encountered in the response. If a string appears\n * multiple times in the response, then the response truncates where it's\n * first encountered. The strings are case-sensitive.\n */\n stopSequences?: string[];\n\n /**\n * When seed is fixed to a specific value, the model makes a best effort to\n * provide the same response for repeated requests. Deterministic output isn't\n * guaranteed. Also, changing the model or parameter settings, such as the\n * temperature, can cause variations in the response even when you use the\n * same seed value. By default, a random seed value is used.\n */\n seed?: number;\n\n /**\n * If true, returns the log probabilities of the tokens that were chosen by\n * the model at each step. By default, this parameter is set to false.\n */\n responseLogprobs?: boolean;\n\n /**\n * Returns the log probabilities of the top candidate tokens at each generation\n * step. The model's chosen token might not be the same as the top candidate\n * token at each step. Specify the number of candidates to return by using an\n * integer value in the range of 1-20.\n */\n logprobs?: number;\n\n /**\n * Per request settings for blocking unsafe content\n */\n safetySettings?: Prettify<GeminiBase.SafetySetting>[];\n\n /**\n * Configuration for the model's thinking process\n */\n thinkingConfig?: Prettify<GeminiBase.ThinkingConfig>;\n\n /**\n * The schema that the generated response should match.\n * Can be a Zod schema or a JSON Schema object.\n * When set, the response will be structured according to this schema\n * and `responseMimeType` will automatically be set to \"application/json\".\n */\n responseSchema?: InteropZodType | Record<string, unknown>;\n\n /**\n * A list of tools the model may use to generate the next response.\n * Can be LangChain tools, OpenAI tools, or Gemini function declarations.\n */\n tools?: BindToolsInput[];\n\n /**\n * The requested modalities of the response.\n * Represents the set of modalities that the model can return.\n * An empty list is equivalent to requesting only text.\n */\n responseModalities?: Prettify<GeminiBase.GenerativeLanguageModality>[];\n\n /**\n * If true, enables enhanced civic answers feature.\n */\n enableEnhancedCivicAnswers?: boolean;\n\n /**\n * Speech generation configuration.\n * You can use either Google's definition of the speech configuration,\n * or a simplified version we've defined (which can be as simple\n * as the name of a pre-defined voice).\n */\n speechConfig?: Prettify<GeminiBase.SpeechConfig> | SimplifiedSpeechConfig;\n\n /**\n * Configuration for image generation.\n */\n imageConfig?: Prettify<GeminiBase.ImageConfig>;\n\n /**\n * Media resolution for input media processing.\n *\n * This maps to `generationConfig.mediaResolution`, which is a scalar enum-like\n * string value in the Gemini API.\n */\n mediaResolution?: GeminiBase.GenerationConfig[\"mediaResolution\"];\n\n /**\n * OpenAI-compatible alias for media input detail level.\n *\n * This is mapped to `generationConfig.mediaResolution`:\n * - `\"auto\"` => default Gemini behavior (`mediaResolution` omitted)\n * - `\"low\"` => `\"MEDIA_RESOLUTION_LOW\"`\n * - `\"high\"` => `\"MEDIA_RESOLUTION_HIGH\"`\n *\n * If both `mediaResolution` and `detail` are provided, `mediaResolution` wins.\n */\n detail?: \"auto\" | \"low\" | \"high\";\n\n /**\n * The number of reasoning tokens that the model should generate.\n * If explicitly set, then the reasoning blocks will be returned.\n */\n maxReasoningTokens?: number;\n\n /**\n * An alias for `maxReasoningTokens` for compatibility.\n */\n thinkingBudget?: number;\n\n /**\n * An alias for `maxReasoningTokens` under Gemini 2.5 or\n * the primary thinking/reasoning setting for Gemini 3.\n * If explicitly set, then the reasoning blocks will be returned.\n */\n reasoningEffort?: GeminiBase.ThinkingLevel;\n\n /**\n * An alias for `reasoningEffort` for compatibility.\n */\n thinkingLevel?: GeminiBase.ThinkingLevel;\n\n /**\n * Inference service tiers.\n * \"priority\" offers highest reliability for higher rates.\n * \"flex\" offers a discount for preemptable processing.\n * Other values are treated as the standard service tier.\n */\n serviceTier?: GeminiBase.ServiceTier;\n\n /**\n * Custom / additional headers to include with every request to the API.\n * When set on both constructor params and per-invocation call options,\n * per-invocation headers take precidence for matching keys.\n */\n customHeaders?: Record<string, string>;\n}\n\nexport type GooglePlatformType = \"gai\" | \"gcp\";\n\n// These are service tiers that we specifically need to send.\n// Other values will be ignored, resulting in the default\n// or \"standard\" setting.\nexport const settableServiceTier: GeminiBase.ServiceTier[] = [\n \"flex\",\n \"priority\",\n];\n\nexport { type Gemini } from \"./api-types.js\";\n\n// There's a fair number of utilities that we need to extract from the base\n// Gemini OpenAPI types, Adding these directly to the base types\n// would pollute the typegen output, so we're adding them here instead.\ndeclare module \"./api-types.js\" {\n export namespace Gemini {\n // Gemini parts are contained as one intersecting type\n // in the spec, so we need to pick out the specific parts we need.\n export namespace Part {\n export type CodeExecutionResult = Pick<\n GeminiBase.Part,\n \"codeExecutionResult\"\n >;\n export type ExecutableCode = Pick<GeminiBase.Part, \"executableCode\">;\n export type FileData = Pick<\n GeminiBase.Part,\n \"fileData\" | \"videoMetadata\"\n >;\n export type FunctionCall = Required<\n Pick<GeminiBase.Part, \"functionCall\">\n > &\n Pick<GeminiBase.Part, \"thoughtSignature\">;\n export type FunctionResponse = Pick<GeminiBase.Part, \"functionResponse\">;\n export type InlineData = Pick<\n GeminiBase.Part,\n \"inlineData\" | \"videoMetadata\"\n >;\n export type MediaResolution = Pick<GeminiBase.Part, \"mediaResolution\">;\n export type PartMetadata = Pick<GeminiBase.Part, \"partMetadata\">;\n export type Text = Pick<GeminiBase.Part, \"text\">;\n export type Thought = Pick<GeminiBase.Part, \"thought\">;\n export type ThoughtSignature = Pick<GeminiBase.Part, \"thoughtSignature\">;\n }\n\n export namespace PrebuiltVoiceConfig {\n /**\n * The name of a prebuilt voice that can be used for speech synthesis.\n *\n * Extracted as a non-nullable type from the GeminiBase.PrebuiltVoiceConfig[\"voiceName\"] property.\n */\n export type VoiceName = NonNullable<\n GeminiBase.PrebuiltVoiceConfig[\"voiceName\"]\n >;\n }\n\n export namespace SpeakerVoiceConfig {\n /**\n * The speaker identifier for a custom or multi-speaker TTS configuration.\n *\n * Extracted as a non-nullable type from the GeminiBase.SpeakerVoiceConfig[\"speaker\"] property.\n */\n export type Speaker = NonNullable<\n GeminiBase.SpeakerVoiceConfig[\"speaker\"]\n >;\n }\n\n export namespace SpeechConfig {\n /**\n * The BCP-47 language code for speech synthesis (e.g., \"en-US\").\n *\n * Extracted as a non-nullable type from the GeminiBase.SpeechConfig[\"languageCode\"] property.\n */\n export type LanguageCode = NonNullable<\n GeminiBase.SpeechConfig[\"languageCode\"]\n >;\n }\n\n /**\n * The level of \"thinking\" or reasoning configured for the model.\n *\n * Extends GeminiBase.ThinkingConfig[\"thinkingLevel\"] to also accept\n * lowercase variants (e.g. \"high\" in addition to \"HIGH\").\n */\n export type ThinkingLevel =\n | GeminiBase.ThinkingConfig[\"thinkingLevel\"]\n | LowercaseLiteral<GeminiBase.ThinkingConfig[\"thinkingLevel\"]>;\n\n /**\n * The role of a content message. The spec types this as `string`, but\n * the API only accepts these specific values.\n */\n export type Role = \"user\" | \"model\" | \"function\";\n\n /**\n * Alias for the unwieldy generated grounding support type name.\n */\n export type GroundingSupport =\n GeminiBase.GoogleAiGenerativelanguageV1betaGroundingSupport;\n\n /**\n * Alias for the unwieldy generated segment type name.\n */\n export type Segment = GeminiBase.GoogleAiGenerativelanguageV1betaSegment;\n\n export namespace Tools {\n /**\n * The mode for function calling configuration, extracted from the\n * FunctionCallingConfig interface.\n */\n export type FunctionCallingConfigMode =\n GeminiBase.Tools.FunctionCallingConfig[\"mode\"];\n }\n\n /**\n * Legacy URL retrieval metadata (predecessor of UrlContextMetadata).\n * Not in the current OpenAPI spec but still returned by the API.\n */\n export interface UrlRetrievalMetadata {\n urlRetrievalContexts?: Array<GeminiBase.UrlMetadata>;\n }\n\n // Augment Candidate with legacy field the API still returns.\n export interface Candidate {\n /** @deprecated Use urlContextMetadata instead. */\n readonly urlRetrievalMetadata?: UrlRetrievalMetadata;\n }\n }\n}\n\n/**\n * Simplified speaker/name pair for multi-speaker config.\n * - `speaker` derived from SpeakerVoiceConfig[\"speaker\"]\n * - `name` is the prebuilt voice name\n */\nexport interface SpeechSpeakerName {\n speaker: GeminiBase.SpeakerVoiceConfig.Speaker;\n name: GeminiBase.PrebuiltVoiceConfig.VoiceName;\n}\n\n/** A voice can be a prebuilt voice name, a speaker/name pair, or an array of pairs */\nexport type SpeechVoice =\n | GeminiBase.PrebuiltVoiceConfig.VoiceName\n | SpeechSpeakerName\n | SpeechSpeakerName[];\n\n/** Voice with language code (derived from SpeechConfig's languageCode) */\nexport interface SpeechVoiceLanguage {\n voice: SpeechVoice;\n languageCode: GeminiBase.SpeechConfig.LanguageCode;\n}\n\n/** Voices with language code */\nexport interface SpeechVoicesLanguage {\n voices: SpeechVoice;\n languageCode: GeminiBase.SpeechConfig.LanguageCode;\n}\n\n/** Simplified language config (with voice or voices) */\nexport type SimplifiedSpeechLanguageConfig =\n | SpeechVoiceLanguage\n | SpeechVoicesLanguage;\n\n/** Top-level simplified config: just a voice, or voice+language */\nexport type SimplifiedSpeechConfig =\n | SpeechVoice\n | SimplifiedSpeechLanguageConfig;\n"],"mappings":";AA2MA,MAAa,sBAAgD,CAC3D,QACA,UACF"}
|
|
@@ -2,7 +2,6 @@ import { LowercaseLiteral, Prettify } from "../utils/misc.cjs";
|
|
|
2
2
|
import { Gemini } from "./api-types.cjs";
|
|
3
3
|
import { BindToolsInput } from "@langchain/core/language_models/chat_models";
|
|
4
4
|
import { InteropZodType } from "@langchain/core/utils/types";
|
|
5
|
-
|
|
6
5
|
//#region src/chat_models/types.d.ts
|
|
7
6
|
interface ChatGoogleFields {
|
|
8
7
|
/**
|
|
@@ -274,5 +273,5 @@ type SimplifiedSpeechLanguageConfig = SpeechVoiceLanguage | SpeechVoicesLanguage
|
|
|
274
273
|
/** Top-level simplified config: just a voice, or voice+language */
|
|
275
274
|
type SimplifiedSpeechConfig = SpeechVoice | SimplifiedSpeechLanguageConfig;
|
|
276
275
|
//#endregion
|
|
277
|
-
export { ChatGoogleFields };
|
|
276
|
+
export { ChatGoogleFields, SimplifiedSpeechConfig, SimplifiedSpeechLanguageConfig, SpeechSpeakerName, SpeechVoice, SpeechVoiceLanguage, SpeechVoicesLanguage };
|
|
278
277
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -2,7 +2,6 @@ import { LowercaseLiteral, Prettify } from "../utils/misc.js";
|
|
|
2
2
|
import { Gemini } from "./api-types.js";
|
|
3
3
|
import { BindToolsInput } from "@langchain/core/language_models/chat_models";
|
|
4
4
|
import { InteropZodType } from "@langchain/core/utils/types";
|
|
5
|
-
|
|
6
5
|
//#region src/chat_models/types.d.ts
|
|
7
6
|
interface ChatGoogleFields {
|
|
8
7
|
/**
|
|
@@ -274,5 +273,5 @@ type SimplifiedSpeechLanguageConfig = SpeechVoiceLanguage | SpeechVoicesLanguage
|
|
|
274
273
|
/** Top-level simplified config: just a voice, or voice+language */
|
|
275
274
|
type SimplifiedSpeechConfig = SpeechVoice | SimplifiedSpeechLanguageConfig;
|
|
276
275
|
//#endregion
|
|
277
|
-
export { ChatGoogleFields };
|
|
276
|
+
export { ChatGoogleFields, SimplifiedSpeechConfig, SimplifiedSpeechLanguageConfig, SpeechSpeakerName, SpeechVoice, SpeechVoiceLanguage, SpeechVoicesLanguage };
|
|
278
277
|
//# sourceMappingURL=types.d.ts.map
|