@langchain/google-common 2.1.16 → 2.1.17
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
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @langchain/google-common
|
|
2
2
|
|
|
3
|
+
## 2.1.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#9985](https://github.com/langchain-ai/langchainjs/pull/9985) [`e2ed407`](https://github.com/langchain-ai/langchainjs/commit/e2ed40729c54d132b91b7abecfb787fe5f09461e) Thanks [@turnerdev](https://github.com/turnerdev)! - Set the correct `_llmType` for Google models
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`d5e3db0`](https://github.com/langchain-ai/langchainjs/commit/d5e3db0d01ab321ec70a875805b2f74aefdadf9d)]:
|
|
10
|
+
- @langchain/core@1.1.21
|
|
11
|
+
|
|
3
12
|
## 2.1.16
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/chat_models.cjs
CHANGED
package/dist/chat_models.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_models.cjs","names":["AbstractGoogleLLMConnection","fields: GoogleAIBaseLLMInput<AuthOptions> | undefined","caller: AsyncCaller","client: GoogleAbstractedClient","streaming: boolean","apiConfig: GeminiAPIConfig","geminiConfig: GeminiAPIConfig","getGeminiAPI","BaseChatModel","fields?: ChatGoogleBaseInput<AuthOptions>","ensureParams","copyAndValidateModelParamsInto","DefaultGeminiSafetyHandler","options: this[\"ParsedCallOptions\"]","apiKey: string","ApiKeyGoogleAuth","fields?: GoogleAIBaseLLMInput<AuthOptions>","fields: GoogleBaseLLMInput<AuthOptions>","tools: GoogleAIToolType[]","kwargs?: Partial<GoogleAIBaseLanguageModelCallOptions>","convertToGeminiTools","options?: this[\"ParsedCallOptions\"]","copyAIModelParams","messages: BaseMessage[]","runManager: CallbackManagerForLLMRun | undefined","finalChunk: ChatGenerationChunk | null","chunk","_messages: BaseMessage[]","runManager?: CallbackManagerForLLMRun","usageMetadata: UsageMetadata | undefined","ChatGenerationChunk","AIMessageChunk","PROFILES","outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>","config?: StructuredOutputMethodOptions<boolean>","schema: InteropZodType<RunOutput> | Record<string, any>","outputParser: BaseLLMOutputParser<RunOutput>","tools: GeminiTool[]","schemaToGeminiParameters","JsonOutputKeyToolsParser","geminiFunctionDefinition: GeminiFunctionDeclaration","parameters: GeminiJsonSchema","removeAdditionalProperties","JsonOutputParser","RunnablePassthrough","input: any","config","RunnableSequence"],"sources":["../src/chat_models.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { UsageMetadata, type BaseMessage } from \"@langchain/core/messages\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\n\nimport {\n BaseChatModel,\n LangSmithParams,\n type BaseChatModelParams,\n} from \"@langchain/core/language_models/chat_models\";\nimport { ChatGenerationChunk, ChatResult } from \"@langchain/core/outputs\";\nimport { AIMessageChunk } from \"@langchain/core/messages\";\nimport {\n BaseLanguageModelInput,\n StructuredOutputMethodOptions,\n} from \"@langchain/core/language_models/base\";\nimport { type ModelProfile } from \"@langchain/core/language_models/profile\";\nimport {\n Runnable,\n RunnablePassthrough,\n RunnableSequence,\n} from \"@langchain/core/runnables\";\nimport { JsonOutputKeyToolsParser } from \"@langchain/core/output_parsers/openai_tools\";\nimport {\n BaseLLMOutputParser,\n JsonOutputParser,\n} from \"@langchain/core/output_parsers\";\nimport { AsyncCaller } from \"@langchain/core/utils/async_caller\";\nimport { concat } from \"@langchain/core/utils/stream\";\nimport {\n InteropZodType,\n isInteropZodSchema,\n} from \"@langchain/core/utils/types\";\nimport {\n GoogleAIBaseLLMInput,\n GoogleAIModelParams,\n GoogleAISafetySetting,\n GoogleConnectionParams,\n GooglePlatformType,\n GeminiTool,\n GoogleAIBaseLanguageModelCallOptions,\n GoogleAIAPI,\n GoogleAIAPIParams,\n GoogleSearchToolSetting,\n GoogleSpeechConfig,\n GeminiJsonSchema,\n} from \"./types.js\";\nimport {\n convertToGeminiTools,\n copyAIModelParams,\n copyAndValidateModelParamsInto,\n} from \"./utils/common.js\";\nimport { AbstractGoogleLLMConnection } from \"./connection.js\";\nimport { DefaultGeminiSafetyHandler, getGeminiAPI } from \"./utils/gemini.js\";\nimport { ApiKeyGoogleAuth, GoogleAbstractedClient } from \"./auth.js\";\nimport { JsonStream } from \"./utils/stream.js\";\nimport { ensureParams } from \"./utils/failed_handler.js\";\nimport type {\n GoogleBaseLLMInput,\n GoogleAISafetyHandler,\n GoogleAISafetyParams,\n GeminiFunctionDeclaration,\n GeminiFunctionSchema,\n GoogleAIToolType,\n GeminiAPIConfig,\n GoogleAIModelModality,\n} from \"./types.js\";\nimport {\n removeAdditionalProperties,\n schemaToGeminiParameters,\n} from \"./utils/zod_to_gemini_parameters.js\";\nimport PROFILES from \"./profiles.js\";\n\nexport class ChatConnection<AuthOptions> extends AbstractGoogleLLMConnection<\n BaseMessage[],\n AuthOptions\n> {\n convertSystemMessageToHumanContent: boolean | undefined;\n\n constructor(\n fields: GoogleAIBaseLLMInput<AuthOptions> | undefined,\n caller: AsyncCaller,\n client: GoogleAbstractedClient,\n streaming: boolean\n ) {\n super(fields, caller, client, streaming);\n this.convertSystemMessageToHumanContent =\n fields?.convertSystemMessageToHumanContent;\n }\n\n get useSystemInstruction(): boolean {\n return typeof this.convertSystemMessageToHumanContent === \"boolean\"\n ? !this.convertSystemMessageToHumanContent\n : this.computeUseSystemInstruction;\n }\n\n get computeUseSystemInstruction(): boolean {\n // This works on models from April 2024 and later\n // Vertex AI: gemini-1.5-pro and gemini-1.0-002 and later\n // AI Studio: gemini-1.5-pro-latest\n if (this.modelFamily === \"palm\") {\n return false;\n } else if (this.modelName === \"gemini-1.0-pro-001\") {\n return false;\n } else if (this.modelName.startsWith(\"gemini-pro-vision\")) {\n return false;\n } else if (this.modelName.startsWith(\"gemini-1.0-pro-vision\")) {\n return false;\n } else if (this.modelName === \"gemini-pro\" && this.platform === \"gai\") {\n // on AI Studio gemini-pro is still pointing at gemini-1.0-pro-001\n return false;\n } else if (this.modelFamily === \"gemma\") {\n // At least as of 12 Mar 2025 gemma 3 on AIS, trying to use system instructions yields an error:\n // \"Developer instruction is not enabled for models/gemma-3-27b-it\"\n return false;\n }\n return true;\n }\n\n computeGoogleSearchToolAdjustmentFromModel(): Exclude<\n GoogleSearchToolSetting,\n boolean\n > {\n if (this.modelName.startsWith(\"gemini-1.0\")) {\n return \"googleSearchRetrieval\";\n } else if (this.modelName.startsWith(\"gemini-1.5\")) {\n return \"googleSearchRetrieval\";\n } else {\n return \"googleSearch\";\n }\n }\n\n computeGoogleSearchToolAdjustment(\n apiConfig: GeminiAPIConfig\n ): Exclude<GoogleSearchToolSetting, true> {\n const adj = apiConfig.googleSearchToolAdjustment;\n if (adj === undefined || adj === true) {\n return this.computeGoogleSearchToolAdjustmentFromModel();\n } else {\n return adj;\n }\n }\n\n buildGeminiAPI(): GoogleAIAPI {\n const apiConfig: GeminiAPIConfig =\n (this.apiConfig as GeminiAPIConfig) ?? {};\n const googleSearchToolAdjustment =\n this.computeGoogleSearchToolAdjustment(apiConfig);\n const geminiConfig: GeminiAPIConfig = {\n useSystemInstruction: this.useSystemInstruction,\n googleSearchToolAdjustment,\n ...apiConfig,\n };\n return getGeminiAPI(geminiConfig);\n }\n\n get api(): GoogleAIAPI {\n switch (this.apiName) {\n case \"google\":\n return this.buildGeminiAPI();\n default:\n return super.api;\n }\n }\n}\n\n/**\n * Input to chat model class.\n */\nexport interface ChatGoogleBaseInput<AuthOptions>\n extends\n BaseChatModelParams,\n GoogleConnectionParams<AuthOptions>,\n GoogleAIModelParams,\n GoogleAISafetyParams,\n GoogleAIAPIParams,\n Pick<GoogleAIBaseLanguageModelCallOptions, \"streamUsage\"> {}\n\n/**\n * Integration with a Google chat model.\n */\nexport abstract class ChatGoogleBase<AuthOptions>\n extends BaseChatModel<GoogleAIBaseLanguageModelCallOptions, AIMessageChunk>\n implements ChatGoogleBaseInput<AuthOptions>\n{\n // Used for tracing, replace with the same name as your class\n static lc_name() {\n return \"ChatGoogle\";\n }\n\n get lc_secrets(): { [key: string]: string } | undefined {\n return {\n authOptions: \"GOOGLE_AUTH_OPTIONS\",\n };\n }\n\n lc_serializable = true;\n\n // Set based on modelName\n model: string;\n\n modelName = \"gemini-pro\";\n\n temperature: number;\n\n maxOutputTokens: number;\n\n maxReasoningTokens: number;\n\n topP: number;\n\n topK: number;\n\n seed: number;\n\n presencePenalty: number;\n\n frequencyPenalty: number;\n\n stopSequences: string[] = [];\n\n logprobs: boolean;\n\n topLogprobs: number = 0;\n\n safetySettings: GoogleAISafetySetting[] = [];\n\n responseModalities?: GoogleAIModelModality[];\n\n // May intentionally be undefined, meaning to compute this.\n convertSystemMessageToHumanContent: boolean | undefined;\n\n safetyHandler: GoogleAISafetyHandler;\n\n speechConfig: GoogleSpeechConfig;\n\n streamUsage = true;\n\n streaming = false;\n\n labels?: Record<string, string>;\n\n protected connection: ChatConnection<AuthOptions>;\n\n protected streamedConnection: ChatConnection<AuthOptions>;\n\n constructor(fields?: ChatGoogleBaseInput<AuthOptions>) {\n super(ensureParams(fields));\n\n copyAndValidateModelParamsInto(fields, this);\n this.safetyHandler =\n fields?.safetyHandler ?? new DefaultGeminiSafetyHandler();\n this.streamUsage = fields?.streamUsage ?? this.streamUsage;\n const client = this.buildClient(fields);\n this.buildConnection(fields ?? {}, client);\n }\n\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams {\n const params = this.invocationParams(options);\n return {\n ls_provider: \"google_vertexai\",\n ls_model_name: this.model,\n ls_model_type: \"chat\",\n ls_temperature: params.temperature ?? undefined,\n ls_max_tokens: params.maxOutputTokens ?? undefined,\n ls_stop: options.stop,\n };\n }\n\n abstract buildAbstractedClient(\n fields?: GoogleAIBaseLLMInput<AuthOptions>\n ): GoogleAbstractedClient;\n\n buildApiKeyClient(apiKey: string): GoogleAbstractedClient {\n return new ApiKeyGoogleAuth(apiKey);\n }\n\n buildApiKey(fields?: GoogleAIBaseLLMInput<AuthOptions>): string | undefined {\n return fields?.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n }\n\n buildClient(\n fields?: GoogleAIBaseLLMInput<AuthOptions>\n ): GoogleAbstractedClient {\n const apiKey = this.buildApiKey(fields);\n if (apiKey) {\n return this.buildApiKeyClient(apiKey);\n } else {\n return this.buildAbstractedClient(fields);\n }\n }\n\n buildConnection(\n fields: GoogleBaseLLMInput<AuthOptions>,\n client: GoogleAbstractedClient\n ) {\n this.connection = new ChatConnection(\n { ...fields, ...this },\n this.caller,\n client,\n false\n );\n\n this.streamedConnection = new ChatConnection(\n { ...fields, ...this },\n this.caller,\n client,\n true\n );\n }\n\n get platform(): GooglePlatformType {\n return this.connection.platform;\n }\n\n override bindTools(\n tools: GoogleAIToolType[],\n kwargs?: Partial<GoogleAIBaseLanguageModelCallOptions>\n ): Runnable<\n BaseLanguageModelInput,\n AIMessageChunk,\n GoogleAIBaseLanguageModelCallOptions\n > {\n return this.withConfig({ tools: convertToGeminiTools(tools), ...kwargs });\n }\n\n // Replace\n _llmType() {\n return \"chat_integration\";\n }\n\n /**\n * Get the parameters used to invoke the model\n */\n override invocationParams(options?: this[\"ParsedCallOptions\"]) {\n return copyAIModelParams(this, options);\n }\n\n async _generate(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager: CallbackManagerForLLMRun | undefined\n ): Promise<ChatResult> {\n options.signal?.throwIfAborted();\n const parameters = this.invocationParams(options);\n if (this.streaming) {\n const stream = this._streamResponseChunks(messages, options, runManager);\n let finalChunk: ChatGenerationChunk | null = null;\n for await (const chunk of stream) {\n finalChunk = !finalChunk ? chunk : concat(finalChunk, chunk);\n }\n if (!finalChunk) {\n throw new Error(\"No chunks were returned from the stream.\");\n }\n return {\n generations: [finalChunk],\n };\n }\n\n const response = await this.connection.request(\n messages,\n parameters,\n options,\n runManager\n );\n const ret = this.connection.api.responseToChatResult(response);\n const chunk = ret?.generations?.[0];\n if (chunk) {\n await runManager?.handleLLMNewToken(chunk.text || \"\");\n }\n return ret;\n }\n\n async *_streamResponseChunks(\n _messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager?: CallbackManagerForLLMRun\n ): AsyncGenerator<ChatGenerationChunk> {\n // Make the call as a streaming request\n const parameters = this.invocationParams(options);\n const response = await this.streamedConnection.request(\n _messages,\n parameters,\n options,\n runManager\n );\n\n // Get the streaming parser of the response\n const stream = response.data as JsonStream;\n let usageMetadata: UsageMetadata | undefined;\n // Loop until the end of the stream\n // During the loop, yield each time we get a chunk from the streaming parser\n // that is either available or added to the queue\n while (!stream.streamDone) {\n if (options.signal?.aborted) {\n return;\n }\n const output = await stream.nextChunk();\n await runManager?.handleCustomEvent(\n `google-chunk-${this.constructor.name}`,\n {\n output,\n }\n );\n if (\n output &&\n output.usageMetadata &&\n this.streamUsage !== false &&\n options.streamUsage !== false\n ) {\n usageMetadata = {\n input_tokens: output.usageMetadata.promptTokenCount,\n output_tokens: output.usageMetadata.candidatesTokenCount,\n total_tokens: output.usageMetadata.totalTokenCount,\n };\n }\n const chunk =\n output !== null\n ? this.connection.api.responseToChatGeneration({ data: output })\n : new ChatGenerationChunk({\n text: \"\",\n generationInfo: { finishReason: \"stop\" },\n message: new AIMessageChunk({\n content: \"\",\n usage_metadata: usageMetadata,\n }),\n });\n if (chunk) {\n yield chunk;\n await runManager?.handleLLMNewToken(\n chunk.text ?? \"\",\n undefined,\n undefined,\n undefined,\n undefined,\n { chunk }\n );\n }\n }\n }\n\n /** @ignore */\n _combineLLMOutput() {\n return [];\n }\n\n /**\n * Return profiling information for the model.\n *\n * Provides information about the model's capabilities and constraints,\n * including token limits, multimodal support, and advanced features like\n * tool calling and structured output.\n *\n * @returns {ModelProfile} An object describing the model's capabilities and constraints\n */\n get profile(): ModelProfile {\n return PROFILES[this.model] ?? {};\n }\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<false>\n ): Runnable<BaseLanguageModelInput, RunOutput>;\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const schema: InteropZodType<RunOutput> | Record<string, any> =\n outputSchema;\n const name = config?.name;\n const method = config?.method;\n const includeRaw = config?.includeRaw;\n if (method === \"jsonMode\") {\n throw new Error(\n `Google only supports \"jsonSchema\" or \"functionCalling\" as a method.`\n );\n }\n\n let llm;\n let outputParser: BaseLLMOutputParser<RunOutput>;\n if (method === \"functionCalling\") {\n let functionName = name ?? \"extract\";\n let tools: GeminiTool[];\n if (isInteropZodSchema(schema)) {\n const jsonSchema = schemaToGeminiParameters(schema);\n tools = [\n {\n functionDeclarations: [\n {\n name: functionName,\n description:\n jsonSchema.description ?? \"A function available to call.\",\n parameters: jsonSchema as GeminiFunctionSchema,\n },\n ],\n },\n ];\n outputParser = new JsonOutputKeyToolsParser({\n returnSingle: true,\n keyName: functionName,\n zodSchema: schema,\n });\n } else {\n let geminiFunctionDefinition: GeminiFunctionDeclaration;\n if (\n typeof schema.name === \"string\" &&\n typeof schema.parameters === \"object\" &&\n schema.parameters != null\n ) {\n geminiFunctionDefinition = schema as GeminiFunctionDeclaration;\n functionName = schema.name;\n } else {\n // We are providing the schema for *just* the parameters, probably\n const parameters: GeminiJsonSchema =\n removeAdditionalProperties(schema);\n geminiFunctionDefinition = {\n name: functionName,\n description: schema.description ?? \"\",\n parameters,\n };\n }\n tools = [\n {\n functionDeclarations: [geminiFunctionDefinition],\n },\n ];\n outputParser = new JsonOutputKeyToolsParser<RunOutput>({\n returnSingle: true,\n keyName: functionName,\n });\n }\n llm = this.bindTools(tools).withConfig({ tool_choice: functionName });\n } else {\n // Default to jsonSchema method\n const jsonSchema = schemaToGeminiParameters(schema);\n llm = this.withConfig({\n responseSchema: jsonSchema as GeminiJsonSchema,\n });\n outputParser = new JsonOutputParser();\n }\n\n if (!includeRaw) {\n return llm.pipe(outputParser).withConfig({\n runName: \"ChatGoogleStructuredOutput\",\n }) as Runnable<BaseLanguageModelInput, RunOutput>;\n }\n\n const parserAssign = RunnablePassthrough.assign({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsed: (input: any, config) => outputParser.invoke(input.raw, config),\n });\n const parserNone = RunnablePassthrough.assign({\n parsed: () => null,\n });\n const parsedWithFallback = parserAssign.withFallbacks({\n fallbacks: [parserNone],\n });\n return RunnableSequence.from<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n >([\n {\n raw: llm,\n },\n parsedWithFallback,\n ]).withConfig({\n runName: \"StructuredOutputRunnable\",\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwEA,IAAa,iBAAb,cAAiDA,+CAG/C;CACA;CAEA,YACEC,QACAC,QACAC,QACAC,WACA;EACA,MAAM,QAAQ,QA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aAAc,EAAC;EACtE,OAAM;GAEL,MAAM,aAAaD,0DAAyB,OAAO;GACnD,MAAM,KAAK,WAAW,EACpB,gBAAgB,WACjB,EAAC;GACF,eAAe,IAAIK;EACpB;AAED,MAAI,CAAC,WACH,QAAO,IAAI,KAAK,aAAa,CAAC,WAAW,EACvC,SAAS,6BACV,EAAC;EAGJ,MAAM,eAAeC,+CAAoB,OAAO,EAE9C,QAAQ,CAACC,OAAYC,aAAW,aAAa,OAAO,MAAM,KAAKA,SAAO,CACvE,EAAC;EACF,MAAM,aAAaF,+CAAoB,OAAO,EAC5C,QAAQ,MAAM,KACf,EAAC;EACF,MAAM,qBAAqB,aAAa,cAAc,EACpD,WAAW,CAAC,UAAW,EACxB,EAAC;AACF,SAAOG,4CAAiB,KAGtB,CACA,EACE,KAAK,IACN,GACD,kBACD,EAAC,CAAC,WAAW,EACZ,SAAS,2BACV,EAAC;CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"chat_models.cjs","names":["AbstractGoogleLLMConnection","fields: GoogleAIBaseLLMInput<AuthOptions> | undefined","caller: AsyncCaller","client: GoogleAbstractedClient","streaming: boolean","apiConfig: GeminiAPIConfig","geminiConfig: GeminiAPIConfig","getGeminiAPI","BaseChatModel","fields?: ChatGoogleBaseInput<AuthOptions>","ensureParams","copyAndValidateModelParamsInto","DefaultGeminiSafetyHandler","options: this[\"ParsedCallOptions\"]","apiKey: string","ApiKeyGoogleAuth","fields?: GoogleAIBaseLLMInput<AuthOptions>","fields: GoogleBaseLLMInput<AuthOptions>","tools: GoogleAIToolType[]","kwargs?: Partial<GoogleAIBaseLanguageModelCallOptions>","convertToGeminiTools","options?: this[\"ParsedCallOptions\"]","copyAIModelParams","messages: BaseMessage[]","runManager: CallbackManagerForLLMRun | undefined","finalChunk: ChatGenerationChunk | null","chunk","_messages: BaseMessage[]","runManager?: CallbackManagerForLLMRun","usageMetadata: UsageMetadata | undefined","ChatGenerationChunk","AIMessageChunk","PROFILES","outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>","config?: StructuredOutputMethodOptions<boolean>","schema: InteropZodType<RunOutput> | Record<string, any>","outputParser: BaseLLMOutputParser<RunOutput>","tools: GeminiTool[]","schemaToGeminiParameters","JsonOutputKeyToolsParser","geminiFunctionDefinition: GeminiFunctionDeclaration","parameters: GeminiJsonSchema","removeAdditionalProperties","JsonOutputParser","RunnablePassthrough","input: any","config","RunnableSequence"],"sources":["../src/chat_models.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { UsageMetadata, type BaseMessage } from \"@langchain/core/messages\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\n\nimport {\n BaseChatModel,\n LangSmithParams,\n type BaseChatModelParams,\n} from \"@langchain/core/language_models/chat_models\";\nimport { ChatGenerationChunk, ChatResult } from \"@langchain/core/outputs\";\nimport { AIMessageChunk } from \"@langchain/core/messages\";\nimport {\n BaseLanguageModelInput,\n StructuredOutputMethodOptions,\n} from \"@langchain/core/language_models/base\";\nimport { type ModelProfile } from \"@langchain/core/language_models/profile\";\nimport {\n Runnable,\n RunnablePassthrough,\n RunnableSequence,\n} from \"@langchain/core/runnables\";\nimport { JsonOutputKeyToolsParser } from \"@langchain/core/output_parsers/openai_tools\";\nimport {\n BaseLLMOutputParser,\n JsonOutputParser,\n} from \"@langchain/core/output_parsers\";\nimport { AsyncCaller } from \"@langchain/core/utils/async_caller\";\nimport { concat } from \"@langchain/core/utils/stream\";\nimport {\n InteropZodType,\n isInteropZodSchema,\n} from \"@langchain/core/utils/types\";\nimport {\n GoogleAIBaseLLMInput,\n GoogleAIModelParams,\n GoogleAISafetySetting,\n GoogleConnectionParams,\n GooglePlatformType,\n GeminiTool,\n GoogleAIBaseLanguageModelCallOptions,\n GoogleAIAPI,\n GoogleAIAPIParams,\n GoogleSearchToolSetting,\n GoogleSpeechConfig,\n GeminiJsonSchema,\n} from \"./types.js\";\nimport {\n convertToGeminiTools,\n copyAIModelParams,\n copyAndValidateModelParamsInto,\n} from \"./utils/common.js\";\nimport { AbstractGoogleLLMConnection } from \"./connection.js\";\nimport { DefaultGeminiSafetyHandler, getGeminiAPI } from \"./utils/gemini.js\";\nimport { ApiKeyGoogleAuth, GoogleAbstractedClient } from \"./auth.js\";\nimport { JsonStream } from \"./utils/stream.js\";\nimport { ensureParams } from \"./utils/failed_handler.js\";\nimport type {\n GoogleBaseLLMInput,\n GoogleAISafetyHandler,\n GoogleAISafetyParams,\n GeminiFunctionDeclaration,\n GeminiFunctionSchema,\n GoogleAIToolType,\n GeminiAPIConfig,\n GoogleAIModelModality,\n} from \"./types.js\";\nimport {\n removeAdditionalProperties,\n schemaToGeminiParameters,\n} from \"./utils/zod_to_gemini_parameters.js\";\nimport PROFILES from \"./profiles.js\";\n\nexport class ChatConnection<AuthOptions> extends AbstractGoogleLLMConnection<\n BaseMessage[],\n AuthOptions\n> {\n convertSystemMessageToHumanContent: boolean | undefined;\n\n constructor(\n fields: GoogleAIBaseLLMInput<AuthOptions> | undefined,\n caller: AsyncCaller,\n client: GoogleAbstractedClient,\n streaming: boolean\n ) {\n super(fields, caller, client, streaming);\n this.convertSystemMessageToHumanContent =\n fields?.convertSystemMessageToHumanContent;\n }\n\n get useSystemInstruction(): boolean {\n return typeof this.convertSystemMessageToHumanContent === \"boolean\"\n ? !this.convertSystemMessageToHumanContent\n : this.computeUseSystemInstruction;\n }\n\n get computeUseSystemInstruction(): boolean {\n // This works on models from April 2024 and later\n // Vertex AI: gemini-1.5-pro and gemini-1.0-002 and later\n // AI Studio: gemini-1.5-pro-latest\n if (this.modelFamily === \"palm\") {\n return false;\n } else if (this.modelName === \"gemini-1.0-pro-001\") {\n return false;\n } else if (this.modelName.startsWith(\"gemini-pro-vision\")) {\n return false;\n } else if (this.modelName.startsWith(\"gemini-1.0-pro-vision\")) {\n return false;\n } else if (this.modelName === \"gemini-pro\" && this.platform === \"gai\") {\n // on AI Studio gemini-pro is still pointing at gemini-1.0-pro-001\n return false;\n } else if (this.modelFamily === \"gemma\") {\n // At least as of 12 Mar 2025 gemma 3 on AIS, trying to use system instructions yields an error:\n // \"Developer instruction is not enabled for models/gemma-3-27b-it\"\n return false;\n }\n return true;\n }\n\n computeGoogleSearchToolAdjustmentFromModel(): Exclude<\n GoogleSearchToolSetting,\n boolean\n > {\n if (this.modelName.startsWith(\"gemini-1.0\")) {\n return \"googleSearchRetrieval\";\n } else if (this.modelName.startsWith(\"gemini-1.5\")) {\n return \"googleSearchRetrieval\";\n } else {\n return \"googleSearch\";\n }\n }\n\n computeGoogleSearchToolAdjustment(\n apiConfig: GeminiAPIConfig\n ): Exclude<GoogleSearchToolSetting, true> {\n const adj = apiConfig.googleSearchToolAdjustment;\n if (adj === undefined || adj === true) {\n return this.computeGoogleSearchToolAdjustmentFromModel();\n } else {\n return adj;\n }\n }\n\n buildGeminiAPI(): GoogleAIAPI {\n const apiConfig: GeminiAPIConfig =\n (this.apiConfig as GeminiAPIConfig) ?? {};\n const googleSearchToolAdjustment =\n this.computeGoogleSearchToolAdjustment(apiConfig);\n const geminiConfig: GeminiAPIConfig = {\n useSystemInstruction: this.useSystemInstruction,\n googleSearchToolAdjustment,\n ...apiConfig,\n };\n return getGeminiAPI(geminiConfig);\n }\n\n get api(): GoogleAIAPI {\n switch (this.apiName) {\n case \"google\":\n return this.buildGeminiAPI();\n default:\n return super.api;\n }\n }\n}\n\n/**\n * Input to chat model class.\n */\nexport interface ChatGoogleBaseInput<AuthOptions>\n extends\n BaseChatModelParams,\n GoogleConnectionParams<AuthOptions>,\n GoogleAIModelParams,\n GoogleAISafetyParams,\n GoogleAIAPIParams,\n Pick<GoogleAIBaseLanguageModelCallOptions, \"streamUsage\"> {}\n\n/**\n * Integration with a Google chat model.\n */\nexport abstract class ChatGoogleBase<AuthOptions>\n extends BaseChatModel<GoogleAIBaseLanguageModelCallOptions, AIMessageChunk>\n implements ChatGoogleBaseInput<AuthOptions>\n{\n // Used for tracing, replace with the same name as your class\n static lc_name() {\n return \"ChatGoogle\";\n }\n\n get lc_secrets(): { [key: string]: string } | undefined {\n return {\n authOptions: \"GOOGLE_AUTH_OPTIONS\",\n };\n }\n\n lc_serializable = true;\n\n // Set based on modelName\n model: string;\n\n modelName = \"gemini-pro\";\n\n temperature: number;\n\n maxOutputTokens: number;\n\n maxReasoningTokens: number;\n\n topP: number;\n\n topK: number;\n\n seed: number;\n\n presencePenalty: number;\n\n frequencyPenalty: number;\n\n stopSequences: string[] = [];\n\n logprobs: boolean;\n\n topLogprobs: number = 0;\n\n safetySettings: GoogleAISafetySetting[] = [];\n\n responseModalities?: GoogleAIModelModality[];\n\n // May intentionally be undefined, meaning to compute this.\n convertSystemMessageToHumanContent: boolean | undefined;\n\n safetyHandler: GoogleAISafetyHandler;\n\n speechConfig: GoogleSpeechConfig;\n\n streamUsage = true;\n\n streaming = false;\n\n labels?: Record<string, string>;\n\n protected connection: ChatConnection<AuthOptions>;\n\n protected streamedConnection: ChatConnection<AuthOptions>;\n\n constructor(fields?: ChatGoogleBaseInput<AuthOptions>) {\n super(ensureParams(fields));\n\n copyAndValidateModelParamsInto(fields, this);\n this.safetyHandler =\n fields?.safetyHandler ?? new DefaultGeminiSafetyHandler();\n this.streamUsage = fields?.streamUsage ?? this.streamUsage;\n const client = this.buildClient(fields);\n this.buildConnection(fields ?? {}, client);\n }\n\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams {\n const params = this.invocationParams(options);\n return {\n ls_provider: \"google_vertexai\",\n ls_model_name: this.model,\n ls_model_type: \"chat\",\n ls_temperature: params.temperature ?? undefined,\n ls_max_tokens: params.maxOutputTokens ?? undefined,\n ls_stop: options.stop,\n };\n }\n\n abstract buildAbstractedClient(\n fields?: GoogleAIBaseLLMInput<AuthOptions>\n ): GoogleAbstractedClient;\n\n buildApiKeyClient(apiKey: string): GoogleAbstractedClient {\n return new ApiKeyGoogleAuth(apiKey);\n }\n\n buildApiKey(fields?: GoogleAIBaseLLMInput<AuthOptions>): string | undefined {\n return fields?.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n }\n\n buildClient(\n fields?: GoogleAIBaseLLMInput<AuthOptions>\n ): GoogleAbstractedClient {\n const apiKey = this.buildApiKey(fields);\n if (apiKey) {\n return this.buildApiKeyClient(apiKey);\n } else {\n return this.buildAbstractedClient(fields);\n }\n }\n\n buildConnection(\n fields: GoogleBaseLLMInput<AuthOptions>,\n client: GoogleAbstractedClient\n ) {\n this.connection = new ChatConnection(\n { ...fields, ...this },\n this.caller,\n client,\n false\n );\n\n this.streamedConnection = new ChatConnection(\n { ...fields, ...this },\n this.caller,\n client,\n true\n );\n }\n\n get platform(): GooglePlatformType {\n return this.connection.platform;\n }\n\n override bindTools(\n tools: GoogleAIToolType[],\n kwargs?: Partial<GoogleAIBaseLanguageModelCallOptions>\n ): Runnable<\n BaseLanguageModelInput,\n AIMessageChunk,\n GoogleAIBaseLanguageModelCallOptions\n > {\n return this.withConfig({ tools: convertToGeminiTools(tools), ...kwargs });\n }\n\n _llmType() {\n return \"google\";\n }\n\n /**\n * Get the parameters used to invoke the model\n */\n override invocationParams(options?: this[\"ParsedCallOptions\"]) {\n return copyAIModelParams(this, options);\n }\n\n async _generate(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager: CallbackManagerForLLMRun | undefined\n ): Promise<ChatResult> {\n options.signal?.throwIfAborted();\n const parameters = this.invocationParams(options);\n if (this.streaming) {\n const stream = this._streamResponseChunks(messages, options, runManager);\n let finalChunk: ChatGenerationChunk | null = null;\n for await (const chunk of stream) {\n finalChunk = !finalChunk ? chunk : concat(finalChunk, chunk);\n }\n if (!finalChunk) {\n throw new Error(\"No chunks were returned from the stream.\");\n }\n return {\n generations: [finalChunk],\n };\n }\n\n const response = await this.connection.request(\n messages,\n parameters,\n options,\n runManager\n );\n const ret = this.connection.api.responseToChatResult(response);\n const chunk = ret?.generations?.[0];\n if (chunk) {\n await runManager?.handleLLMNewToken(chunk.text || \"\");\n }\n return ret;\n }\n\n async *_streamResponseChunks(\n _messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager?: CallbackManagerForLLMRun\n ): AsyncGenerator<ChatGenerationChunk> {\n // Make the call as a streaming request\n const parameters = this.invocationParams(options);\n const response = await this.streamedConnection.request(\n _messages,\n parameters,\n options,\n runManager\n );\n\n // Get the streaming parser of the response\n const stream = response.data as JsonStream;\n let usageMetadata: UsageMetadata | undefined;\n // Loop until the end of the stream\n // During the loop, yield each time we get a chunk from the streaming parser\n // that is either available or added to the queue\n while (!stream.streamDone) {\n if (options.signal?.aborted) {\n return;\n }\n const output = await stream.nextChunk();\n await runManager?.handleCustomEvent(\n `google-chunk-${this.constructor.name}`,\n {\n output,\n }\n );\n if (\n output &&\n output.usageMetadata &&\n this.streamUsage !== false &&\n options.streamUsage !== false\n ) {\n usageMetadata = {\n input_tokens: output.usageMetadata.promptTokenCount,\n output_tokens: output.usageMetadata.candidatesTokenCount,\n total_tokens: output.usageMetadata.totalTokenCount,\n };\n }\n const chunk =\n output !== null\n ? this.connection.api.responseToChatGeneration({ data: output })\n : new ChatGenerationChunk({\n text: \"\",\n generationInfo: { finishReason: \"stop\" },\n message: new AIMessageChunk({\n content: \"\",\n usage_metadata: usageMetadata,\n }),\n });\n if (chunk) {\n yield chunk;\n await runManager?.handleLLMNewToken(\n chunk.text ?? \"\",\n undefined,\n undefined,\n undefined,\n undefined,\n { chunk }\n );\n }\n }\n }\n\n /** @ignore */\n _combineLLMOutput() {\n return [];\n }\n\n /**\n * Return profiling information for the model.\n *\n * Provides information about the model's capabilities and constraints,\n * including token limits, multimodal support, and advanced features like\n * tool calling and structured output.\n *\n * @returns {ModelProfile} An object describing the model's capabilities and constraints\n */\n get profile(): ModelProfile {\n return PROFILES[this.model] ?? {};\n }\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<false>\n ): Runnable<BaseLanguageModelInput, RunOutput>;\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const schema: InteropZodType<RunOutput> | Record<string, any> =\n outputSchema;\n const name = config?.name;\n const method = config?.method;\n const includeRaw = config?.includeRaw;\n if (method === \"jsonMode\") {\n throw new Error(\n `Google only supports \"jsonSchema\" or \"functionCalling\" as a method.`\n );\n }\n\n let llm;\n let outputParser: BaseLLMOutputParser<RunOutput>;\n if (method === \"functionCalling\") {\n let functionName = name ?? \"extract\";\n let tools: GeminiTool[];\n if (isInteropZodSchema(schema)) {\n const jsonSchema = schemaToGeminiParameters(schema);\n tools = [\n {\n functionDeclarations: [\n {\n name: functionName,\n description:\n jsonSchema.description ?? \"A function available to call.\",\n parameters: jsonSchema as GeminiFunctionSchema,\n },\n ],\n },\n ];\n outputParser = new JsonOutputKeyToolsParser({\n returnSingle: true,\n keyName: functionName,\n zodSchema: schema,\n });\n } else {\n let geminiFunctionDefinition: GeminiFunctionDeclaration;\n if (\n typeof schema.name === \"string\" &&\n typeof schema.parameters === \"object\" &&\n schema.parameters != null\n ) {\n geminiFunctionDefinition = schema as GeminiFunctionDeclaration;\n functionName = schema.name;\n } else {\n // We are providing the schema for *just* the parameters, probably\n const parameters: GeminiJsonSchema =\n removeAdditionalProperties(schema);\n geminiFunctionDefinition = {\n name: functionName,\n description: schema.description ?? \"\",\n parameters,\n };\n }\n tools = [\n {\n functionDeclarations: [geminiFunctionDefinition],\n },\n ];\n outputParser = new JsonOutputKeyToolsParser<RunOutput>({\n returnSingle: true,\n keyName: functionName,\n });\n }\n llm = this.bindTools(tools).withConfig({ tool_choice: functionName });\n } else {\n // Default to jsonSchema method\n const jsonSchema = schemaToGeminiParameters(schema);\n llm = this.withConfig({\n responseSchema: jsonSchema as GeminiJsonSchema,\n });\n outputParser = new JsonOutputParser();\n }\n\n if (!includeRaw) {\n return llm.pipe(outputParser).withConfig({\n runName: \"ChatGoogleStructuredOutput\",\n }) as Runnable<BaseLanguageModelInput, RunOutput>;\n }\n\n const parserAssign = RunnablePassthrough.assign({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsed: (input: any, config) => outputParser.invoke(input.raw, config),\n });\n const parserNone = RunnablePassthrough.assign({\n parsed: () => null,\n });\n const parsedWithFallback = parserAssign.withFallbacks({\n fallbacks: [parserNone],\n });\n return RunnableSequence.from<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n >([\n {\n raw: llm,\n },\n parsedWithFallback,\n ]).withConfig({\n runName: \"StructuredOutputRunnable\",\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwEA,IAAa,iBAAb,cAAiDA,+CAG/C;CACA;CAEA,YACEC,QACAC,QACAC,QACAC,WACA;EACA,MAAM,QAAQ,QAAQ,QAAQ,UAAU;EACxC,KAAK,qCACH,QAAQ;CACX;CAED,IAAI,uBAAgC;AAClC,SAAO,OAAO,KAAK,uCAAuC,YACtD,CAAC,KAAK,qCACN,KAAK;CACV;CAED,IAAI,8BAAu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,QAAO,IAAI,KAAK,aAAa,CAAC,WAAW,EACvC,SAAS,6BACV,EAAC;EAGJ,MAAM,eAAeC,+CAAoB,OAAO,EAE9C,QAAQ,CAACC,OAAYC,aAAW,aAAa,OAAO,MAAM,KAAKA,SAAO,CACvE,EAAC;EACF,MAAM,aAAaF,+CAAoB,OAAO,EAC5C,QAAQ,MAAM,KACf,EAAC;EACF,MAAM,qBAAqB,aAAa,cAAc,EACpD,WAAW,CAAC,UAAW,EACxB,EAAC;AACF,SAAOG,4CAAiB,KAGtB,CACA,EACE,KAAK,IACN,GACD,kBACD,EAAC,CAAC,WAAW,EACZ,SAAS,2BACV,EAAC;CACH;AACF"}
|
package/dist/chat_models.js
CHANGED
package/dist/chat_models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_models.js","names":["fields: GoogleAIBaseLLMInput<AuthOptions> | undefined","caller: AsyncCaller","client: GoogleAbstractedClient","streaming: boolean","apiConfig: GeminiAPIConfig","geminiConfig: GeminiAPIConfig","fields?: ChatGoogleBaseInput<AuthOptions>","options: this[\"ParsedCallOptions\"]","apiKey: string","fields?: GoogleAIBaseLLMInput<AuthOptions>","fields: GoogleBaseLLMInput<AuthOptions>","tools: GoogleAIToolType[]","kwargs?: Partial<GoogleAIBaseLanguageModelCallOptions>","options?: this[\"ParsedCallOptions\"]","messages: BaseMessage[]","runManager: CallbackManagerForLLMRun | undefined","finalChunk: ChatGenerationChunk | null","chunk","_messages: BaseMessage[]","runManager?: CallbackManagerForLLMRun","usageMetadata: UsageMetadata | undefined","PROFILES","outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>","config?: StructuredOutputMethodOptions<boolean>","schema: InteropZodType<RunOutput> | Record<string, any>","outputParser: BaseLLMOutputParser<RunOutput>","tools: GeminiTool[]","geminiFunctionDefinition: GeminiFunctionDeclaration","parameters: GeminiJsonSchema","input: any","config"],"sources":["../src/chat_models.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { UsageMetadata, type BaseMessage } from \"@langchain/core/messages\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\n\nimport {\n BaseChatModel,\n LangSmithParams,\n type BaseChatModelParams,\n} from \"@langchain/core/language_models/chat_models\";\nimport { ChatGenerationChunk, ChatResult } from \"@langchain/core/outputs\";\nimport { AIMessageChunk } from \"@langchain/core/messages\";\nimport {\n BaseLanguageModelInput,\n StructuredOutputMethodOptions,\n} from \"@langchain/core/language_models/base\";\nimport { type ModelProfile } from \"@langchain/core/language_models/profile\";\nimport {\n Runnable,\n RunnablePassthrough,\n RunnableSequence,\n} from \"@langchain/core/runnables\";\nimport { JsonOutputKeyToolsParser } from \"@langchain/core/output_parsers/openai_tools\";\nimport {\n BaseLLMOutputParser,\n JsonOutputParser,\n} from \"@langchain/core/output_parsers\";\nimport { AsyncCaller } from \"@langchain/core/utils/async_caller\";\nimport { concat } from \"@langchain/core/utils/stream\";\nimport {\n InteropZodType,\n isInteropZodSchema,\n} from \"@langchain/core/utils/types\";\nimport {\n GoogleAIBaseLLMInput,\n GoogleAIModelParams,\n GoogleAISafetySetting,\n GoogleConnectionParams,\n GooglePlatformType,\n GeminiTool,\n GoogleAIBaseLanguageModelCallOptions,\n GoogleAIAPI,\n GoogleAIAPIParams,\n GoogleSearchToolSetting,\n GoogleSpeechConfig,\n GeminiJsonSchema,\n} from \"./types.js\";\nimport {\n convertToGeminiTools,\n copyAIModelParams,\n copyAndValidateModelParamsInto,\n} from \"./utils/common.js\";\nimport { AbstractGoogleLLMConnection } from \"./connection.js\";\nimport { DefaultGeminiSafetyHandler, getGeminiAPI } from \"./utils/gemini.js\";\nimport { ApiKeyGoogleAuth, GoogleAbstractedClient } from \"./auth.js\";\nimport { JsonStream } from \"./utils/stream.js\";\nimport { ensureParams } from \"./utils/failed_handler.js\";\nimport type {\n GoogleBaseLLMInput,\n GoogleAISafetyHandler,\n GoogleAISafetyParams,\n GeminiFunctionDeclaration,\n GeminiFunctionSchema,\n GoogleAIToolType,\n GeminiAPIConfig,\n GoogleAIModelModality,\n} from \"./types.js\";\nimport {\n removeAdditionalProperties,\n schemaToGeminiParameters,\n} from \"./utils/zod_to_gemini_parameters.js\";\nimport PROFILES from \"./profiles.js\";\n\nexport class ChatConnection<AuthOptions> extends AbstractGoogleLLMConnection<\n BaseMessage[],\n AuthOptions\n> {\n convertSystemMessageToHumanContent: boolean | undefined;\n\n constructor(\n fields: GoogleAIBaseLLMInput<AuthOptions> | undefined,\n caller: AsyncCaller,\n client: GoogleAbstractedClient,\n streaming: boolean\n ) {\n super(fields, caller, client, streaming);\n this.convertSystemMessageToHumanContent =\n fields?.convertSystemMessageToHumanContent;\n }\n\n get useSystemInstruction(): boolean {\n return typeof this.convertSystemMessageToHumanContent === \"boolean\"\n ? !this.convertSystemMessageToHumanContent\n : this.computeUseSystemInstruction;\n }\n\n get computeUseSystemInstruction(): boolean {\n // This works on models from April 2024 and later\n // Vertex AI: gemini-1.5-pro and gemini-1.0-002 and later\n // AI Studio: gemini-1.5-pro-latest\n if (this.modelFamily === \"palm\") {\n return false;\n } else if (this.modelName === \"gemini-1.0-pro-001\") {\n return false;\n } else if (this.modelName.startsWith(\"gemini-pro-vision\")) {\n return false;\n } else if (this.modelName.startsWith(\"gemini-1.0-pro-vision\")) {\n return false;\n } else if (this.modelName === \"gemini-pro\" && this.platform === \"gai\") {\n // on AI Studio gemini-pro is still pointing at gemini-1.0-pro-001\n return false;\n } else if (this.modelFamily === \"gemma\") {\n // At least as of 12 Mar 2025 gemma 3 on AIS, trying to use system instructions yields an error:\n // \"Developer instruction is not enabled for models/gemma-3-27b-it\"\n return false;\n }\n return true;\n }\n\n computeGoogleSearchToolAdjustmentFromModel(): Exclude<\n GoogleSearchToolSetting,\n boolean\n > {\n if (this.modelName.startsWith(\"gemini-1.0\")) {\n return \"googleSearchRetrieval\";\n } else if (this.modelName.startsWith(\"gemini-1.5\")) {\n return \"googleSearchRetrieval\";\n } else {\n return \"googleSearch\";\n }\n }\n\n computeGoogleSearchToolAdjustment(\n apiConfig: GeminiAPIConfig\n ): Exclude<GoogleSearchToolSetting, true> {\n const adj = apiConfig.googleSearchToolAdjustment;\n if (adj === undefined || adj === true) {\n return this.computeGoogleSearchToolAdjustmentFromModel();\n } else {\n return adj;\n }\n }\n\n buildGeminiAPI(): GoogleAIAPI {\n const apiConfig: GeminiAPIConfig =\n (this.apiConfig as GeminiAPIConfig) ?? {};\n const googleSearchToolAdjustment =\n this.computeGoogleSearchToolAdjustment(apiConfig);\n const geminiConfig: GeminiAPIConfig = {\n useSystemInstruction: this.useSystemInstruction,\n googleSearchToolAdjustment,\n ...apiConfig,\n };\n return getGeminiAPI(geminiConfig);\n }\n\n get api(): GoogleAIAPI {\n switch (this.apiName) {\n case \"google\":\n return this.buildGeminiAPI();\n default:\n return super.api;\n }\n }\n}\n\n/**\n * Input to chat model class.\n */\nexport interface ChatGoogleBaseInput<AuthOptions>\n extends\n BaseChatModelParams,\n GoogleConnectionParams<AuthOptions>,\n GoogleAIModelParams,\n GoogleAISafetyParams,\n GoogleAIAPIParams,\n Pick<GoogleAIBaseLanguageModelCallOptions, \"streamUsage\"> {}\n\n/**\n * Integration with a Google chat model.\n */\nexport abstract class ChatGoogleBase<AuthOptions>\n extends BaseChatModel<GoogleAIBaseLanguageModelCallOptions, AIMessageChunk>\n implements ChatGoogleBaseInput<AuthOptions>\n{\n // Used for tracing, replace with the same name as your class\n static lc_name() {\n return \"ChatGoogle\";\n }\n\n get lc_secrets(): { [key: string]: string } | undefined {\n return {\n authOptions: \"GOOGLE_AUTH_OPTIONS\",\n };\n }\n\n lc_serializable = true;\n\n // Set based on modelName\n model: string;\n\n modelName = \"gemini-pro\";\n\n temperature: number;\n\n maxOutputTokens: number;\n\n maxReasoningTokens: number;\n\n topP: number;\n\n topK: number;\n\n seed: number;\n\n presencePenalty: number;\n\n frequencyPenalty: number;\n\n stopSequences: string[] = [];\n\n logprobs: boolean;\n\n topLogprobs: number = 0;\n\n safetySettings: GoogleAISafetySetting[] = [];\n\n responseModalities?: GoogleAIModelModality[];\n\n // May intentionally be undefined, meaning to compute this.\n convertSystemMessageToHumanContent: boolean | undefined;\n\n safetyHandler: GoogleAISafetyHandler;\n\n speechConfig: GoogleSpeechConfig;\n\n streamUsage = true;\n\n streaming = false;\n\n labels?: Record<string, string>;\n\n protected connection: ChatConnection<AuthOptions>;\n\n protected streamedConnection: ChatConnection<AuthOptions>;\n\n constructor(fields?: ChatGoogleBaseInput<AuthOptions>) {\n super(ensureParams(fields));\n\n copyAndValidateModelParamsInto(fields, this);\n this.safetyHandler =\n fields?.safetyHandler ?? new DefaultGeminiSafetyHandler();\n this.streamUsage = fields?.streamUsage ?? this.streamUsage;\n const client = this.buildClient(fields);\n this.buildConnection(fields ?? {}, client);\n }\n\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams {\n const params = this.invocationParams(options);\n return {\n ls_provider: \"google_vertexai\",\n ls_model_name: this.model,\n ls_model_type: \"chat\",\n ls_temperature: params.temperature ?? undefined,\n ls_max_tokens: params.maxOutputTokens ?? undefined,\n ls_stop: options.stop,\n };\n }\n\n abstract buildAbstractedClient(\n fields?: GoogleAIBaseLLMInput<AuthOptions>\n ): GoogleAbstractedClient;\n\n buildApiKeyClient(apiKey: string): GoogleAbstractedClient {\n return new ApiKeyGoogleAuth(apiKey);\n }\n\n buildApiKey(fields?: GoogleAIBaseLLMInput<AuthOptions>): string | undefined {\n return fields?.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n }\n\n buildClient(\n fields?: GoogleAIBaseLLMInput<AuthOptions>\n ): GoogleAbstractedClient {\n const apiKey = this.buildApiKey(fields);\n if (apiKey) {\n return this.buildApiKeyClient(apiKey);\n } else {\n return this.buildAbstractedClient(fields);\n }\n }\n\n buildConnection(\n fields: GoogleBaseLLMInput<AuthOptions>,\n client: GoogleAbstractedClient\n ) {\n this.connection = new ChatConnection(\n { ...fields, ...this },\n this.caller,\n client,\n false\n );\n\n this.streamedConnection = new ChatConnection(\n { ...fields, ...this },\n this.caller,\n client,\n true\n );\n }\n\n get platform(): GooglePlatformType {\n return this.connection.platform;\n }\n\n override bindTools(\n tools: GoogleAIToolType[],\n kwargs?: Partial<GoogleAIBaseLanguageModelCallOptions>\n ): Runnable<\n BaseLanguageModelInput,\n AIMessageChunk,\n GoogleAIBaseLanguageModelCallOptions\n > {\n return this.withConfig({ tools: convertToGeminiTools(tools), ...kwargs });\n }\n\n // Replace\n _llmType() {\n return \"chat_integration\";\n }\n\n /**\n * Get the parameters used to invoke the model\n */\n override invocationParams(options?: this[\"ParsedCallOptions\"]) {\n return copyAIModelParams(this, options);\n }\n\n async _generate(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager: CallbackManagerForLLMRun | undefined\n ): Promise<ChatResult> {\n options.signal?.throwIfAborted();\n const parameters = this.invocationParams(options);\n if (this.streaming) {\n const stream = this._streamResponseChunks(messages, options, runManager);\n let finalChunk: ChatGenerationChunk | null = null;\n for await (const chunk of stream) {\n finalChunk = !finalChunk ? chunk : concat(finalChunk, chunk);\n }\n if (!finalChunk) {\n throw new Error(\"No chunks were returned from the stream.\");\n }\n return {\n generations: [finalChunk],\n };\n }\n\n const response = await this.connection.request(\n messages,\n parameters,\n options,\n runManager\n );\n const ret = this.connection.api.responseToChatResult(response);\n const chunk = ret?.generations?.[0];\n if (chunk) {\n await runManager?.handleLLMNewToken(chunk.text || \"\");\n }\n return ret;\n }\n\n async *_streamResponseChunks(\n _messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager?: CallbackManagerForLLMRun\n ): AsyncGenerator<ChatGenerationChunk> {\n // Make the call as a streaming request\n const parameters = this.invocationParams(options);\n const response = await this.streamedConnection.request(\n _messages,\n parameters,\n options,\n runManager\n );\n\n // Get the streaming parser of the response\n const stream = response.data as JsonStream;\n let usageMetadata: UsageMetadata | undefined;\n // Loop until the end of the stream\n // During the loop, yield each time we get a chunk from the streaming parser\n // that is either available or added to the queue\n while (!stream.streamDone) {\n if (options.signal?.aborted) {\n return;\n }\n const output = await stream.nextChunk();\n await runManager?.handleCustomEvent(\n `google-chunk-${this.constructor.name}`,\n {\n output,\n }\n );\n if (\n output &&\n output.usageMetadata &&\n this.streamUsage !== false &&\n options.streamUsage !== false\n ) {\n usageMetadata = {\n input_tokens: output.usageMetadata.promptTokenCount,\n output_tokens: output.usageMetadata.candidatesTokenCount,\n total_tokens: output.usageMetadata.totalTokenCount,\n };\n }\n const chunk =\n output !== null\n ? this.connection.api.responseToChatGeneration({ data: output })\n : new ChatGenerationChunk({\n text: \"\",\n generationInfo: { finishReason: \"stop\" },\n message: new AIMessageChunk({\n content: \"\",\n usage_metadata: usageMetadata,\n }),\n });\n if (chunk) {\n yield chunk;\n await runManager?.handleLLMNewToken(\n chunk.text ?? \"\",\n undefined,\n undefined,\n undefined,\n undefined,\n { chunk }\n );\n }\n }\n }\n\n /** @ignore */\n _combineLLMOutput() {\n return [];\n }\n\n /**\n * Return profiling information for the model.\n *\n * Provides information about the model's capabilities and constraints,\n * including token limits, multimodal support, and advanced features like\n * tool calling and structured output.\n *\n * @returns {ModelProfile} An object describing the model's capabilities and constraints\n */\n get profile(): ModelProfile {\n return PROFILES[this.model] ?? {};\n }\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<false>\n ): Runnable<BaseLanguageModelInput, RunOutput>;\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const schema: InteropZodType<RunOutput> | Record<string, any> =\n outputSchema;\n const name = config?.name;\n const method = config?.method;\n const includeRaw = config?.includeRaw;\n if (method === \"jsonMode\") {\n throw new Error(\n `Google only supports \"jsonSchema\" or \"functionCalling\" as a method.`\n );\n }\n\n let llm;\n let outputParser: BaseLLMOutputParser<RunOutput>;\n if (method === \"functionCalling\") {\n let functionName = name ?? \"extract\";\n let tools: GeminiTool[];\n if (isInteropZodSchema(schema)) {\n const jsonSchema = schemaToGeminiParameters(schema);\n tools = [\n {\n functionDeclarations: [\n {\n name: functionName,\n description:\n jsonSchema.description ?? \"A function available to call.\",\n parameters: jsonSchema as GeminiFunctionSchema,\n },\n ],\n },\n ];\n outputParser = new JsonOutputKeyToolsParser({\n returnSingle: true,\n keyName: functionName,\n zodSchema: schema,\n });\n } else {\n let geminiFunctionDefinition: GeminiFunctionDeclaration;\n if (\n typeof schema.name === \"string\" &&\n typeof schema.parameters === \"object\" &&\n schema.parameters != null\n ) {\n geminiFunctionDefinition = schema as GeminiFunctionDeclaration;\n functionName = schema.name;\n } else {\n // We are providing the schema for *just* the parameters, probably\n const parameters: GeminiJsonSchema =\n removeAdditionalProperties(schema);\n geminiFunctionDefinition = {\n name: functionName,\n description: schema.description ?? \"\",\n parameters,\n };\n }\n tools = [\n {\n functionDeclarations: [geminiFunctionDefinition],\n },\n ];\n outputParser = new JsonOutputKeyToolsParser<RunOutput>({\n returnSingle: true,\n keyName: functionName,\n });\n }\n llm = this.bindTools(tools).withConfig({ tool_choice: functionName });\n } else {\n // Default to jsonSchema method\n const jsonSchema = schemaToGeminiParameters(schema);\n llm = this.withConfig({\n responseSchema: jsonSchema as GeminiJsonSchema,\n });\n outputParser = new JsonOutputParser();\n }\n\n if (!includeRaw) {\n return llm.pipe(outputParser).withConfig({\n runName: \"ChatGoogleStructuredOutput\",\n }) as Runnable<BaseLanguageModelInput, RunOutput>;\n }\n\n const parserAssign = RunnablePassthrough.assign({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsed: (input: any, config) => outputParser.invoke(input.raw, config),\n });\n const parserNone = RunnablePassthrough.assign({\n parsed: () => null,\n });\n const parsedWithFallback = parserAssign.withFallbacks({\n fallbacks: [parserNone],\n });\n return RunnableSequence.from<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n >([\n {\n raw: llm,\n },\n parsedWithFallback,\n ]).withConfig({\n runName: \"StructuredOutputRunnable\",\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwEA,IAAa,iBAAb,cAAiD,4BAG/C;CACA;CAEA,YACEA,QACAC,QACAC,QACAC,WACA;EACA,MAAM,QAAQ,QAAQ,QAAQ,UAAU;EACxC,KAAK,qCACH,QAAQ;CACX;CAED,IAAI,uBAAgC;AAClC,SAAO,OAAO,KAAK,uCAAuC,YACtD,CAAC,KAAK,qCACN,KAAK;CACV;CAED,IAAI,8BAAuC;AAIzC,MAAI,KAAK,gBAAgB,OACvB,QAAO;WACE,KAAK,cAAc,qBAC5B,QAAO;WACE,KAAK,UAAU,WAAW,oBAAoB,CACvD,QAAO;WACE,KAAK,UAAU,WAAW,wBAAwB,CAC3D,QAAO;WACE,KAAK,cAAc,gBAAgB,KAAK,aAAa,MAE9D,QAAO;WACE,KAAK,gBAAgB,QAG9B,QAAO;AAET,SAAO;CACR;CAED,6CAGE;AACA,MAAI,KAAK,UAAU,WAAW,aA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,SAAO,iBAAiB,KAGtB,CACA,EACE,KAAK,IACN,GACD,kBACD,EAAC,CAAC,WAAW,EACZ,SAAS,2BACV,EAAC;CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"chat_models.js","names":["fields: GoogleAIBaseLLMInput<AuthOptions> | undefined","caller: AsyncCaller","client: GoogleAbstractedClient","streaming: boolean","apiConfig: GeminiAPIConfig","geminiConfig: GeminiAPIConfig","fields?: ChatGoogleBaseInput<AuthOptions>","options: this[\"ParsedCallOptions\"]","apiKey: string","fields?: GoogleAIBaseLLMInput<AuthOptions>","fields: GoogleBaseLLMInput<AuthOptions>","tools: GoogleAIToolType[]","kwargs?: Partial<GoogleAIBaseLanguageModelCallOptions>","options?: this[\"ParsedCallOptions\"]","messages: BaseMessage[]","runManager: CallbackManagerForLLMRun | undefined","finalChunk: ChatGenerationChunk | null","chunk","_messages: BaseMessage[]","runManager?: CallbackManagerForLLMRun","usageMetadata: UsageMetadata | undefined","PROFILES","outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>","config?: StructuredOutputMethodOptions<boolean>","schema: InteropZodType<RunOutput> | Record<string, any>","outputParser: BaseLLMOutputParser<RunOutput>","tools: GeminiTool[]","geminiFunctionDefinition: GeminiFunctionDeclaration","parameters: GeminiJsonSchema","input: any","config"],"sources":["../src/chat_models.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { UsageMetadata, type BaseMessage } from \"@langchain/core/messages\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\n\nimport {\n BaseChatModel,\n LangSmithParams,\n type BaseChatModelParams,\n} from \"@langchain/core/language_models/chat_models\";\nimport { ChatGenerationChunk, ChatResult } from \"@langchain/core/outputs\";\nimport { AIMessageChunk } from \"@langchain/core/messages\";\nimport {\n BaseLanguageModelInput,\n StructuredOutputMethodOptions,\n} from \"@langchain/core/language_models/base\";\nimport { type ModelProfile } from \"@langchain/core/language_models/profile\";\nimport {\n Runnable,\n RunnablePassthrough,\n RunnableSequence,\n} from \"@langchain/core/runnables\";\nimport { JsonOutputKeyToolsParser } from \"@langchain/core/output_parsers/openai_tools\";\nimport {\n BaseLLMOutputParser,\n JsonOutputParser,\n} from \"@langchain/core/output_parsers\";\nimport { AsyncCaller } from \"@langchain/core/utils/async_caller\";\nimport { concat } from \"@langchain/core/utils/stream\";\nimport {\n InteropZodType,\n isInteropZodSchema,\n} from \"@langchain/core/utils/types\";\nimport {\n GoogleAIBaseLLMInput,\n GoogleAIModelParams,\n GoogleAISafetySetting,\n GoogleConnectionParams,\n GooglePlatformType,\n GeminiTool,\n GoogleAIBaseLanguageModelCallOptions,\n GoogleAIAPI,\n GoogleAIAPIParams,\n GoogleSearchToolSetting,\n GoogleSpeechConfig,\n GeminiJsonSchema,\n} from \"./types.js\";\nimport {\n convertToGeminiTools,\n copyAIModelParams,\n copyAndValidateModelParamsInto,\n} from \"./utils/common.js\";\nimport { AbstractGoogleLLMConnection } from \"./connection.js\";\nimport { DefaultGeminiSafetyHandler, getGeminiAPI } from \"./utils/gemini.js\";\nimport { ApiKeyGoogleAuth, GoogleAbstractedClient } from \"./auth.js\";\nimport { JsonStream } from \"./utils/stream.js\";\nimport { ensureParams } from \"./utils/failed_handler.js\";\nimport type {\n GoogleBaseLLMInput,\n GoogleAISafetyHandler,\n GoogleAISafetyParams,\n GeminiFunctionDeclaration,\n GeminiFunctionSchema,\n GoogleAIToolType,\n GeminiAPIConfig,\n GoogleAIModelModality,\n} from \"./types.js\";\nimport {\n removeAdditionalProperties,\n schemaToGeminiParameters,\n} from \"./utils/zod_to_gemini_parameters.js\";\nimport PROFILES from \"./profiles.js\";\n\nexport class ChatConnection<AuthOptions> extends AbstractGoogleLLMConnection<\n BaseMessage[],\n AuthOptions\n> {\n convertSystemMessageToHumanContent: boolean | undefined;\n\n constructor(\n fields: GoogleAIBaseLLMInput<AuthOptions> | undefined,\n caller: AsyncCaller,\n client: GoogleAbstractedClient,\n streaming: boolean\n ) {\n super(fields, caller, client, streaming);\n this.convertSystemMessageToHumanContent =\n fields?.convertSystemMessageToHumanContent;\n }\n\n get useSystemInstruction(): boolean {\n return typeof this.convertSystemMessageToHumanContent === \"boolean\"\n ? !this.convertSystemMessageToHumanContent\n : this.computeUseSystemInstruction;\n }\n\n get computeUseSystemInstruction(): boolean {\n // This works on models from April 2024 and later\n // Vertex AI: gemini-1.5-pro and gemini-1.0-002 and later\n // AI Studio: gemini-1.5-pro-latest\n if (this.modelFamily === \"palm\") {\n return false;\n } else if (this.modelName === \"gemini-1.0-pro-001\") {\n return false;\n } else if (this.modelName.startsWith(\"gemini-pro-vision\")) {\n return false;\n } else if (this.modelName.startsWith(\"gemini-1.0-pro-vision\")) {\n return false;\n } else if (this.modelName === \"gemini-pro\" && this.platform === \"gai\") {\n // on AI Studio gemini-pro is still pointing at gemini-1.0-pro-001\n return false;\n } else if (this.modelFamily === \"gemma\") {\n // At least as of 12 Mar 2025 gemma 3 on AIS, trying to use system instructions yields an error:\n // \"Developer instruction is not enabled for models/gemma-3-27b-it\"\n return false;\n }\n return true;\n }\n\n computeGoogleSearchToolAdjustmentFromModel(): Exclude<\n GoogleSearchToolSetting,\n boolean\n > {\n if (this.modelName.startsWith(\"gemini-1.0\")) {\n return \"googleSearchRetrieval\";\n } else if (this.modelName.startsWith(\"gemini-1.5\")) {\n return \"googleSearchRetrieval\";\n } else {\n return \"googleSearch\";\n }\n }\n\n computeGoogleSearchToolAdjustment(\n apiConfig: GeminiAPIConfig\n ): Exclude<GoogleSearchToolSetting, true> {\n const adj = apiConfig.googleSearchToolAdjustment;\n if (adj === undefined || adj === true) {\n return this.computeGoogleSearchToolAdjustmentFromModel();\n } else {\n return adj;\n }\n }\n\n buildGeminiAPI(): GoogleAIAPI {\n const apiConfig: GeminiAPIConfig =\n (this.apiConfig as GeminiAPIConfig) ?? {};\n const googleSearchToolAdjustment =\n this.computeGoogleSearchToolAdjustment(apiConfig);\n const geminiConfig: GeminiAPIConfig = {\n useSystemInstruction: this.useSystemInstruction,\n googleSearchToolAdjustment,\n ...apiConfig,\n };\n return getGeminiAPI(geminiConfig);\n }\n\n get api(): GoogleAIAPI {\n switch (this.apiName) {\n case \"google\":\n return this.buildGeminiAPI();\n default:\n return super.api;\n }\n }\n}\n\n/**\n * Input to chat model class.\n */\nexport interface ChatGoogleBaseInput<AuthOptions>\n extends\n BaseChatModelParams,\n GoogleConnectionParams<AuthOptions>,\n GoogleAIModelParams,\n GoogleAISafetyParams,\n GoogleAIAPIParams,\n Pick<GoogleAIBaseLanguageModelCallOptions, \"streamUsage\"> {}\n\n/**\n * Integration with a Google chat model.\n */\nexport abstract class ChatGoogleBase<AuthOptions>\n extends BaseChatModel<GoogleAIBaseLanguageModelCallOptions, AIMessageChunk>\n implements ChatGoogleBaseInput<AuthOptions>\n{\n // Used for tracing, replace with the same name as your class\n static lc_name() {\n return \"ChatGoogle\";\n }\n\n get lc_secrets(): { [key: string]: string } | undefined {\n return {\n authOptions: \"GOOGLE_AUTH_OPTIONS\",\n };\n }\n\n lc_serializable = true;\n\n // Set based on modelName\n model: string;\n\n modelName = \"gemini-pro\";\n\n temperature: number;\n\n maxOutputTokens: number;\n\n maxReasoningTokens: number;\n\n topP: number;\n\n topK: number;\n\n seed: number;\n\n presencePenalty: number;\n\n frequencyPenalty: number;\n\n stopSequences: string[] = [];\n\n logprobs: boolean;\n\n topLogprobs: number = 0;\n\n safetySettings: GoogleAISafetySetting[] = [];\n\n responseModalities?: GoogleAIModelModality[];\n\n // May intentionally be undefined, meaning to compute this.\n convertSystemMessageToHumanContent: boolean | undefined;\n\n safetyHandler: GoogleAISafetyHandler;\n\n speechConfig: GoogleSpeechConfig;\n\n streamUsage = true;\n\n streaming = false;\n\n labels?: Record<string, string>;\n\n protected connection: ChatConnection<AuthOptions>;\n\n protected streamedConnection: ChatConnection<AuthOptions>;\n\n constructor(fields?: ChatGoogleBaseInput<AuthOptions>) {\n super(ensureParams(fields));\n\n copyAndValidateModelParamsInto(fields, this);\n this.safetyHandler =\n fields?.safetyHandler ?? new DefaultGeminiSafetyHandler();\n this.streamUsage = fields?.streamUsage ?? this.streamUsage;\n const client = this.buildClient(fields);\n this.buildConnection(fields ?? {}, client);\n }\n\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams {\n const params = this.invocationParams(options);\n return {\n ls_provider: \"google_vertexai\",\n ls_model_name: this.model,\n ls_model_type: \"chat\",\n ls_temperature: params.temperature ?? undefined,\n ls_max_tokens: params.maxOutputTokens ?? undefined,\n ls_stop: options.stop,\n };\n }\n\n abstract buildAbstractedClient(\n fields?: GoogleAIBaseLLMInput<AuthOptions>\n ): GoogleAbstractedClient;\n\n buildApiKeyClient(apiKey: string): GoogleAbstractedClient {\n return new ApiKeyGoogleAuth(apiKey);\n }\n\n buildApiKey(fields?: GoogleAIBaseLLMInput<AuthOptions>): string | undefined {\n return fields?.apiKey ?? getEnvironmentVariable(\"GOOGLE_API_KEY\");\n }\n\n buildClient(\n fields?: GoogleAIBaseLLMInput<AuthOptions>\n ): GoogleAbstractedClient {\n const apiKey = this.buildApiKey(fields);\n if (apiKey) {\n return this.buildApiKeyClient(apiKey);\n } else {\n return this.buildAbstractedClient(fields);\n }\n }\n\n buildConnection(\n fields: GoogleBaseLLMInput<AuthOptions>,\n client: GoogleAbstractedClient\n ) {\n this.connection = new ChatConnection(\n { ...fields, ...this },\n this.caller,\n client,\n false\n );\n\n this.streamedConnection = new ChatConnection(\n { ...fields, ...this },\n this.caller,\n client,\n true\n );\n }\n\n get platform(): GooglePlatformType {\n return this.connection.platform;\n }\n\n override bindTools(\n tools: GoogleAIToolType[],\n kwargs?: Partial<GoogleAIBaseLanguageModelCallOptions>\n ): Runnable<\n BaseLanguageModelInput,\n AIMessageChunk,\n GoogleAIBaseLanguageModelCallOptions\n > {\n return this.withConfig({ tools: convertToGeminiTools(tools), ...kwargs });\n }\n\n _llmType() {\n return \"google\";\n }\n\n /**\n * Get the parameters used to invoke the model\n */\n override invocationParams(options?: this[\"ParsedCallOptions\"]) {\n return copyAIModelParams(this, options);\n }\n\n async _generate(\n messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager: CallbackManagerForLLMRun | undefined\n ): Promise<ChatResult> {\n options.signal?.throwIfAborted();\n const parameters = this.invocationParams(options);\n if (this.streaming) {\n const stream = this._streamResponseChunks(messages, options, runManager);\n let finalChunk: ChatGenerationChunk | null = null;\n for await (const chunk of stream) {\n finalChunk = !finalChunk ? chunk : concat(finalChunk, chunk);\n }\n if (!finalChunk) {\n throw new Error(\"No chunks were returned from the stream.\");\n }\n return {\n generations: [finalChunk],\n };\n }\n\n const response = await this.connection.request(\n messages,\n parameters,\n options,\n runManager\n );\n const ret = this.connection.api.responseToChatResult(response);\n const chunk = ret?.generations?.[0];\n if (chunk) {\n await runManager?.handleLLMNewToken(chunk.text || \"\");\n }\n return ret;\n }\n\n async *_streamResponseChunks(\n _messages: BaseMessage[],\n options: this[\"ParsedCallOptions\"],\n runManager?: CallbackManagerForLLMRun\n ): AsyncGenerator<ChatGenerationChunk> {\n // Make the call as a streaming request\n const parameters = this.invocationParams(options);\n const response = await this.streamedConnection.request(\n _messages,\n parameters,\n options,\n runManager\n );\n\n // Get the streaming parser of the response\n const stream = response.data as JsonStream;\n let usageMetadata: UsageMetadata | undefined;\n // Loop until the end of the stream\n // During the loop, yield each time we get a chunk from the streaming parser\n // that is either available or added to the queue\n while (!stream.streamDone) {\n if (options.signal?.aborted) {\n return;\n }\n const output = await stream.nextChunk();\n await runManager?.handleCustomEvent(\n `google-chunk-${this.constructor.name}`,\n {\n output,\n }\n );\n if (\n output &&\n output.usageMetadata &&\n this.streamUsage !== false &&\n options.streamUsage !== false\n ) {\n usageMetadata = {\n input_tokens: output.usageMetadata.promptTokenCount,\n output_tokens: output.usageMetadata.candidatesTokenCount,\n total_tokens: output.usageMetadata.totalTokenCount,\n };\n }\n const chunk =\n output !== null\n ? this.connection.api.responseToChatGeneration({ data: output })\n : new ChatGenerationChunk({\n text: \"\",\n generationInfo: { finishReason: \"stop\" },\n message: new AIMessageChunk({\n content: \"\",\n usage_metadata: usageMetadata,\n }),\n });\n if (chunk) {\n yield chunk;\n await runManager?.handleLLMNewToken(\n chunk.text ?? \"\",\n undefined,\n undefined,\n undefined,\n undefined,\n { chunk }\n );\n }\n }\n }\n\n /** @ignore */\n _combineLLMOutput() {\n return [];\n }\n\n /**\n * Return profiling information for the model.\n *\n * Provides information about the model's capabilities and constraints,\n * including token limits, multimodal support, and advanced features like\n * tool calling and structured output.\n *\n * @returns {ModelProfile} An object describing the model's capabilities and constraints\n */\n get profile(): ModelProfile {\n return PROFILES[this.model] ?? {};\n }\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<false>\n ): Runnable<BaseLanguageModelInput, RunOutput>;\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const schema: InteropZodType<RunOutput> | Record<string, any> =\n outputSchema;\n const name = config?.name;\n const method = config?.method;\n const includeRaw = config?.includeRaw;\n if (method === \"jsonMode\") {\n throw new Error(\n `Google only supports \"jsonSchema\" or \"functionCalling\" as a method.`\n );\n }\n\n let llm;\n let outputParser: BaseLLMOutputParser<RunOutput>;\n if (method === \"functionCalling\") {\n let functionName = name ?? \"extract\";\n let tools: GeminiTool[];\n if (isInteropZodSchema(schema)) {\n const jsonSchema = schemaToGeminiParameters(schema);\n tools = [\n {\n functionDeclarations: [\n {\n name: functionName,\n description:\n jsonSchema.description ?? \"A function available to call.\",\n parameters: jsonSchema as GeminiFunctionSchema,\n },\n ],\n },\n ];\n outputParser = new JsonOutputKeyToolsParser({\n returnSingle: true,\n keyName: functionName,\n zodSchema: schema,\n });\n } else {\n let geminiFunctionDefinition: GeminiFunctionDeclaration;\n if (\n typeof schema.name === \"string\" &&\n typeof schema.parameters === \"object\" &&\n schema.parameters != null\n ) {\n geminiFunctionDefinition = schema as GeminiFunctionDeclaration;\n functionName = schema.name;\n } else {\n // We are providing the schema for *just* the parameters, probably\n const parameters: GeminiJsonSchema =\n removeAdditionalProperties(schema);\n geminiFunctionDefinition = {\n name: functionName,\n description: schema.description ?? \"\",\n parameters,\n };\n }\n tools = [\n {\n functionDeclarations: [geminiFunctionDefinition],\n },\n ];\n outputParser = new JsonOutputKeyToolsParser<RunOutput>({\n returnSingle: true,\n keyName: functionName,\n });\n }\n llm = this.bindTools(tools).withConfig({ tool_choice: functionName });\n } else {\n // Default to jsonSchema method\n const jsonSchema = schemaToGeminiParameters(schema);\n llm = this.withConfig({\n responseSchema: jsonSchema as GeminiJsonSchema,\n });\n outputParser = new JsonOutputParser();\n }\n\n if (!includeRaw) {\n return llm.pipe(outputParser).withConfig({\n runName: \"ChatGoogleStructuredOutput\",\n }) as Runnable<BaseLanguageModelInput, RunOutput>;\n }\n\n const parserAssign = RunnablePassthrough.assign({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsed: (input: any, config) => outputParser.invoke(input.raw, config),\n });\n const parserNone = RunnablePassthrough.assign({\n parsed: () => null,\n });\n const parsedWithFallback = parserAssign.withFallbacks({\n fallbacks: [parserNone],\n });\n return RunnableSequence.from<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n >([\n {\n raw: llm,\n },\n parsedWithFallback,\n ]).withConfig({\n runName: \"StructuredOutputRunnable\",\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwEA,IAAa,iBAAb,cAAiD,4BAG/C;CACA;CAEA,YACEA,QACAC,QACAC,QACAC,WACA;EACA,MAAM,QAAQ,QAAQ,QAAQ,UAAU;EACxC,KAAK,qCACH,QAAQ;CACX;CAED,IAAI,uBAAgC;AAClC,SAAO,OAAO,KAAK,uCAAuC,YACtD,CAAC,KAAK,qCACN,KAAK;CACV;CAED,IAAI,8BAAuC;AAIzC,MAAI,KAAK,gBAAgB,OACvB,QAAO;WACE,KAAK,cAAc,qBAC5B,QAAO;WACE,KAAK,UAAU,WAAW,oBAAoB,CACvD,QAAO;WACE,KAAK,UAAU,WAAW,wBAAwB,CAC3D,QAAO;WACE,KAAK,cAAc,gBAAgB,KAAK,aAAa,MAE9D,QAAO;WACE,KAAK,gBAAgB,QAG9B,QAAO;AAET,SAAO;CACR;CAED,6CAGE;AACA,MAAI,KAAK,UAAU,WAAW,aAAa,CACzC,QAAO;WACE,KAAK,UAAU,WAAW,aAAa,CAChD,QAAO;MAEP,QAAO;CAEV;CAED,kCACEC,WACwC;EACxC,MAAM,MAAM,UAAU;AACtB,MAAI,QAAQ,UAAa,QAAQ,KAC/B,QAAO,KAAK,4CAA4C;MAExD,QAAO;CAEV;CAED,iBAA8B;EAC5B,MAAMA,YACH,KAAK,aAAiC,CAAE;EAC3C,MAAM,6BACJ,KAAK,kCAAkC,UAAU;EACnD,MAAMC,eAAgC;GACpC,sBAAsB,KAAK;GAC3B;GACA,GAAG;EACJ;AACD,SAAO,aAAa,aAAa;CAClC;CAED,IA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ACJ,QACE,OAAO,OAAO,SAAS,YACvB,OAAO,OAAO,eAAe,YAC7B,OAAO,cAAc,MACrB;KACA,2BAA2B;KAC3B,eAAe,OAAO;IACvB,OAAM;KAEL,MAAMC,aACJ,2BAA2B,OAAO;KACpC,2BAA2B;MACzB,MAAM;MACN,aAAa,OAAO,eAAe;MACnC;KACD;IACF;IACD,QAAQ,CACN,EACE,sBAAsB,CAAC,wBAAyB,EACjD,CACF;IACD,eAAe,IAAI,yBAAoC;KACrD,cAAc;KACd,SAAS;IACV;GACF;GACD,MAAM,KAAK,UAAU,MAAM,CAAC,WAAW,EAAE,aAAa,aAAc,EAAC;EACtE,OAAM;GAEL,MAAM,aAAa,yBAAyB,OAAO;GACnD,MAAM,KAAK,WAAW,EACpB,gBAAgB,WACjB,EAAC;GACF,eAAe,IAAI;EACpB;AAED,MAAI,CAAC,WACH,QAAO,IAAI,KAAK,aAAa,CAAC,WAAW,EACvC,SAAS,6BACV,EAAC;EAGJ,MAAM,eAAe,oBAAoB,OAAO,EAE9C,QAAQ,CAACC,OAAYC,aAAW,aAAa,OAAO,MAAM,KAAKA,SAAO,CACvE,EAAC;EACF,MAAM,aAAa,oBAAoB,OAAO,EAC5C,QAAQ,MAAM,KACf,EAAC;EACF,MAAM,qBAAqB,aAAa,cAAc,EACpD,WAAW,CAAC,UAAW,EACxB,EAAC;AACF,SAAO,iBAAiB,KAGtB,CACA,EACE,KAAK,IACN,GACD,kBACD,EAAC,CAAC,WAAW,EACZ,SAAS,2BACV,EAAC;CACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.cts","names":["AsyncCaller","AsyncCallerCallOptions","AsyncCallerParams","MediaBlob","BlobStore","BlobStoreOptions","GoogleConnectionParams","GoogleRawResponse","GoogleResponse","GoogleHostConnection","GoogleRawConnection","GoogleAbstractedClient","GoogleAbstractedClientOpsMethod","GoogleUploadConnectionParams","AuthOptions","GoogleMultipartUploadConnection","CallOptions","ResponseType","Record","Promise","GoogleDownloadConnection","GoogleDownloadRawConnection","BlobStoreGoogleParams","BlobStoreGoogle","Blob","AsyncGenerator","GoogleCloudStorageObject","GoogleCloudStorageResponse","BucketAndPath","GoogleCloudStorageUri","RegExp","GoogleCloudStorageConnectionParams","GoogleCloudStorageUploadConnectionParams","GoogleCloudStorageUploadConnection","GoogleCloudStorageDownloadConnectionParams","GoogleCloudStorageDownloadConnection","GoogleCloudStorageRawConnectionParams","GoogleCloudStorageRawConnection","BlobStoreGoogleCloudStorageBaseParams","BlobStoreGoogleCloudStorageBase","AIStudioFileState","AIStudioFileVideoMetadata","AIStudioFileMetadata","AIStudioFileObject","AIStudioMediaBlob","Date","AIStudioFileGetResponse","AIStudioFileSaveResponse","AIStudioFileListResponse","AIStudioFileResponse","AIStudioFileConnectionParams","AIStudioFileUploadConnectionParams","AIStudioFileUploadConnection","AIStudioFileDownloadConnectionParams","AIStudioFileDownloadConnection","BlobStoreAIStudioFileBaseParams","BlobStoreAIStudioFileBase"],"sources":["../../src/experimental/media.d.ts"],"sourcesContent":["import { AsyncCaller, AsyncCallerCallOptions, AsyncCallerParams } from \"@langchain/core/utils/async_caller\";\nimport { MediaBlob, BlobStore, BlobStoreOptions } from \"./utils/media_core.js\";\nimport { GoogleConnectionParams, GoogleRawResponse, GoogleResponse } from \"../types.js\";\nimport { GoogleHostConnection, GoogleRawConnection } from \"../connection.js\";\nimport { GoogleAbstractedClient, GoogleAbstractedClientOpsMethod } from \"../auth.js\";\nexport interface GoogleUploadConnectionParams<AuthOptions> extends GoogleConnectionParams<AuthOptions> {\n}\nexport declare abstract class GoogleMultipartUploadConnection<CallOptions extends AsyncCallerCallOptions, ResponseType extends GoogleResponse, AuthOptions> extends GoogleHostConnection<CallOptions, ResponseType, AuthOptions> {\n constructor(fields: GoogleConnectionParams<AuthOptions> | undefined, caller: AsyncCaller, client: GoogleAbstractedClient);\n _body(separator: string, data: MediaBlob, metadata: Record<string, unknown>): Promise<string>;\n request(data: MediaBlob, metadata: Record<string, unknown>, options: CallOptions): Promise<ResponseType>;\n}\nexport declare abstract class GoogleDownloadConnection<CallOptions extends AsyncCallerCallOptions, ResponseType extends GoogleResponse, AuthOptions> extends GoogleHostConnection<CallOptions, ResponseType, AuthOptions> {\n request(options: CallOptions): Promise<ResponseType>;\n}\nexport declare abstract class GoogleDownloadRawConnection<CallOptions extends AsyncCallerCallOptions, AuthOptions> extends GoogleRawConnection<CallOptions, AuthOptions> {\n buildMethod(): GoogleAbstractedClientOpsMethod;\n request(options: CallOptions): Promise<GoogleRawResponse>;\n}\nexport interface BlobStoreGoogleParams<AuthOptions> extends GoogleConnectionParams<AuthOptions>, AsyncCallerParams, BlobStoreOptions {\n}\nexport declare abstract class BlobStoreGoogle<ResponseType extends GoogleResponse, AuthOptions> extends BlobStore {\n caller: AsyncCaller;\n client: GoogleAbstractedClient;\n constructor(fields?: BlobStoreGoogleParams<AuthOptions>);\n abstract buildClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n abstract buildSetMetadata([key, blob]: [string, MediaBlob]): Record<string, unknown>;\n abstract buildSetConnection([key, blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions>;\n _set(keyValuePair: [string, MediaBlob]): Promise<ResponseType>;\n mset(keyValuePairs: [string, MediaBlob][]): Promise<void>;\n abstract buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions>;\n _getMetadata(key: string): Promise<Record<string, unknown>>;\n abstract buildGetDataConnection(key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n _getData(key: string): Promise<Blob>;\n _getMimetypeFromMetadata(metadata: Record<string, unknown>): string;\n _get(key: string): Promise<MediaBlob | undefined>;\n mget(keys: string[]): Promise<(MediaBlob | undefined)[]>;\n abstract buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleResponse, AuthOptions>;\n _del(key: string): Promise<void>;\n mdelete(keys: string[]): Promise<void>;\n yieldKeys(_prefix: string | undefined): AsyncGenerator<string>;\n}\n/**\n * Based on https://cloud.google.com/storage/docs/json_api/v1/objects#resource\n */\nexport interface GoogleCloudStorageObject extends Record<string, unknown> {\n id?: string;\n name?: string;\n contentType?: string;\n metadata?: Record<string, unknown>;\n}\nexport interface GoogleCloudStorageResponse extends GoogleResponse {\n data: GoogleCloudStorageObject;\n}\nexport type BucketAndPath = {\n bucket: string;\n path: string;\n};\nexport declare class GoogleCloudStorageUri {\n static uriRegexp: RegExp;\n bucket: string;\n path: string;\n constructor(uri: string);\n get uri(): string;\n get isValid(): boolean;\n static uriToBucketAndPath(uri: string): BucketAndPath;\n static isValidUri(uri: string): boolean;\n}\nexport interface GoogleCloudStorageConnectionParams {\n uri: string;\n}\nexport interface GoogleCloudStorageUploadConnectionParams<AuthOptions> extends GoogleUploadConnectionParams<AuthOptions>, GoogleCloudStorageConnectionParams {\n}\nexport declare class GoogleCloudStorageUploadConnection<AuthOptions> extends GoogleMultipartUploadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions> {\n uri: GoogleCloudStorageUri;\n constructor(fields: GoogleCloudStorageUploadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildUrl(): Promise<string>;\n}\nexport interface GoogleCloudStorageDownloadConnectionParams<AuthOptions> extends GoogleCloudStorageConnectionParams, GoogleConnectionParams<AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n alt: \"media\" | undefined;\n}\nexport declare class GoogleCloudStorageDownloadConnection<ResponseType extends GoogleResponse, AuthOptions> extends GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions> {\n uri: GoogleCloudStorageUri;\n method: GoogleAbstractedClientOpsMethod;\n alt: \"media\" | undefined;\n constructor(fields: GoogleCloudStorageDownloadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildMethod(): GoogleAbstractedClientOpsMethod;\n buildUrl(): Promise<string>;\n}\nexport interface GoogleCloudStorageRawConnectionParams<AuthOptions> extends GoogleCloudStorageConnectionParams, GoogleConnectionParams<AuthOptions> {\n}\nexport declare class GoogleCloudStorageRawConnection<AuthOptions> extends GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions> {\n uri: GoogleCloudStorageUri;\n constructor(fields: GoogleCloudStorageRawConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildUrl(): Promise<string>;\n}\nexport interface BlobStoreGoogleCloudStorageBaseParams<AuthOptions> extends BlobStoreGoogleParams<AuthOptions> {\n uriPrefix: GoogleCloudStorageUri;\n}\nexport declare abstract class BlobStoreGoogleCloudStorageBase<AuthOptions> extends BlobStoreGoogle<GoogleCloudStorageResponse, AuthOptions> {\n params: BlobStoreGoogleCloudStorageBaseParams<AuthOptions>;\n constructor(fields: BlobStoreGoogleCloudStorageBaseParams<AuthOptions>);\n buildSetConnection([key, _blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions>;\n buildSetMetadata([key, blob]: [string, MediaBlob]): Record<string, unknown>;\n buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions>;\n buildGetDataConnection(key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleResponse, AuthOptions>;\n}\nexport type AIStudioFileState = \"PROCESSING\" | \"ACTIVE\" | \"FAILED\" | \"STATE_UNSPECIFIED\";\nexport type AIStudioFileVideoMetadata = {\n videoMetadata: {\n videoDuration: string;\n };\n};\nexport type AIStudioFileMetadata = AIStudioFileVideoMetadata;\nexport interface AIStudioFileObject {\n name?: string;\n displayName?: string;\n mimeType?: string;\n sizeBytes?: string;\n createTime?: string;\n updateTime?: string;\n expirationTime?: string;\n sha256Hash?: string;\n uri?: string;\n state?: AIStudioFileState;\n error?: {\n code: number;\n message: string;\n details: Record<string, unknown>[];\n };\n metadata?: AIStudioFileMetadata;\n}\nexport declare class AIStudioMediaBlob extends MediaBlob {\n _valueAsDate(value: string): Date;\n _metadataFieldAsDate(field: string): Date;\n get createDate(): Date;\n get updateDate(): Date;\n get expirationDate(): Date;\n get isExpired(): boolean;\n}\nexport interface AIStudioFileGetResponse extends GoogleResponse {\n data: AIStudioFileObject;\n}\nexport interface AIStudioFileSaveResponse extends GoogleResponse {\n data: {\n file: AIStudioFileObject;\n };\n}\nexport interface AIStudioFileListResponse extends GoogleResponse {\n data: {\n files: AIStudioFileObject[];\n nextPageToken: string;\n };\n}\nexport type AIStudioFileResponse = AIStudioFileGetResponse | AIStudioFileSaveResponse | AIStudioFileListResponse;\nexport interface AIStudioFileConnectionParams {\n}\nexport interface AIStudioFileUploadConnectionParams<AuthOptions> extends GoogleUploadConnectionParams<AuthOptions>, AIStudioFileConnectionParams {\n}\nexport declare class AIStudioFileUploadConnection<AuthOptions> extends GoogleMultipartUploadConnection<AsyncCallerCallOptions, AIStudioFileSaveResponse, AuthOptions> {\n get computedApiVersion(): string;\n buildUrl(): Promise<string>;\n}\nexport interface AIStudioFileDownloadConnectionParams<AuthOptions> extends AIStudioFileConnectionParams, GoogleConnectionParams<AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n name: string;\n}\nexport declare class AIStudioFileDownloadConnection<ResponseType extends GoogleResponse, AuthOptions> extends GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n name: string;\n constructor(fields: AIStudioFileDownloadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n get computedApiVersion(): string;\n buildMethod(): GoogleAbstractedClientOpsMethod;\n buildUrl(): Promise<string>;\n}\nexport interface BlobStoreAIStudioFileBaseParams<AuthOptions> extends BlobStoreGoogleParams<AuthOptions> {\n retryTime?: number;\n}\nexport declare abstract class BlobStoreAIStudioFileBase<AuthOptions> extends BlobStoreGoogle<AIStudioFileResponse, AuthOptions> {\n params?: BlobStoreAIStudioFileBaseParams<AuthOptions>;\n retryTime: number;\n constructor(fields?: BlobStoreAIStudioFileBaseParams<AuthOptions>);\n _pathToName(path: string): string;\n abstract buildAbstractedClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n buildApiKeyClient(apiKey: string): GoogleAbstractedClient;\n buildApiKey(fields?: BlobStoreGoogleParams<AuthOptions>): string | undefined;\n buildClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n _regetMetadata(key: string): Promise<AIStudioFileObject>;\n _set([key, blob]: [\n string,\n MediaBlob\n ]): Promise<AIStudioFileSaveResponse>;\n buildSetConnection([_key, _blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n buildSetMetadata([_key, _blob]: [string, MediaBlob]): Record<string, unknown>;\n buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n buildGetDataConnection(_key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n _get(key: string): Promise<MediaBlob | undefined>;\n buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n}\n//# sourceMappingURL=media.d.ts.map"],"mappings":";;;;;;;UAKiBa,kDAAkDP,uBAAuBQ;AAAzED,uBAEaE,+BAF4DD,CAAAA,oBAERb,sBAFO,EAAA,qBAEsCO,cAFtC,EAAA,WAAA,CAAA,SAE2EC,oBAF3E,CAEgGO,WAFhG,EAE6GC,YAF7G,EAE2HH,WAF3H,CAAA,CAAA;EAE3DC,WAAAA,CAAAA,MAAAA,EACNT,sBADqCU,CACdF,WADcG,CAAAA,GAAAA,SAAAA,EAAAH,MAAAA,EACoBd,WADpB,EAAA,MAAA,EACyCW,sBADzC;EAAqBV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syncCallerParams","MediaBlob","BlobStore","BlobStoreOptions","GoogleConnectionParams","GoogleRawResponse","GoogleResponse","GoogleHostConnection","GoogleRawConnection","GoogleAbstractedClient","GoogleAbstractedClientOpsMethod","GoogleUploadConnectionParams","AuthOptions","GoogleMultipartUploadConnection","CallOptions","ResponseType","Record","Promise","GoogleDownloadConnection","GoogleDownloadRawConnection","BlobStoreGoogleParams","BlobStoreGoogle","Blob","AsyncGenerator","GoogleCloudStorageObject","GoogleCloudStorageResponse","BucketAndPath","GoogleCloudStorageUri","RegExp","GoogleCloudStorageConnectionParams","GoogleCloudStorageUploadConnectionParams","GoogleCloudStorageUploadConnection","GoogleCloudStorageDownloadConnectionParams","GoogleCloudStorageDownloadConnection","GoogleCloudStorageRawConnectionParams","GoogleCloudStorageRawConnection","BlobStoreGoogleCloudStorageBaseParams","BlobStoreGoogleCloudStorageBase","AIStudioFileState","AIStudioFileVideoMetadata","AIStudioFileMetadata","AIStudioFileObject","AIStudioMediaBlob","Date","AIStudioFileGetResponse","AIStudioFileSaveResponse","AIStudioFileListResponse","AIStudioFileResponse","AIStudioFileConnectionParams","AIStudioFileUploadConnectionParams","AIStudioFileUploadConnection","AIStudioFileDownloadConnectionParams","AIStudioFileDownloadConnection","BlobStoreAIStudioFileBaseParams","BlobStoreAIStudioFileBase"],"sources":["../../src/experimental/media.d.ts"],"sourcesContent":["import { AsyncCaller, AsyncCallerCallOptions, AsyncCallerParams } from \"@langchain/core/utils/async_caller\";\nimport { MediaBlob, BlobStore, BlobStoreOptions } from \"./utils/media_core.js\";\nimport { GoogleConnectionParams, GoogleRawResponse, GoogleResponse } from \"../types.js\";\nimport { GoogleHostConnection, GoogleRawConnection } from \"../connection.js\";\nimport { GoogleAbstractedClient, GoogleAbstractedClientOpsMethod } from \"../auth.js\";\nexport interface GoogleUploadConnectionParams<AuthOptions> extends GoogleConnectionParams<AuthOptions> {\n}\nexport declare abstract class GoogleMultipartUploadConnection<CallOptions extends AsyncCallerCallOptions, ResponseType extends GoogleResponse, AuthOptions> extends GoogleHostConnection<CallOptions, ResponseType, AuthOptions> {\n constructor(fields: GoogleConnectionParams<AuthOptions> | undefined, caller: AsyncCaller, client: GoogleAbstractedClient);\n _body(separator: string, data: MediaBlob, metadata: Record<string, unknown>): Promise<string>;\n request(data: MediaBlob, metadata: Record<string, unknown>, options: CallOptions): Promise<ResponseType>;\n}\nexport declare abstract class GoogleDownloadConnection<CallOptions extends AsyncCallerCallOptions, ResponseType extends GoogleResponse, AuthOptions> extends GoogleHostConnection<CallOptions, ResponseType, AuthOptions> {\n request(options: CallOptions): Promise<ResponseType>;\n}\nexport declare abstract class GoogleDownloadRawConnection<CallOptions extends AsyncCallerCallOptions, AuthOptions> extends GoogleRawConnection<CallOptions, AuthOptions> {\n buildMethod(): GoogleAbstractedClientOpsMethod;\n request(options: CallOptions): Promise<GoogleRawResponse>;\n}\nexport interface BlobStoreGoogleParams<AuthOptions> extends GoogleConnectionParams<AuthOptions>, AsyncCallerParams, BlobStoreOptions {\n}\nexport declare abstract class BlobStoreGoogle<ResponseType extends GoogleResponse, AuthOptions> extends BlobStore {\n caller: AsyncCaller;\n client: GoogleAbstractedClient;\n constructor(fields?: BlobStoreGoogleParams<AuthOptions>);\n abstract buildClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n abstract buildSetMetadata([key, blob]: [string, MediaBlob]): Record<string, unknown>;\n abstract buildSetConnection([key, blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions>;\n _set(keyValuePair: [string, MediaBlob]): Promise<ResponseType>;\n mset(keyValuePairs: [string, MediaBlob][]): Promise<void>;\n abstract buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions>;\n _getMetadata(key: string): Promise<Record<string, unknown>>;\n abstract buildGetDataConnection(key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n _getData(key: string): Promise<Blob>;\n _getMimetypeFromMetadata(metadata: Record<string, unknown>): string;\n _get(key: string): Promise<MediaBlob | undefined>;\n mget(keys: string[]): Promise<(MediaBlob | undefined)[]>;\n abstract buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleResponse, AuthOptions>;\n _del(key: string): Promise<void>;\n mdelete(keys: string[]): Promise<void>;\n yieldKeys(_prefix: string | undefined): AsyncGenerator<string>;\n}\n/**\n * Based on https://cloud.google.com/storage/docs/json_api/v1/objects#resource\n */\nexport interface GoogleCloudStorageObject extends Record<string, unknown> {\n id?: string;\n name?: string;\n contentType?: string;\n metadata?: Record<string, unknown>;\n}\nexport interface GoogleCloudStorageResponse extends GoogleResponse {\n data: GoogleCloudStorageObject;\n}\nexport type BucketAndPath = {\n bucket: string;\n path: string;\n};\nexport declare class GoogleCloudStorageUri {\n static uriRegexp: RegExp;\n bucket: string;\n path: string;\n constructor(uri: string);\n get uri(): string;\n get isValid(): boolean;\n static uriToBucketAndPath(uri: string): BucketAndPath;\n static isValidUri(uri: string): boolean;\n}\nexport interface GoogleCloudStorageConnectionParams {\n uri: string;\n}\nexport interface GoogleCloudStorageUploadConnectionParams<AuthOptions> extends GoogleUploadConnectionParams<AuthOptions>, GoogleCloudStorageConnectionParams {\n}\nexport declare class GoogleCloudStorageUploadConnection<AuthOptions> extends GoogleMultipartUploadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions> {\n uri: GoogleCloudStorageUri;\n constructor(fields: GoogleCloudStorageUploadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildUrl(): Promise<string>;\n}\nexport interface GoogleCloudStorageDownloadConnectionParams<AuthOptions> extends GoogleCloudStorageConnectionParams, GoogleConnectionParams<AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n alt: \"media\" | undefined;\n}\nexport declare class GoogleCloudStorageDownloadConnection<ResponseType extends GoogleResponse, AuthOptions> extends GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions> {\n uri: GoogleCloudStorageUri;\n method: GoogleAbstractedClientOpsMethod;\n alt: \"media\" | undefined;\n constructor(fields: GoogleCloudStorageDownloadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildMethod(): GoogleAbstractedClientOpsMethod;\n buildUrl(): Promise<string>;\n}\nexport interface GoogleCloudStorageRawConnectionParams<AuthOptions> extends GoogleCloudStorageConnectionParams, GoogleConnectionParams<AuthOptions> {\n}\nexport declare class GoogleCloudStorageRawConnection<AuthOptions> extends GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions> {\n uri: GoogleCloudStorageUri;\n constructor(fields: GoogleCloudStorageRawConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildUrl(): Promise<string>;\n}\nexport interface BlobStoreGoogleCloudStorageBaseParams<AuthOptions> extends BlobStoreGoogleParams<AuthOptions> {\n uriPrefix: GoogleCloudStorageUri;\n}\nexport declare abstract class BlobStoreGoogleCloudStorageBase<AuthOptions> extends BlobStoreGoogle<GoogleCloudStorageResponse, AuthOptions> {\n params: BlobStoreGoogleCloudStorageBaseParams<AuthOptions>;\n constructor(fields: BlobStoreGoogleCloudStorageBaseParams<AuthOptions>);\n buildSetConnection([key, _blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions>;\n buildSetMetadata([key, blob]: [string, MediaBlob]): Record<string, unknown>;\n buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions>;\n buildGetDataConnection(key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleResponse, AuthOptions>;\n}\nexport type AIStudioFileState = \"PROCESSING\" | \"ACTIVE\" | \"FAILED\" | \"STATE_UNSPECIFIED\";\nexport type AIStudioFileVideoMetadata = {\n videoMetadata: {\n videoDuration: string;\n };\n};\nexport type AIStudioFileMetadata = AIStudioFileVideoMetadata;\nexport interface AIStudioFileObject {\n name?: string;\n displayName?: string;\n mimeType?: string;\n sizeBytes?: string;\n createTime?: string;\n updateTime?: string;\n expirationTime?: string;\n sha256Hash?: string;\n uri?: string;\n state?: AIStudioFileState;\n error?: {\n code: number;\n message: string;\n details: Record<string, unknown>[];\n };\n metadata?: AIStudioFileMetadata;\n}\nexport declare class AIStudioMediaBlob extends MediaBlob {\n _valueAsDate(value: string): Date;\n _metadataFieldAsDate(field: string): Date;\n get createDate(): Date;\n get updateDate(): Date;\n get expirationDate(): Date;\n get isExpired(): boolean;\n}\nexport interface AIStudioFileGetResponse extends GoogleResponse {\n data: AIStudioFileObject;\n}\nexport interface AIStudioFileSaveResponse extends GoogleResponse {\n data: {\n file: AIStudioFileObject;\n };\n}\nexport interface AIStudioFileListResponse extends GoogleResponse {\n data: {\n files: AIStudioFileObject[];\n nextPageToken: string;\n };\n}\nexport type AIStudioFileResponse = AIStudioFileGetResponse | AIStudioFileSaveResponse | AIStudioFileListResponse;\nexport interface AIStudioFileConnectionParams {\n}\nexport interface AIStudioFileUploadConnectionParams<AuthOptions> extends GoogleUploadConnectionParams<AuthOptions>, AIStudioFileConnectionParams {\n}\nexport declare class AIStudioFileUploadConnection<AuthOptions> extends GoogleMultipartUploadConnection<AsyncCallerCallOptions, AIStudioFileSaveResponse, AuthOptions> {\n get computedApiVersion(): string;\n buildUrl(): Promise<string>;\n}\nexport interface AIStudioFileDownloadConnectionParams<AuthOptions> extends AIStudioFileConnectionParams, GoogleConnectionParams<AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n name: string;\n}\nexport declare class AIStudioFileDownloadConnection<ResponseType extends GoogleResponse, AuthOptions> extends GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n name: string;\n constructor(fields: AIStudioFileDownloadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n get computedApiVersion(): string;\n buildMethod(): GoogleAbstractedClientOpsMethod;\n buildUrl(): Promise<string>;\n}\nexport interface BlobStoreAIStudioFileBaseParams<AuthOptions> extends BlobStoreGoogleParams<AuthOptions> {\n retryTime?: number;\n}\nexport declare abstract class BlobStoreAIStudioFileBase<AuthOptions> extends BlobStoreGoogle<AIStudioFileResponse, AuthOptions> {\n params?: BlobStoreAIStudioFileBaseParams<AuthOptions>;\n retryTime: number;\n constructor(fields?: BlobStoreAIStudioFileBaseParams<AuthOptions>);\n _pathToName(path: string): string;\n abstract buildAbstractedClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n buildApiKeyClient(apiKey: string): GoogleAbstractedClient;\n buildApiKey(fields?: BlobStoreGoogleParams<AuthOptions>): string | undefined;\n buildClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n _regetMetadata(key: string): Promise<AIStudioFileObject>;\n _set([key, blob]: [\n string,\n MediaBlob\n ]): Promise<AIStudioFileSaveResponse>;\n buildSetConnection([_key, _blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n buildSetMetadata([_key, _blob]: [string, MediaBlob]): Record<string, unknown>;\n buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n buildGetDataConnection(_key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n _get(key: string): Promise<MediaBlob | undefined>;\n buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n}\n//# sourceMappingURL=media.d.ts.map"],"mappings":";;;;;;;UAKiBa,kDAAkDP,uBAAuBQ;AAAzED,uBAEaE,+BAF4DD,CAAAA,oBAERb,sBAFO,EAAA,qBAEsCO,cAFtC,EAAA,WAAA,CAAA,SAE2EC,oBAF3E,C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BAAAA,CAAAA,GAAAA,EAAuB,MAAA,CAAA,EA4DA1B,wBA5DSZ,CA4DgBP,sBA5DF,EA4D0BgD,oBA5D1B,EA4DgDnC,WA5DhD,CAAA;AAG/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","names":["AsyncCaller","AsyncCallerCallOptions","AsyncCallerParams","MediaBlob","BlobStore","BlobStoreOptions","GoogleConnectionParams","GoogleRawResponse","GoogleResponse","GoogleHostConnection","GoogleRawConnection","GoogleAbstractedClient","GoogleAbstractedClientOpsMethod","GoogleUploadConnectionParams","AuthOptions","GoogleMultipartUploadConnection","CallOptions","ResponseType","Record","Promise","GoogleDownloadConnection","GoogleDownloadRawConnection","BlobStoreGoogleParams","BlobStoreGoogle","Blob","AsyncGenerator","GoogleCloudStorageObject","GoogleCloudStorageResponse","BucketAndPath","GoogleCloudStorageUri","RegExp","GoogleCloudStorageConnectionParams","GoogleCloudStorageUploadConnectionParams","GoogleCloudStorageUploadConnection","GoogleCloudStorageDownloadConnectionParams","GoogleCloudStorageDownloadConnection","GoogleCloudStorageRawConnectionParams","GoogleCloudStorageRawConnection","BlobStoreGoogleCloudStorageBaseParams","BlobStoreGoogleCloudStorageBase","AIStudioFileState","AIStudioFileVideoMetadata","AIStudioFileMetadata","AIStudioFileObject","AIStudioMediaBlob","Date","AIStudioFileGetResponse","AIStudioFileSaveResponse","AIStudioFileListResponse","AIStudioFileResponse","AIStudioFileConnectionParams","AIStudioFileUploadConnectionParams","AIStudioFileUploadConnection","AIStudioFileDownloadConnectionParams","AIStudioFileDownloadConnection","BlobStoreAIStudioFileBaseParams","BlobStoreAIStudioFileBase"],"sources":["../../src/experimental/media.d.ts"],"sourcesContent":["import { AsyncCaller, AsyncCallerCallOptions, AsyncCallerParams } from \"@langchain/core/utils/async_caller\";\nimport { MediaBlob, BlobStore, BlobStoreOptions } from \"./utils/media_core.js\";\nimport { GoogleConnectionParams, GoogleRawResponse, GoogleResponse } from \"../types.js\";\nimport { GoogleHostConnection, GoogleRawConnection } from \"../connection.js\";\nimport { GoogleAbstractedClient, GoogleAbstractedClientOpsMethod } from \"../auth.js\";\nexport interface GoogleUploadConnectionParams<AuthOptions> extends GoogleConnectionParams<AuthOptions> {\n}\nexport declare abstract class GoogleMultipartUploadConnection<CallOptions extends AsyncCallerCallOptions, ResponseType extends GoogleResponse, AuthOptions> extends GoogleHostConnection<CallOptions, ResponseType, AuthOptions> {\n constructor(fields: GoogleConnectionParams<AuthOptions> | undefined, caller: AsyncCaller, client: GoogleAbstractedClient);\n _body(separator: string, data: MediaBlob, metadata: Record<string, unknown>): Promise<string>;\n request(data: MediaBlob, metadata: Record<string, unknown>, options: CallOptions): Promise<ResponseType>;\n}\nexport declare abstract class GoogleDownloadConnection<CallOptions extends AsyncCallerCallOptions, ResponseType extends GoogleResponse, AuthOptions> extends GoogleHostConnection<CallOptions, ResponseType, AuthOptions> {\n request(options: CallOptions): Promise<ResponseType>;\n}\nexport declare abstract class GoogleDownloadRawConnection<CallOptions extends AsyncCallerCallOptions, AuthOptions> extends GoogleRawConnection<CallOptions, AuthOptions> {\n buildMethod(): GoogleAbstractedClientOpsMethod;\n request(options: CallOptions): Promise<GoogleRawResponse>;\n}\nexport interface BlobStoreGoogleParams<AuthOptions> extends GoogleConnectionParams<AuthOptions>, AsyncCallerParams, BlobStoreOptions {\n}\nexport declare abstract class BlobStoreGoogle<ResponseType extends GoogleResponse, AuthOptions> extends BlobStore {\n caller: AsyncCaller;\n client: GoogleAbstractedClient;\n constructor(fields?: BlobStoreGoogleParams<AuthOptions>);\n abstract buildClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n abstract buildSetMetadata([key, blob]: [string, MediaBlob]): Record<string, unknown>;\n abstract buildSetConnection([key, blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions>;\n _set(keyValuePair: [string, MediaBlob]): Promise<ResponseType>;\n mset(keyValuePairs: [string, MediaBlob][]): Promise<void>;\n abstract buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions>;\n _getMetadata(key: string): Promise<Record<string, unknown>>;\n abstract buildGetDataConnection(key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n _getData(key: string): Promise<Blob>;\n _getMimetypeFromMetadata(metadata: Record<string, unknown>): string;\n _get(key: string): Promise<MediaBlob | undefined>;\n mget(keys: string[]): Promise<(MediaBlob | undefined)[]>;\n abstract buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleResponse, AuthOptions>;\n _del(key: string): Promise<void>;\n mdelete(keys: string[]): Promise<void>;\n yieldKeys(_prefix: string | undefined): AsyncGenerator<string>;\n}\n/**\n * Based on https://cloud.google.com/storage/docs/json_api/v1/objects#resource\n */\nexport interface GoogleCloudStorageObject extends Record<string, unknown> {\n id?: string;\n name?: string;\n contentType?: string;\n metadata?: Record<string, unknown>;\n}\nexport interface GoogleCloudStorageResponse extends GoogleResponse {\n data: GoogleCloudStorageObject;\n}\nexport type BucketAndPath = {\n bucket: string;\n path: string;\n};\nexport declare class GoogleCloudStorageUri {\n static uriRegexp: RegExp;\n bucket: string;\n path: string;\n constructor(uri: string);\n get uri(): string;\n get isValid(): boolean;\n static uriToBucketAndPath(uri: string): BucketAndPath;\n static isValidUri(uri: string): boolean;\n}\nexport interface GoogleCloudStorageConnectionParams {\n uri: string;\n}\nexport interface GoogleCloudStorageUploadConnectionParams<AuthOptions> extends GoogleUploadConnectionParams<AuthOptions>, GoogleCloudStorageConnectionParams {\n}\nexport declare class GoogleCloudStorageUploadConnection<AuthOptions> extends GoogleMultipartUploadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions> {\n uri: GoogleCloudStorageUri;\n constructor(fields: GoogleCloudStorageUploadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildUrl(): Promise<string>;\n}\nexport interface GoogleCloudStorageDownloadConnectionParams<AuthOptions> extends GoogleCloudStorageConnectionParams, GoogleConnectionParams<AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n alt: \"media\" | undefined;\n}\nexport declare class GoogleCloudStorageDownloadConnection<ResponseType extends GoogleResponse, AuthOptions> extends GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions> {\n uri: GoogleCloudStorageUri;\n method: GoogleAbstractedClientOpsMethod;\n alt: \"media\" | undefined;\n constructor(fields: GoogleCloudStorageDownloadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildMethod(): GoogleAbstractedClientOpsMethod;\n buildUrl(): Promise<string>;\n}\nexport interface GoogleCloudStorageRawConnectionParams<AuthOptions> extends GoogleCloudStorageConnectionParams, GoogleConnectionParams<AuthOptions> {\n}\nexport declare class GoogleCloudStorageRawConnection<AuthOptions> extends GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions> {\n uri: GoogleCloudStorageUri;\n constructor(fields: GoogleCloudStorageRawConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildUrl(): Promise<string>;\n}\nexport interface BlobStoreGoogleCloudStorageBaseParams<AuthOptions> extends BlobStoreGoogleParams<AuthOptions> {\n uriPrefix: GoogleCloudStorageUri;\n}\nexport declare abstract class BlobStoreGoogleCloudStorageBase<AuthOptions> extends BlobStoreGoogle<GoogleCloudStorageResponse, AuthOptions> {\n params: BlobStoreGoogleCloudStorageBaseParams<AuthOptions>;\n constructor(fields: BlobStoreGoogleCloudStorageBaseParams<AuthOptions>);\n buildSetConnection([key, _blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions>;\n buildSetMetadata([key, blob]: [string, MediaBlob]): Record<string, unknown>;\n buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions>;\n buildGetDataConnection(key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleResponse, AuthOptions>;\n}\nexport type AIStudioFileState = \"PROCESSING\" | \"ACTIVE\" | \"FAILED\" | \"STATE_UNSPECIFIED\";\nexport type AIStudioFileVideoMetadata = {\n videoMetadata: {\n videoDuration: string;\n };\n};\nexport type AIStudioFileMetadata = AIStudioFileVideoMetadata;\nexport interface AIStudioFileObject {\n name?: string;\n displayName?: string;\n mimeType?: string;\n sizeBytes?: string;\n createTime?: string;\n updateTime?: string;\n expirationTime?: string;\n sha256Hash?: string;\n uri?: string;\n state?: AIStudioFileState;\n error?: {\n code: number;\n message: string;\n details: Record<string, unknown>[];\n };\n metadata?: AIStudioFileMetadata;\n}\nexport declare class AIStudioMediaBlob extends MediaBlob {\n _valueAsDate(value: string): Date;\n _metadataFieldAsDate(field: string): Date;\n get createDate(): Date;\n get updateDate(): Date;\n get expirationDate(): Date;\n get isExpired(): boolean;\n}\nexport interface AIStudioFileGetResponse extends GoogleResponse {\n data: AIStudioFileObject;\n}\nexport interface AIStudioFileSaveResponse extends GoogleResponse {\n data: {\n file: AIStudioFileObject;\n };\n}\nexport interface AIStudioFileListResponse extends GoogleResponse {\n data: {\n files: AIStudioFileObject[];\n nextPageToken: string;\n };\n}\nexport type AIStudioFileResponse = AIStudioFileGetResponse | AIStudioFileSaveResponse | AIStudioFileListResponse;\nexport interface AIStudioFileConnectionParams {\n}\nexport interface AIStudioFileUploadConnectionParams<AuthOptions> extends GoogleUploadConnectionParams<AuthOptions>, AIStudioFileConnectionParams {\n}\nexport declare class AIStudioFileUploadConnection<AuthOptions> extends GoogleMultipartUploadConnection<AsyncCallerCallOptions, AIStudioFileSaveResponse, AuthOptions> {\n get computedApiVersion(): string;\n buildUrl(): Promise<string>;\n}\nexport interface AIStudioFileDownloadConnectionParams<AuthOptions> extends AIStudioFileConnectionParams, GoogleConnectionParams<AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n name: string;\n}\nexport declare class AIStudioFileDownloadConnection<ResponseType extends GoogleResponse, AuthOptions> extends GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n name: string;\n constructor(fields: AIStudioFileDownloadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n get computedApiVersion(): string;\n buildMethod(): GoogleAbstractedClientOpsMethod;\n buildUrl(): Promise<string>;\n}\nexport interface BlobStoreAIStudioFileBaseParams<AuthOptions> extends BlobStoreGoogleParams<AuthOptions> {\n retryTime?: number;\n}\nexport declare abstract class BlobStoreAIStudioFileBase<AuthOptions> extends BlobStoreGoogle<AIStudioFileResponse, AuthOptions> {\n params?: BlobStoreAIStudioFileBaseParams<AuthOptions>;\n retryTime: number;\n constructor(fields?: BlobStoreAIStudioFileBaseParams<AuthOptions>);\n _pathToName(path: string): string;\n abstract buildAbstractedClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n buildApiKeyClient(apiKey: string): GoogleAbstractedClient;\n buildApiKey(fields?: BlobStoreGoogleParams<AuthOptions>): string | undefined;\n buildClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n _regetMetadata(key: string): Promise<AIStudioFileObject>;\n _set([key, blob]: [\n string,\n MediaBlob\n ]): Promise<AIStudioFileSaveResponse>;\n buildSetConnection([_key, _blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n buildSetMetadata([_key, _blob]: [string, MediaBlob]): Record<string, unknown>;\n buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n buildGetDataConnection(_key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n _get(key: string): Promise<MediaBlob | undefined>;\n buildDeleteConnection(key: string): GoogleDownloadConnection<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BAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAkELkB,2BAlEKlB,CAkEuBF,sBAlEvBE,EAkE+CW,WAlE/CX,CAAAA;EAAS,IAAA,CAAA,GAAA,EAAA,MAAA,CAAA,EAmEjCgB,OAnEiC,CAmEzBhB,SAnEyB,GAAA,SAAA,CAAA;EAQvC2C,qBAAAA,CAAAA,GAAAA,EAAuB,MAAA,CAAA,EA4DA1B,wBA5DSZ,CA4DgBP,sBA5DF,EA4D0BgD,oBA5D1B,EA4DgDnC,WA5DhD,CAAA;AAG/D"}
|
|
1
|
+
{"version":3,"file":"media.d.ts","names":["AsyncCaller","AsyncCallerCallOptions","AsyncCallerParams","MediaBlob","BlobStore","BlobStoreOptions","GoogleConnectionParams","GoogleRawResponse","GoogleResponse","GoogleHostConnection","GoogleRawConnection","GoogleAbstractedClient","GoogleAbstractedClientOpsMethod","GoogleUploadConnectionParams","AuthOptions","GoogleMultipartUploadConnection","CallOptions","ResponseType","Record","Promise","GoogleDownloadConnection","GoogleDownloadRawConnection","BlobStoreGoogleParams","BlobStoreGoogle","Blob","AsyncGenerator","GoogleCloudStorageObject","GoogleCloudStorageResponse","BucketAndPath","GoogleCloudStorageUri","RegExp","GoogleCloudStorageConnectionParams","GoogleCloudStorageUploadConnectionParams","GoogleCloudStorageUploadConnection","GoogleCloudStorageDownloadConnectionParams","GoogleCloudStorageDownloadConnection","GoogleCloudStorageRawConnectionParams","GoogleCloudStorageRawConnection","BlobStoreGoogleCloudStorageBaseParams","BlobStoreGoogleCloudStorageBase","AIStudioFileState","AIStudioFileVideoMetadata","AIStudioFileMetadata","AIStudioFileObject","AIStudioMediaBlob","Date","AIStudioFileGetResponse","AIStudioFileSaveResponse","AIStudioFileListResponse","AIStudioFileResponse","AIStudioFileConnectionParams","AIStudioFileUploadConnectionParams","AIStudioFileUploadConnection","AIStudioFileDownloadConnectionParams","AIStudioFileDownloadConnection","BlobStoreAIStudioFileBaseParams","BlobStoreAIStudioFileBase"],"sources":["../../src/experimental/media.d.ts"],"sourcesContent":["import { AsyncCaller, AsyncCallerCallOptions, AsyncCallerParams } from \"@langchain/core/utils/async_caller\";\nimport { MediaBlob, BlobStore, BlobStoreOptions } from \"./utils/media_core.js\";\nimport { GoogleConnectionParams, GoogleRawResponse, GoogleResponse } from \"../types.js\";\nimport { GoogleHostConnection, GoogleRawConnection } from \"../connection.js\";\nimport { GoogleAbstractedClient, GoogleAbstractedClientOpsMethod } from \"../auth.js\";\nexport interface GoogleUploadConnectionParams<AuthOptions> extends GoogleConnectionParams<AuthOptions> {\n}\nexport declare abstract class GoogleMultipartUploadConnection<CallOptions extends AsyncCallerCallOptions, ResponseType extends GoogleResponse, AuthOptions> extends GoogleHostConnection<CallOptions, ResponseType, AuthOptions> {\n constructor(fields: GoogleConnectionParams<AuthOptions> | undefined, caller: AsyncCaller, client: GoogleAbstractedClient);\n _body(separator: string, data: MediaBlob, metadata: Record<string, unknown>): Promise<string>;\n request(data: MediaBlob, metadata: Record<string, unknown>, options: CallOptions): Promise<ResponseType>;\n}\nexport declare abstract class GoogleDownloadConnection<CallOptions extends AsyncCallerCallOptions, ResponseType extends GoogleResponse, AuthOptions> extends GoogleHostConnection<CallOptions, ResponseType, AuthOptions> {\n request(options: CallOptions): Promise<ResponseType>;\n}\nexport declare abstract class GoogleDownloadRawConnection<CallOptions extends AsyncCallerCallOptions, AuthOptions> extends GoogleRawConnection<CallOptions, AuthOptions> {\n buildMethod(): GoogleAbstractedClientOpsMethod;\n request(options: CallOptions): Promise<GoogleRawResponse>;\n}\nexport interface BlobStoreGoogleParams<AuthOptions> extends GoogleConnectionParams<AuthOptions>, AsyncCallerParams, BlobStoreOptions {\n}\nexport declare abstract class BlobStoreGoogle<ResponseType extends GoogleResponse, AuthOptions> extends BlobStore {\n caller: AsyncCaller;\n client: GoogleAbstractedClient;\n constructor(fields?: BlobStoreGoogleParams<AuthOptions>);\n abstract buildClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n abstract buildSetMetadata([key, blob]: [string, MediaBlob]): Record<string, unknown>;\n abstract buildSetConnection([key, blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions>;\n _set(keyValuePair: [string, MediaBlob]): Promise<ResponseType>;\n mset(keyValuePairs: [string, MediaBlob][]): Promise<void>;\n abstract buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions>;\n _getMetadata(key: string): Promise<Record<string, unknown>>;\n abstract buildGetDataConnection(key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n _getData(key: string): Promise<Blob>;\n _getMimetypeFromMetadata(metadata: Record<string, unknown>): string;\n _get(key: string): Promise<MediaBlob | undefined>;\n mget(keys: string[]): Promise<(MediaBlob | undefined)[]>;\n abstract buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleResponse, AuthOptions>;\n _del(key: string): Promise<void>;\n mdelete(keys: string[]): Promise<void>;\n yieldKeys(_prefix: string | undefined): AsyncGenerator<string>;\n}\n/**\n * Based on https://cloud.google.com/storage/docs/json_api/v1/objects#resource\n */\nexport interface GoogleCloudStorageObject extends Record<string, unknown> {\n id?: string;\n name?: string;\n contentType?: string;\n metadata?: Record<string, unknown>;\n}\nexport interface GoogleCloudStorageResponse extends GoogleResponse {\n data: GoogleCloudStorageObject;\n}\nexport type BucketAndPath = {\n bucket: string;\n path: string;\n};\nexport declare class GoogleCloudStorageUri {\n static uriRegexp: RegExp;\n bucket: string;\n path: string;\n constructor(uri: string);\n get uri(): string;\n get isValid(): boolean;\n static uriToBucketAndPath(uri: string): BucketAndPath;\n static isValidUri(uri: string): boolean;\n}\nexport interface GoogleCloudStorageConnectionParams {\n uri: string;\n}\nexport interface GoogleCloudStorageUploadConnectionParams<AuthOptions> extends GoogleUploadConnectionParams<AuthOptions>, GoogleCloudStorageConnectionParams {\n}\nexport declare class GoogleCloudStorageUploadConnection<AuthOptions> extends GoogleMultipartUploadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions> {\n uri: GoogleCloudStorageUri;\n constructor(fields: GoogleCloudStorageUploadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildUrl(): Promise<string>;\n}\nexport interface GoogleCloudStorageDownloadConnectionParams<AuthOptions> extends GoogleCloudStorageConnectionParams, GoogleConnectionParams<AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n alt: \"media\" | undefined;\n}\nexport declare class GoogleCloudStorageDownloadConnection<ResponseType extends GoogleResponse, AuthOptions> extends GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions> {\n uri: GoogleCloudStorageUri;\n method: GoogleAbstractedClientOpsMethod;\n alt: \"media\" | undefined;\n constructor(fields: GoogleCloudStorageDownloadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildMethod(): GoogleAbstractedClientOpsMethod;\n buildUrl(): Promise<string>;\n}\nexport interface GoogleCloudStorageRawConnectionParams<AuthOptions> extends GoogleCloudStorageConnectionParams, GoogleConnectionParams<AuthOptions> {\n}\nexport declare class GoogleCloudStorageRawConnection<AuthOptions> extends GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions> {\n uri: GoogleCloudStorageUri;\n constructor(fields: GoogleCloudStorageRawConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n buildUrl(): Promise<string>;\n}\nexport interface BlobStoreGoogleCloudStorageBaseParams<AuthOptions> extends BlobStoreGoogleParams<AuthOptions> {\n uriPrefix: GoogleCloudStorageUri;\n}\nexport declare abstract class BlobStoreGoogleCloudStorageBase<AuthOptions> extends BlobStoreGoogle<GoogleCloudStorageResponse, AuthOptions> {\n params: BlobStoreGoogleCloudStorageBaseParams<AuthOptions>;\n constructor(fields: BlobStoreGoogleCloudStorageBaseParams<AuthOptions>);\n buildSetConnection([key, _blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions>;\n buildSetMetadata([key, blob]: [string, MediaBlob]): Record<string, unknown>;\n buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleCloudStorageResponse, AuthOptions>;\n buildGetDataConnection(key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, GoogleResponse, AuthOptions>;\n}\nexport type AIStudioFileState = \"PROCESSING\" | \"ACTIVE\" | \"FAILED\" | \"STATE_UNSPECIFIED\";\nexport type AIStudioFileVideoMetadata = {\n videoMetadata: {\n videoDuration: string;\n };\n};\nexport type AIStudioFileMetadata = AIStudioFileVideoMetadata;\nexport interface AIStudioFileObject {\n name?: string;\n displayName?: string;\n mimeType?: string;\n sizeBytes?: string;\n createTime?: string;\n updateTime?: string;\n expirationTime?: string;\n sha256Hash?: string;\n uri?: string;\n state?: AIStudioFileState;\n error?: {\n code: number;\n message: string;\n details: Record<string, unknown>[];\n };\n metadata?: AIStudioFileMetadata;\n}\nexport declare class AIStudioMediaBlob extends MediaBlob {\n _valueAsDate(value: string): Date;\n _metadataFieldAsDate(field: string): Date;\n get createDate(): Date;\n get updateDate(): Date;\n get expirationDate(): Date;\n get isExpired(): boolean;\n}\nexport interface AIStudioFileGetResponse extends GoogleResponse {\n data: AIStudioFileObject;\n}\nexport interface AIStudioFileSaveResponse extends GoogleResponse {\n data: {\n file: AIStudioFileObject;\n };\n}\nexport interface AIStudioFileListResponse extends GoogleResponse {\n data: {\n files: AIStudioFileObject[];\n nextPageToken: string;\n };\n}\nexport type AIStudioFileResponse = AIStudioFileGetResponse | AIStudioFileSaveResponse | AIStudioFileListResponse;\nexport interface AIStudioFileConnectionParams {\n}\nexport interface AIStudioFileUploadConnectionParams<AuthOptions> extends GoogleUploadConnectionParams<AuthOptions>, AIStudioFileConnectionParams {\n}\nexport declare class AIStudioFileUploadConnection<AuthOptions> extends GoogleMultipartUploadConnection<AsyncCallerCallOptions, AIStudioFileSaveResponse, AuthOptions> {\n get computedApiVersion(): string;\n buildUrl(): Promise<string>;\n}\nexport interface AIStudioFileDownloadConnectionParams<AuthOptions> extends AIStudioFileConnectionParams, GoogleConnectionParams<AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n name: string;\n}\nexport declare class AIStudioFileDownloadConnection<ResponseType extends GoogleResponse, AuthOptions> extends GoogleDownloadConnection<AsyncCallerCallOptions, ResponseType, AuthOptions> {\n method: GoogleAbstractedClientOpsMethod;\n name: string;\n constructor(fields: AIStudioFileDownloadConnectionParams<AuthOptions>, caller: AsyncCaller, client: GoogleAbstractedClient);\n get computedApiVersion(): string;\n buildMethod(): GoogleAbstractedClientOpsMethod;\n buildUrl(): Promise<string>;\n}\nexport interface BlobStoreAIStudioFileBaseParams<AuthOptions> extends BlobStoreGoogleParams<AuthOptions> {\n retryTime?: number;\n}\nexport declare abstract class BlobStoreAIStudioFileBase<AuthOptions> extends BlobStoreGoogle<AIStudioFileResponse, AuthOptions> {\n params?: BlobStoreAIStudioFileBaseParams<AuthOptions>;\n retryTime: number;\n constructor(fields?: BlobStoreAIStudioFileBaseParams<AuthOptions>);\n _pathToName(path: string): string;\n abstract buildAbstractedClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n buildApiKeyClient(apiKey: string): GoogleAbstractedClient;\n buildApiKey(fields?: BlobStoreGoogleParams<AuthOptions>): string | undefined;\n buildClient(fields?: BlobStoreGoogleParams<AuthOptions>): GoogleAbstractedClient;\n _regetMetadata(key: string): Promise<AIStudioFileObject>;\n _set([key, blob]: [\n string,\n MediaBlob\n ]): Promise<AIStudioFileSaveResponse>;\n buildSetConnection([_key, _blob]: [\n string,\n MediaBlob\n ]): GoogleMultipartUploadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n buildSetMetadata([_key, _blob]: [string, MediaBlob]): Record<string, unknown>;\n buildGetMetadataConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n buildGetDataConnection(_key: string): GoogleDownloadRawConnection<AsyncCallerCallOptions, AuthOptions>;\n _get(key: string): Promise<MediaBlob | undefined>;\n buildDeleteConnection(key: string): GoogleDownloadConnection<AsyncCallerCallOptions, AIStudioFileResponse, AuthOptions>;\n}\n//# sourceMappingURL=media.d.ts.map"],"mappings":";;;;;;;UAKiBa,kDAAkDP,uBAAuBQ;AAAzED,uBAEaE,+BAF4DD,CAAAA,oBAERb,sBAFO,EAAA,qBAEsCO,cAFtC,EAAA,WAAA,CAAA,SAE2EC,oBAF3E,CAEgGO,WAFhG,EAE6GC,YAF7G,EAE2HH,WAF3H,CAAA,CAAA;EAE3DC,WAAAA,CAAAA,MAAAA,EACNT,sBADqCU,CACdF,WADcG,CAAAA,GAAAA,SAAAA,EAAAH,MAAAA,EACoBd,WADpB,EAAA,MAAA,EACyCW,sBADzC;EAAqBV,KAAAA,CAAAA,SAAAA,EAAAA,MAAAA,EAAAA,IAAAA,EAE/CE,SAF+CF,EAAAA,QAAAA,EAE1BiB,MAF0BjB,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,CAAAA,EAEAkB,OAFAlB,CAAAA,MAAAA,CAAAA;EAA6CO,OAAAA,CAAAA,IAAAA,EAG7GL,SAH6GK,EAAAA,QAAAA,EAGxFU,MAHwFV,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,OAAAA,EAGtDQ,WAHsDR,CAAAA,EAGxCW,OAHwCX,CAGhCS,YAHgCT,CAAAA;;AAAuES,uBAKxKG,wBALwKH,CAAAA,oBAK3HhB,sBAL2HgB,EAAAA,qBAK9ET,cAL8ES,EAAAA,WAAAA,CAAAA,SAKzCR,oBALyCQ,CAKpBD,WALoBC,EAKPA,YALOA,EAKOH,WALPG,CAAAA,CAAAA;EAAcH,OAAAA,CAAAA,OAAAA,EAM/LE,WAN+LF,CAAAA,EAMjLK,O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pC2B,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;EACIA,0BAAAA,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EA4DmBzB,wBA5DnByB,CA4D4C5C,sBA5D5C4C,EA4DoEI,oBA5DpEJ,EA4D0F/B,WA5D1F+B,CAAAA;EALqB1C,sBAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAkELkB,2BAlEKlB,CAkEuBF,sBAlEvBE,EAkE+CW,WAlE/CX,CAAAA;EAAS,IAAA,CAAA,GAAA,EAAA,MAAA,CAAA,EAmEjCgB,OAnEiC,CAmEzBhB,SAnEyB,GAAA,SAAA,CAAA;EAQvC2C,qBAAAA,CAAAA,GAAAA,EAAuB,MAAA,CAAA,EA4DA1B,wBA5DSZ,CA4DgBP,sBA5DF,EA4D0BgD,oBA5D1B,EA4DgDnC,WA5DhD,CAAA;AAG/D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/google-common",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.17",
|
|
4
4
|
"description": "Core types and classes for Google services.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"uuid": "^10.0.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@langchain/core": "1.1.
|
|
20
|
+
"@langchain/core": "^1.1.21"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@jest/globals": "^30.2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"ts-jest": "^29.4.6",
|
|
35
35
|
"typescript": "~5.8.3",
|
|
36
36
|
"zod": "^3.25.76",
|
|
37
|
-
"@langchain/core": "1.1.
|
|
37
|
+
"@langchain/core": "^1.1.21",
|
|
38
38
|
"@langchain/eslint": "0.1.1",
|
|
39
39
|
"@langchain/tsconfig": "0.0.1"
|
|
40
40
|
},
|