@langchain/google-vertexai-web 2.1.25 → 2.1.26-dev-1773698445534
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/dist/chat_models.cjs +2 -3
- package/dist/chat_models.cjs.map +1 -1
- package/dist/chat_models.js +2 -3
- package/dist/chat_models.js.map +1 -1
- package/dist/embeddings.cjs +1 -2
- package/dist/embeddings.cjs.map +1 -1
- package/dist/embeddings.js +1 -2
- package/dist/embeddings.js.map +1 -1
- package/dist/index.cjs +5 -6
- package/dist/index.js +1 -2
- package/dist/llms.cjs +2 -3
- package/dist/llms.cjs.map +1 -1
- package/dist/llms.js +2 -3
- package/dist/llms.js.map +1 -1
- package/dist/types.cjs +7 -7
- package/dist/types.js +2 -3
- package/dist/utils.cjs +7 -7
- package/dist/utils.js +2 -3
- package/package.json +10 -15
package/dist/chat_models.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
let _langchain_google_webauth = require("@langchain/google-webauth");
|
|
2
|
-
|
|
3
2
|
//#region src/chat_models.ts
|
|
4
3
|
/**
|
|
5
4
|
* Integration with Google Vertex AI chat models in web environments.
|
|
@@ -304,10 +303,10 @@ var ChatVertexAI = class extends _langchain_google_webauth.ChatGoogle {
|
|
|
304
303
|
...fields,
|
|
305
304
|
platformType: "gcp"
|
|
306
305
|
});
|
|
307
|
-
this._addVersion("@langchain/google-vertexai-web", "2.1.
|
|
306
|
+
this._addVersion("@langchain/google-vertexai-web", "2.1.26-dev-1773698445534");
|
|
308
307
|
}
|
|
309
308
|
};
|
|
310
|
-
|
|
311
309
|
//#endregion
|
|
312
310
|
exports.ChatVertexAI = ChatVertexAI;
|
|
311
|
+
|
|
313
312
|
//# sourceMappingURL=chat_models.cjs.map
|
package/dist/chat_models.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_models.cjs","names":["ChatGoogle"],"sources":["../src/chat_models.ts"],"sourcesContent":["import { type ChatGoogleInput, ChatGoogle } from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex AI chat model class.\n */\nexport interface ChatVertexAIInput extends ChatGoogleInput {}\n\n/**\n * Integration with Google Vertex AI chat models in web environments.\n *\n * Setup:\n * Install `@langchain/google-vertexai-web` and set your stringified\n * Vertex AI credentials as an environment variable named `GOOGLE_VERTEX_AI_WEB_CREDENTIALS`.\n *\n * ```bash\n * npm install @langchain/google-vertexai-web\n * export GOOGLE_VERTEX_AI_WEB_CREDENTIALS={\"type\":\"service_account\",\"project_id\":\"YOUR_PROJECT-12345\",...}\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/_langchain_google_vertexai_web.index.ChatVertexAI.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/langchain_google_common_types.GoogleAIBaseLanguageModelCallOptions.html)\n *\n * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.\n * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:\n *\n * ```typescript\n * // If binding tools along with other options, chain `.bindTools` and `.withConfig`\n * const llmWithArgsBound = llm.bindTools([...]) // tools array\n * .withConfig({\n * stop: [\"\\n\"], // other call options\n * });\n *\n * // When calling `.bindTools`, call options should be passed via the second argument\n * const llmWithTools = llm.bindTools(\n * [...],\n * {\n * tool_choice: \"auto\",\n * }\n * );\n * ```\n *\n * ## Examples\n *\n * <details open>\n * <summary><strong>Instantiate</strong></summary>\n *\n * ```typescript\n * import { ChatVertexAI } from '@langchain/google-vertexai-web';\n *\n * const llm = new ChatVertexAI({\n * model: \"gemini-1.5-pro\",\n * temperature: 0,\n * authOptions: {\n * credentials: process.env.GOOGLE_VERTEX_AI_WEB_CREDENTIALS,\n * },\n * // other params...\n * });\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Invoking</strong></summary>\n *\n * ```typescript\n * const input = `Translate \"I love programming\" into French.`;\n *\n * // Models also accept a list of chat messages or a formatted prompt\n * const result = await llm.invoke(input);\n * console.log(result);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"J'adore programmer\\\" \\n\\nHere's why this is the best translation:\\n\\n* **J'adore** means \\\"I love\\\" and conveys a strong passion.\\n* **Programmer** is the French verb for \\\"to program.\\\"\\n\\nThis translation is natural and idiomatic in French. \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 63,\n * \"total_tokens\": 72\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Streaming Chunks</strong></summary>\n *\n * ```typescript\n * for await (const chunk of await llm.stream(input)) {\n * console.log(chunk);\n * }\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"J'adore programmer\\\" \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 8,\n * \"total_tokens\": 17\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Aggregate Streamed Chunks</strong></summary>\n *\n * ```typescript\n * import { AIMessageChunk } from '@langchain/core/messages';\n * import { concat } from '@langchain/core/utils/stream';\n *\n * const stream = await llm.stream(input);\n * let full: AIMessageChunk | undefined;\n * for await (const chunk of stream) {\n * full = !full ? chunk : concat(full, chunk);\n * }\n * console.log(full);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"J'adore programmer\\\" \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 8,\n * \"total_tokens\": 17\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Bind tools</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const GetWeather = {\n * name: \"GetWeather\",\n * description: \"Get the current weather in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const GetPopulation = {\n * name: \"GetPopulation\",\n * description: \"Get the current population in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const llmWithTools = llm.bindTools([GetWeather, GetPopulation]);\n * const aiMsg = await llmWithTools.invoke(\n * \"Which city is hotter today and which is bigger: LA or NY?\"\n * );\n * console.log(aiMsg.tool_calls);\n * ```\n *\n * ```txt\n * [\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York City, NY' },\n * id: '33c1c1f47e2f492799c77d2800a43912',\n * type: 'tool_call'\n * }\n * ]\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Structured Output</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const Joke = z.object({\n * setup: z.string().describe(\"The setup of the joke\"),\n * punchline: z.string().describe(\"The punchline to the joke\"),\n * rating: z.number().optional().describe(\"How funny the joke is, from 1 to 10\")\n * }).describe('Joke to tell user.');\n *\n * const structuredLlm = llm.withStructuredOutput(Joke, { name: \"Joke\" });\n * const jokeResult = await structuredLlm.invoke(\"Tell me a joke about cats\");\n * console.log(jokeResult);\n * ```\n *\n * ```txt\n * {\n * setup: 'What do you call a cat that loves to bowl?',\n * punchline: 'An alley cat!'\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Usage Metadata</strong></summary>\n *\n * ```typescript\n * const aiMsgForMetadata = await llm.invoke(input);\n * console.log(aiMsgForMetadata.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 9, output_tokens: 8, total_tokens: 17 }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Stream Usage Metadata</strong></summary>\n *\n * ```typescript\n * const streamForMetadata = await llm.stream(\n * input,\n * {\n * streamUsage: true\n * }\n * );\n * let fullForMetadata: AIMessageChunk | undefined;\n * for await (const chunk of streamForMetadata) {\n * fullForMetadata = !fullForMetadata ? chunk : concat(fullForMetadata, chunk);\n * }\n * console.log(fullForMetadata?.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 9, output_tokens: 8, total_tokens: 17 }\n * ```\n * </details>\n *\n * <br />\n */\nexport class ChatVertexAI extends ChatGoogle {\n lc_namespace = [\"langchain\", \"chat_models\", \"vertexai\"];\n\n static lc_name() {\n return \"ChatVertexAI\";\n }\n\n constructor(model: string, fields?: Omit<ChatVertexAIInput, \"model\">);\n constructor(fields?: ChatVertexAIInput);\n constructor(\n modelOrFields?: string | ChatVertexAIInput,\n fieldsArg?: Omit<ChatVertexAIInput, \"model\">\n ) {\n const fields =\n typeof modelOrFields === \"string\"\n ? { ...(fieldsArg ?? {}), model: modelOrFields }\n : (modelOrFields ?? {});\n super({\n ...fields,\n platformType: \"gcp\",\n });\n this._addVersion(\"@langchain/google-vertexai-web\", __PKG_VERSION__);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat_models.cjs","names":["ChatGoogle"],"sources":["../src/chat_models.ts"],"sourcesContent":["import { type ChatGoogleInput, ChatGoogle } from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex AI chat model class.\n */\nexport interface ChatVertexAIInput extends ChatGoogleInput {}\n\n/**\n * Integration with Google Vertex AI chat models in web environments.\n *\n * Setup:\n * Install `@langchain/google-vertexai-web` and set your stringified\n * Vertex AI credentials as an environment variable named `GOOGLE_VERTEX_AI_WEB_CREDENTIALS`.\n *\n * ```bash\n * npm install @langchain/google-vertexai-web\n * export GOOGLE_VERTEX_AI_WEB_CREDENTIALS={\"type\":\"service_account\",\"project_id\":\"YOUR_PROJECT-12345\",...}\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/_langchain_google_vertexai_web.index.ChatVertexAI.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/langchain_google_common_types.GoogleAIBaseLanguageModelCallOptions.html)\n *\n * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.\n * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:\n *\n * ```typescript\n * // If binding tools along with other options, chain `.bindTools` and `.withConfig`\n * const llmWithArgsBound = llm.bindTools([...]) // tools array\n * .withConfig({\n * stop: [\"\\n\"], // other call options\n * });\n *\n * // When calling `.bindTools`, call options should be passed via the second argument\n * const llmWithTools = llm.bindTools(\n * [...],\n * {\n * tool_choice: \"auto\",\n * }\n * );\n * ```\n *\n * ## Examples\n *\n * <details open>\n * <summary><strong>Instantiate</strong></summary>\n *\n * ```typescript\n * import { ChatVertexAI } from '@langchain/google-vertexai-web';\n *\n * const llm = new ChatVertexAI({\n * model: \"gemini-1.5-pro\",\n * temperature: 0,\n * authOptions: {\n * credentials: process.env.GOOGLE_VERTEX_AI_WEB_CREDENTIALS,\n * },\n * // other params...\n * });\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Invoking</strong></summary>\n *\n * ```typescript\n * const input = `Translate \"I love programming\" into French.`;\n *\n * // Models also accept a list of chat messages or a formatted prompt\n * const result = await llm.invoke(input);\n * console.log(result);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"J'adore programmer\\\" \\n\\nHere's why this is the best translation:\\n\\n* **J'adore** means \\\"I love\\\" and conveys a strong passion.\\n* **Programmer** is the French verb for \\\"to program.\\\"\\n\\nThis translation is natural and idiomatic in French. \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 63,\n * \"total_tokens\": 72\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Streaming Chunks</strong></summary>\n *\n * ```typescript\n * for await (const chunk of await llm.stream(input)) {\n * console.log(chunk);\n * }\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"J'adore programmer\\\" \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 8,\n * \"total_tokens\": 17\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Aggregate Streamed Chunks</strong></summary>\n *\n * ```typescript\n * import { AIMessageChunk } from '@langchain/core/messages';\n * import { concat } from '@langchain/core/utils/stream';\n *\n * const stream = await llm.stream(input);\n * let full: AIMessageChunk | undefined;\n * for await (const chunk of stream) {\n * full = !full ? chunk : concat(full, chunk);\n * }\n * console.log(full);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"J'adore programmer\\\" \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 8,\n * \"total_tokens\": 17\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Bind tools</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const GetWeather = {\n * name: \"GetWeather\",\n * description: \"Get the current weather in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const GetPopulation = {\n * name: \"GetPopulation\",\n * description: \"Get the current population in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const llmWithTools = llm.bindTools([GetWeather, GetPopulation]);\n * const aiMsg = await llmWithTools.invoke(\n * \"Which city is hotter today and which is bigger: LA or NY?\"\n * );\n * console.log(aiMsg.tool_calls);\n * ```\n *\n * ```txt\n * [\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York City, NY' },\n * id: '33c1c1f47e2f492799c77d2800a43912',\n * type: 'tool_call'\n * }\n * ]\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Structured Output</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const Joke = z.object({\n * setup: z.string().describe(\"The setup of the joke\"),\n * punchline: z.string().describe(\"The punchline to the joke\"),\n * rating: z.number().optional().describe(\"How funny the joke is, from 1 to 10\")\n * }).describe('Joke to tell user.');\n *\n * const structuredLlm = llm.withStructuredOutput(Joke, { name: \"Joke\" });\n * const jokeResult = await structuredLlm.invoke(\"Tell me a joke about cats\");\n * console.log(jokeResult);\n * ```\n *\n * ```txt\n * {\n * setup: 'What do you call a cat that loves to bowl?',\n * punchline: 'An alley cat!'\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Usage Metadata</strong></summary>\n *\n * ```typescript\n * const aiMsgForMetadata = await llm.invoke(input);\n * console.log(aiMsgForMetadata.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 9, output_tokens: 8, total_tokens: 17 }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Stream Usage Metadata</strong></summary>\n *\n * ```typescript\n * const streamForMetadata = await llm.stream(\n * input,\n * {\n * streamUsage: true\n * }\n * );\n * let fullForMetadata: AIMessageChunk | undefined;\n * for await (const chunk of streamForMetadata) {\n * fullForMetadata = !fullForMetadata ? chunk : concat(fullForMetadata, chunk);\n * }\n * console.log(fullForMetadata?.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 9, output_tokens: 8, total_tokens: 17 }\n * ```\n * </details>\n *\n * <br />\n */\nexport class ChatVertexAI extends ChatGoogle {\n lc_namespace = [\"langchain\", \"chat_models\", \"vertexai\"];\n\n static lc_name() {\n return \"ChatVertexAI\";\n }\n\n constructor(model: string, fields?: Omit<ChatVertexAIInput, \"model\">);\n constructor(fields?: ChatVertexAIInput);\n constructor(\n modelOrFields?: string | ChatVertexAIInput,\n fieldsArg?: Omit<ChatVertexAIInput, \"model\">\n ) {\n const fields =\n typeof modelOrFields === \"string\"\n ? { ...(fieldsArg ?? {}), model: modelOrFields }\n : (modelOrFields ?? {});\n super({\n ...fields,\n platformType: \"gcp\",\n });\n this._addVersion(\"@langchain/google-vertexai-web\", __PKG_VERSION__);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoSA,IAAa,eAAb,cAAkCA,0BAAAA,WAAW;CAC3C,eAAe;EAAC;EAAa;EAAe;EAAW;CAEvD,OAAO,UAAU;AACf,SAAO;;CAKT,YACE,eACA,WACA;EACA,MAAM,SACJ,OAAO,kBAAkB,WACrB;GAAE,GAAI,aAAa,EAAE;GAAG,OAAO;GAAe,GAC7C,iBAAiB,EAAE;AAC1B,QAAM;GACJ,GAAG;GACH,cAAc;GACf,CAAC;AACF,OAAK,YAAY,kCAAA,2BAAkD"}
|
package/dist/chat_models.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ChatGoogle } from "@langchain/google-webauth";
|
|
2
|
-
|
|
3
2
|
//#region src/chat_models.ts
|
|
4
3
|
/**
|
|
5
4
|
* Integration with Google Vertex AI chat models in web environments.
|
|
@@ -304,10 +303,10 @@ var ChatVertexAI = class extends ChatGoogle {
|
|
|
304
303
|
...fields,
|
|
305
304
|
platformType: "gcp"
|
|
306
305
|
});
|
|
307
|
-
this._addVersion("@langchain/google-vertexai-web", "2.1.
|
|
306
|
+
this._addVersion("@langchain/google-vertexai-web", "2.1.26-dev-1773698445534");
|
|
308
307
|
}
|
|
309
308
|
};
|
|
310
|
-
|
|
311
309
|
//#endregion
|
|
312
310
|
export { ChatVertexAI };
|
|
311
|
+
|
|
313
312
|
//# sourceMappingURL=chat_models.js.map
|
package/dist/chat_models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_models.js","names":[],"sources":["../src/chat_models.ts"],"sourcesContent":["import { type ChatGoogleInput, ChatGoogle } from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex AI chat model class.\n */\nexport interface ChatVertexAIInput extends ChatGoogleInput {}\n\n/**\n * Integration with Google Vertex AI chat models in web environments.\n *\n * Setup:\n * Install `@langchain/google-vertexai-web` and set your stringified\n * Vertex AI credentials as an environment variable named `GOOGLE_VERTEX_AI_WEB_CREDENTIALS`.\n *\n * ```bash\n * npm install @langchain/google-vertexai-web\n * export GOOGLE_VERTEX_AI_WEB_CREDENTIALS={\"type\":\"service_account\",\"project_id\":\"YOUR_PROJECT-12345\",...}\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/_langchain_google_vertexai_web.index.ChatVertexAI.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/langchain_google_common_types.GoogleAIBaseLanguageModelCallOptions.html)\n *\n * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.\n * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:\n *\n * ```typescript\n * // If binding tools along with other options, chain `.bindTools` and `.withConfig`\n * const llmWithArgsBound = llm.bindTools([...]) // tools array\n * .withConfig({\n * stop: [\"\\n\"], // other call options\n * });\n *\n * // When calling `.bindTools`, call options should be passed via the second argument\n * const llmWithTools = llm.bindTools(\n * [...],\n * {\n * tool_choice: \"auto\",\n * }\n * );\n * ```\n *\n * ## Examples\n *\n * <details open>\n * <summary><strong>Instantiate</strong></summary>\n *\n * ```typescript\n * import { ChatVertexAI } from '@langchain/google-vertexai-web';\n *\n * const llm = new ChatVertexAI({\n * model: \"gemini-1.5-pro\",\n * temperature: 0,\n * authOptions: {\n * credentials: process.env.GOOGLE_VERTEX_AI_WEB_CREDENTIALS,\n * },\n * // other params...\n * });\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Invoking</strong></summary>\n *\n * ```typescript\n * const input = `Translate \"I love programming\" into French.`;\n *\n * // Models also accept a list of chat messages or a formatted prompt\n * const result = await llm.invoke(input);\n * console.log(result);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"J'adore programmer\\\" \\n\\nHere's why this is the best translation:\\n\\n* **J'adore** means \\\"I love\\\" and conveys a strong passion.\\n* **Programmer** is the French verb for \\\"to program.\\\"\\n\\nThis translation is natural and idiomatic in French. \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 63,\n * \"total_tokens\": 72\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Streaming Chunks</strong></summary>\n *\n * ```typescript\n * for await (const chunk of await llm.stream(input)) {\n * console.log(chunk);\n * }\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"J'adore programmer\\\" \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 8,\n * \"total_tokens\": 17\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Aggregate Streamed Chunks</strong></summary>\n *\n * ```typescript\n * import { AIMessageChunk } from '@langchain/core/messages';\n * import { concat } from '@langchain/core/utils/stream';\n *\n * const stream = await llm.stream(input);\n * let full: AIMessageChunk | undefined;\n * for await (const chunk of stream) {\n * full = !full ? chunk : concat(full, chunk);\n * }\n * console.log(full);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"J'adore programmer\\\" \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 8,\n * \"total_tokens\": 17\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Bind tools</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const GetWeather = {\n * name: \"GetWeather\",\n * description: \"Get the current weather in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const GetPopulation = {\n * name: \"GetPopulation\",\n * description: \"Get the current population in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const llmWithTools = llm.bindTools([GetWeather, GetPopulation]);\n * const aiMsg = await llmWithTools.invoke(\n * \"Which city is hotter today and which is bigger: LA or NY?\"\n * );\n * console.log(aiMsg.tool_calls);\n * ```\n *\n * ```txt\n * [\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York City, NY' },\n * id: '33c1c1f47e2f492799c77d2800a43912',\n * type: 'tool_call'\n * }\n * ]\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Structured Output</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const Joke = z.object({\n * setup: z.string().describe(\"The setup of the joke\"),\n * punchline: z.string().describe(\"The punchline to the joke\"),\n * rating: z.number().optional().describe(\"How funny the joke is, from 1 to 10\")\n * }).describe('Joke to tell user.');\n *\n * const structuredLlm = llm.withStructuredOutput(Joke, { name: \"Joke\" });\n * const jokeResult = await structuredLlm.invoke(\"Tell me a joke about cats\");\n * console.log(jokeResult);\n * ```\n *\n * ```txt\n * {\n * setup: 'What do you call a cat that loves to bowl?',\n * punchline: 'An alley cat!'\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Usage Metadata</strong></summary>\n *\n * ```typescript\n * const aiMsgForMetadata = await llm.invoke(input);\n * console.log(aiMsgForMetadata.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 9, output_tokens: 8, total_tokens: 17 }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Stream Usage Metadata</strong></summary>\n *\n * ```typescript\n * const streamForMetadata = await llm.stream(\n * input,\n * {\n * streamUsage: true\n * }\n * );\n * let fullForMetadata: AIMessageChunk | undefined;\n * for await (const chunk of streamForMetadata) {\n * fullForMetadata = !fullForMetadata ? chunk : concat(fullForMetadata, chunk);\n * }\n * console.log(fullForMetadata?.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 9, output_tokens: 8, total_tokens: 17 }\n * ```\n * </details>\n *\n * <br />\n */\nexport class ChatVertexAI extends ChatGoogle {\n lc_namespace = [\"langchain\", \"chat_models\", \"vertexai\"];\n\n static lc_name() {\n return \"ChatVertexAI\";\n }\n\n constructor(model: string, fields?: Omit<ChatVertexAIInput, \"model\">);\n constructor(fields?: ChatVertexAIInput);\n constructor(\n modelOrFields?: string | ChatVertexAIInput,\n fieldsArg?: Omit<ChatVertexAIInput, \"model\">\n ) {\n const fields =\n typeof modelOrFields === \"string\"\n ? { ...(fieldsArg ?? {}), model: modelOrFields }\n : (modelOrFields ?? {});\n super({\n ...fields,\n platformType: \"gcp\",\n });\n this._addVersion(\"@langchain/google-vertexai-web\", __PKG_VERSION__);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat_models.js","names":[],"sources":["../src/chat_models.ts"],"sourcesContent":["import { type ChatGoogleInput, ChatGoogle } from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex AI chat model class.\n */\nexport interface ChatVertexAIInput extends ChatGoogleInput {}\n\n/**\n * Integration with Google Vertex AI chat models in web environments.\n *\n * Setup:\n * Install `@langchain/google-vertexai-web` and set your stringified\n * Vertex AI credentials as an environment variable named `GOOGLE_VERTEX_AI_WEB_CREDENTIALS`.\n *\n * ```bash\n * npm install @langchain/google-vertexai-web\n * export GOOGLE_VERTEX_AI_WEB_CREDENTIALS={\"type\":\"service_account\",\"project_id\":\"YOUR_PROJECT-12345\",...}\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/_langchain_google_vertexai_web.index.ChatVertexAI.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/langchain_google_common_types.GoogleAIBaseLanguageModelCallOptions.html)\n *\n * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.\n * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:\n *\n * ```typescript\n * // If binding tools along with other options, chain `.bindTools` and `.withConfig`\n * const llmWithArgsBound = llm.bindTools([...]) // tools array\n * .withConfig({\n * stop: [\"\\n\"], // other call options\n * });\n *\n * // When calling `.bindTools`, call options should be passed via the second argument\n * const llmWithTools = llm.bindTools(\n * [...],\n * {\n * tool_choice: \"auto\",\n * }\n * );\n * ```\n *\n * ## Examples\n *\n * <details open>\n * <summary><strong>Instantiate</strong></summary>\n *\n * ```typescript\n * import { ChatVertexAI } from '@langchain/google-vertexai-web';\n *\n * const llm = new ChatVertexAI({\n * model: \"gemini-1.5-pro\",\n * temperature: 0,\n * authOptions: {\n * credentials: process.env.GOOGLE_VERTEX_AI_WEB_CREDENTIALS,\n * },\n * // other params...\n * });\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Invoking</strong></summary>\n *\n * ```typescript\n * const input = `Translate \"I love programming\" into French.`;\n *\n * // Models also accept a list of chat messages or a formatted prompt\n * const result = await llm.invoke(input);\n * console.log(result);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"J'adore programmer\\\" \\n\\nHere's why this is the best translation:\\n\\n* **J'adore** means \\\"I love\\\" and conveys a strong passion.\\n* **Programmer** is the French verb for \\\"to program.\\\"\\n\\nThis translation is natural and idiomatic in French. \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 63,\n * \"total_tokens\": 72\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Streaming Chunks</strong></summary>\n *\n * ```typescript\n * for await (const chunk of await llm.stream(input)) {\n * console.log(chunk);\n * }\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"J'adore programmer\\\" \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {},\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 8,\n * \"total_tokens\": 17\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Aggregate Streamed Chunks</strong></summary>\n *\n * ```typescript\n * import { AIMessageChunk } from '@langchain/core/messages';\n * import { concat } from '@langchain/core/utils/stream';\n *\n * const stream = await llm.stream(input);\n * let full: AIMessageChunk | undefined;\n * for await (const chunk of stream) {\n * full = !full ? chunk : concat(full, chunk);\n * }\n * console.log(full);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\\\"J'adore programmer\\\" \\n\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": [],\n * \"usage_metadata\": {\n * \"input_tokens\": 9,\n * \"output_tokens\": 8,\n * \"total_tokens\": 17\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Bind tools</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const GetWeather = {\n * name: \"GetWeather\",\n * description: \"Get the current weather in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const GetPopulation = {\n * name: \"GetPopulation\",\n * description: \"Get the current population in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const llmWithTools = llm.bindTools([GetWeather, GetPopulation]);\n * const aiMsg = await llmWithTools.invoke(\n * \"Which city is hotter today and which is bigger: LA or NY?\"\n * );\n * console.log(aiMsg.tool_calls);\n * ```\n *\n * ```txt\n * [\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York City, NY' },\n * id: '33c1c1f47e2f492799c77d2800a43912',\n * type: 'tool_call'\n * }\n * ]\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Structured Output</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const Joke = z.object({\n * setup: z.string().describe(\"The setup of the joke\"),\n * punchline: z.string().describe(\"The punchline to the joke\"),\n * rating: z.number().optional().describe(\"How funny the joke is, from 1 to 10\")\n * }).describe('Joke to tell user.');\n *\n * const structuredLlm = llm.withStructuredOutput(Joke, { name: \"Joke\" });\n * const jokeResult = await structuredLlm.invoke(\"Tell me a joke about cats\");\n * console.log(jokeResult);\n * ```\n *\n * ```txt\n * {\n * setup: 'What do you call a cat that loves to bowl?',\n * punchline: 'An alley cat!'\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Usage Metadata</strong></summary>\n *\n * ```typescript\n * const aiMsgForMetadata = await llm.invoke(input);\n * console.log(aiMsgForMetadata.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 9, output_tokens: 8, total_tokens: 17 }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Stream Usage Metadata</strong></summary>\n *\n * ```typescript\n * const streamForMetadata = await llm.stream(\n * input,\n * {\n * streamUsage: true\n * }\n * );\n * let fullForMetadata: AIMessageChunk | undefined;\n * for await (const chunk of streamForMetadata) {\n * fullForMetadata = !fullForMetadata ? chunk : concat(fullForMetadata, chunk);\n * }\n * console.log(fullForMetadata?.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 9, output_tokens: 8, total_tokens: 17 }\n * ```\n * </details>\n *\n * <br />\n */\nexport class ChatVertexAI extends ChatGoogle {\n lc_namespace = [\"langchain\", \"chat_models\", \"vertexai\"];\n\n static lc_name() {\n return \"ChatVertexAI\";\n }\n\n constructor(model: string, fields?: Omit<ChatVertexAIInput, \"model\">);\n constructor(fields?: ChatVertexAIInput);\n constructor(\n modelOrFields?: string | ChatVertexAIInput,\n fieldsArg?: Omit<ChatVertexAIInput, \"model\">\n ) {\n const fields =\n typeof modelOrFields === \"string\"\n ? { ...(fieldsArg ?? {}), model: modelOrFields }\n : (modelOrFields ?? {});\n super({\n ...fields,\n platformType: \"gcp\",\n });\n this._addVersion(\"@langchain/google-vertexai-web\", __PKG_VERSION__);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoSA,IAAa,eAAb,cAAkC,WAAW;CAC3C,eAAe;EAAC;EAAa;EAAe;EAAW;CAEvD,OAAO,UAAU;AACf,SAAO;;CAKT,YACE,eACA,WACA;EACA,MAAM,SACJ,OAAO,kBAAkB,WACrB;GAAE,GAAI,aAAa,EAAE;GAAG,OAAO;GAAe,GAC7C,iBAAiB,EAAE;AAC1B,QAAM;GACJ,GAAG;GACH,cAAc;GACf,CAAC;AACF,OAAK,YAAY,kCAAA,2BAAkD"}
|
package/dist/embeddings.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
let _langchain_google_webauth = require("@langchain/google-webauth");
|
|
2
|
-
|
|
3
2
|
//#region src/embeddings.ts
|
|
4
3
|
/**
|
|
5
4
|
* Integration with a Google Vertex AI embeddings model using
|
|
@@ -16,7 +15,7 @@ var VertexAIEmbeddings = class extends _langchain_google_webauth.GoogleEmbedding
|
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
17
|
};
|
|
19
|
-
|
|
20
18
|
//#endregion
|
|
21
19
|
exports.VertexAIEmbeddings = VertexAIEmbeddings;
|
|
20
|
+
|
|
22
21
|
//# sourceMappingURL=embeddings.cjs.map
|
package/dist/embeddings.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.cjs","names":["GoogleEmbeddings"],"sources":["../src/embeddings.ts"],"sourcesContent":["import {\n type GoogleEmbeddingsInput,\n GoogleEmbeddings,\n} from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex AI embeddings class.\n */\nexport interface GoogleVertexAIEmbeddingsInput extends GoogleEmbeddingsInput {}\n\n/**\n * Integration with a Google Vertex AI embeddings model using\n * the \"@langchain/google-webauth\" package for auth.\n */\nexport class VertexAIEmbeddings extends GoogleEmbeddings {\n static lc_name() {\n return \"VertexAIEmbeddings\";\n }\n\n constructor(fields: GoogleVertexAIEmbeddingsInput) {\n super({\n ...fields,\n platformType: \"gcp\",\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"embeddings.cjs","names":["GoogleEmbeddings"],"sources":["../src/embeddings.ts"],"sourcesContent":["import {\n type GoogleEmbeddingsInput,\n GoogleEmbeddings,\n} from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex AI embeddings class.\n */\nexport interface GoogleVertexAIEmbeddingsInput extends GoogleEmbeddingsInput {}\n\n/**\n * Integration with a Google Vertex AI embeddings model using\n * the \"@langchain/google-webauth\" package for auth.\n */\nexport class VertexAIEmbeddings extends GoogleEmbeddings {\n static lc_name() {\n return \"VertexAIEmbeddings\";\n }\n\n constructor(fields: GoogleVertexAIEmbeddingsInput) {\n super({\n ...fields,\n platformType: \"gcp\",\n });\n }\n}\n"],"mappings":";;;;;;AAcA,IAAa,qBAAb,cAAwCA,0BAAAA,iBAAiB;CACvD,OAAO,UAAU;AACf,SAAO;;CAGT,YAAY,QAAuC;AACjD,QAAM;GACJ,GAAG;GACH,cAAc;GACf,CAAC"}
|
package/dist/embeddings.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { GoogleEmbeddings } from "@langchain/google-webauth";
|
|
2
|
-
|
|
3
2
|
//#region src/embeddings.ts
|
|
4
3
|
/**
|
|
5
4
|
* Integration with a Google Vertex AI embeddings model using
|
|
@@ -16,7 +15,7 @@ var VertexAIEmbeddings = class extends GoogleEmbeddings {
|
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
17
|
};
|
|
19
|
-
|
|
20
18
|
//#endregion
|
|
21
19
|
export { VertexAIEmbeddings };
|
|
20
|
+
|
|
22
21
|
//# sourceMappingURL=embeddings.js.map
|
package/dist/embeddings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.js","names":[],"sources":["../src/embeddings.ts"],"sourcesContent":["import {\n type GoogleEmbeddingsInput,\n GoogleEmbeddings,\n} from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex AI embeddings class.\n */\nexport interface GoogleVertexAIEmbeddingsInput extends GoogleEmbeddingsInput {}\n\n/**\n * Integration with a Google Vertex AI embeddings model using\n * the \"@langchain/google-webauth\" package for auth.\n */\nexport class VertexAIEmbeddings extends GoogleEmbeddings {\n static lc_name() {\n return \"VertexAIEmbeddings\";\n }\n\n constructor(fields: GoogleVertexAIEmbeddingsInput) {\n super({\n ...fields,\n platformType: \"gcp\",\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"embeddings.js","names":[],"sources":["../src/embeddings.ts"],"sourcesContent":["import {\n type GoogleEmbeddingsInput,\n GoogleEmbeddings,\n} from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex AI embeddings class.\n */\nexport interface GoogleVertexAIEmbeddingsInput extends GoogleEmbeddingsInput {}\n\n/**\n * Integration with a Google Vertex AI embeddings model using\n * the \"@langchain/google-webauth\" package for auth.\n */\nexport class VertexAIEmbeddings extends GoogleEmbeddings {\n static lc_name() {\n return \"VertexAIEmbeddings\";\n }\n\n constructor(fields: GoogleVertexAIEmbeddingsInput) {\n super({\n ...fields,\n platformType: \"gcp\",\n });\n }\n}\n"],"mappings":";;;;;;AAcA,IAAa,qBAAb,cAAwC,iBAAiB;CACvD,OAAO,UAAU;AACf,SAAO;;CAGT,YAAY,QAAuC;AACjD,QAAM;GACJ,GAAG;GACH,cAAc;GACf,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const require_chat_models = require(
|
|
3
|
-
const require_llms = require(
|
|
4
|
-
const require_embeddings = require(
|
|
5
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chat_models = require("./chat_models.cjs");
|
|
3
|
+
const require_llms = require("./llms.cjs");
|
|
4
|
+
const require_embeddings = require("./embeddings.cjs");
|
|
6
5
|
exports.ChatVertexAI = require_chat_models.ChatVertexAI;
|
|
7
6
|
exports.VertexAI = require_llms.VertexAI;
|
|
8
|
-
exports.VertexAIEmbeddings = require_embeddings.VertexAIEmbeddings;
|
|
7
|
+
exports.VertexAIEmbeddings = require_embeddings.VertexAIEmbeddings;
|
package/dist/index.js
CHANGED
package/dist/llms.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
let _langchain_google_webauth = require("@langchain/google-webauth");
|
|
2
|
-
|
|
3
2
|
//#region src/llms.ts
|
|
4
3
|
/**
|
|
5
4
|
* Integration with a Google Vertex AI LLM using
|
|
@@ -19,10 +18,10 @@ var VertexAI = class extends _langchain_google_webauth.GoogleLLM {
|
|
|
19
18
|
...fields,
|
|
20
19
|
platformType: "gcp"
|
|
21
20
|
});
|
|
22
|
-
this._addVersion("@langchain/google-vertexai-web", "2.1.
|
|
21
|
+
this._addVersion("@langchain/google-vertexai-web", "2.1.26-dev-1773698445534");
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
|
-
|
|
26
24
|
//#endregion
|
|
27
25
|
exports.VertexAI = VertexAI;
|
|
26
|
+
|
|
28
27
|
//# sourceMappingURL=llms.cjs.map
|
package/dist/llms.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llms.cjs","names":["GoogleLLM"],"sources":["../src/llms.ts"],"sourcesContent":["import { type GoogleLLMInput, GoogleLLM } from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex LLM class.\n */\nexport interface VertexAIInput extends GoogleLLMInput {}\n\n/**\n * Integration with a Google Vertex AI LLM using\n * the \"@langchain/google-webauth\" package for auth.\n */\nexport class VertexAI extends GoogleLLM {\n lc_namespace = [\"langchain\", \"llms\", \"vertexai\"];\n\n static lc_name() {\n return \"VertexAI\";\n }\n\n constructor(fields?: VertexAIInput) {\n super({\n ...fields,\n platformType: \"gcp\",\n });\n this._addVersion(\"@langchain/google-vertexai-web\", __PKG_VERSION__);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"llms.cjs","names":["GoogleLLM"],"sources":["../src/llms.ts"],"sourcesContent":["import { type GoogleLLMInput, GoogleLLM } from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex LLM class.\n */\nexport interface VertexAIInput extends GoogleLLMInput {}\n\n/**\n * Integration with a Google Vertex AI LLM using\n * the \"@langchain/google-webauth\" package for auth.\n */\nexport class VertexAI extends GoogleLLM {\n lc_namespace = [\"langchain\", \"llms\", \"vertexai\"];\n\n static lc_name() {\n return \"VertexAI\";\n }\n\n constructor(fields?: VertexAIInput) {\n super({\n ...fields,\n platformType: \"gcp\",\n });\n this._addVersion(\"@langchain/google-vertexai-web\", __PKG_VERSION__);\n }\n}\n"],"mappings":";;;;;;AAWA,IAAa,WAAb,cAA8BA,0BAAAA,UAAU;CACtC,eAAe;EAAC;EAAa;EAAQ;EAAW;CAEhD,OAAO,UAAU;AACf,SAAO;;CAGT,YAAY,QAAwB;AAClC,QAAM;GACJ,GAAG;GACH,cAAc;GACf,CAAC;AACF,OAAK,YAAY,kCAAA,2BAAkD"}
|
package/dist/llms.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { GoogleLLM } from "@langchain/google-webauth";
|
|
2
|
-
|
|
3
2
|
//#region src/llms.ts
|
|
4
3
|
/**
|
|
5
4
|
* Integration with a Google Vertex AI LLM using
|
|
@@ -19,10 +18,10 @@ var VertexAI = class extends GoogleLLM {
|
|
|
19
18
|
...fields,
|
|
20
19
|
platformType: "gcp"
|
|
21
20
|
});
|
|
22
|
-
this._addVersion("@langchain/google-vertexai-web", "2.1.
|
|
21
|
+
this._addVersion("@langchain/google-vertexai-web", "2.1.26-dev-1773698445534");
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
|
-
|
|
26
24
|
//#endregion
|
|
27
25
|
export { VertexAI };
|
|
26
|
+
|
|
28
27
|
//# sourceMappingURL=llms.js.map
|
package/dist/llms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llms.js","names":[],"sources":["../src/llms.ts"],"sourcesContent":["import { type GoogleLLMInput, GoogleLLM } from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex LLM class.\n */\nexport interface VertexAIInput extends GoogleLLMInput {}\n\n/**\n * Integration with a Google Vertex AI LLM using\n * the \"@langchain/google-webauth\" package for auth.\n */\nexport class VertexAI extends GoogleLLM {\n lc_namespace = [\"langchain\", \"llms\", \"vertexai\"];\n\n static lc_name() {\n return \"VertexAI\";\n }\n\n constructor(fields?: VertexAIInput) {\n super({\n ...fields,\n platformType: \"gcp\",\n });\n this._addVersion(\"@langchain/google-vertexai-web\", __PKG_VERSION__);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"llms.js","names":[],"sources":["../src/llms.ts"],"sourcesContent":["import { type GoogleLLMInput, GoogleLLM } from \"@langchain/google-webauth\";\n\n/**\n * Input to a Google Vertex LLM class.\n */\nexport interface VertexAIInput extends GoogleLLMInput {}\n\n/**\n * Integration with a Google Vertex AI LLM using\n * the \"@langchain/google-webauth\" package for auth.\n */\nexport class VertexAI extends GoogleLLM {\n lc_namespace = [\"langchain\", \"llms\", \"vertexai\"];\n\n static lc_name() {\n return \"VertexAI\";\n }\n\n constructor(fields?: VertexAIInput) {\n super({\n ...fields,\n platformType: \"gcp\",\n });\n this._addVersion(\"@langchain/google-vertexai-web\", __PKG_VERSION__);\n }\n}\n"],"mappings":";;;;;;AAWA,IAAa,WAAb,cAA8B,UAAU;CACtC,eAAe;EAAC;EAAa;EAAQ;EAAW;CAEhD,OAAO,UAAU;AACf,SAAO;;CAGT,YAAY,QAAwB;AAClC,QAAM;GACJ,GAAG;GACH,cAAc;GACf,CAAC;AACF,OAAK,YAAY,kCAAA,2BAAkD"}
|
package/dist/types.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
var _langchain_google_webauth_types = require("@langchain/google-webauth/types");
|
|
4
|
-
Object.keys(_langchain_google_webauth_types).forEach(function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.keys(_langchain_google_webauth_types).forEach(function(k) {
|
|
3
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _langchain_google_webauth_types[k];
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
9
|
});
|
package/dist/types.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from "@langchain/google-webauth/types"
|
|
2
|
-
|
|
3
|
-
export { };
|
|
1
|
+
export * from "@langchain/google-webauth/types";
|
|
2
|
+
export {};
|
package/dist/utils.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
var _langchain_google_webauth_utils = require("@langchain/google-webauth/utils");
|
|
4
|
-
Object.keys(_langchain_google_webauth_utils).forEach(function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.keys(_langchain_google_webauth_utils).forEach(function(k) {
|
|
3
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _langchain_google_webauth_utils[k];
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
9
|
});
|
package/dist/utils.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from "@langchain/google-webauth/utils"
|
|
2
|
-
|
|
3
|
-
export { };
|
|
1
|
+
export * from "@langchain/google-webauth/utils";
|
|
2
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/google-vertexai-web",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.26-dev-1773698445534",
|
|
4
4
|
"description": "LangChain.js support for Google Vertex AI Web",
|
|
5
5
|
"author": "LangChain",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,26 +14,21 @@
|
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-google-vertexai-web/",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@langchain/google-webauth": "2.1.
|
|
17
|
+
"@langchain/google-webauth": "2.1.26-dev-1773698445534"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@jest/globals": "^30.2.0",
|
|
21
|
-
"@swc/core": "^1.15.18",
|
|
22
|
-
"@swc/jest": "^0.2.29",
|
|
23
20
|
"@tsconfig/recommended": "^1.0.3",
|
|
24
21
|
"dotenv": "^16.3.1",
|
|
25
22
|
"dpdm": "^3.14.0",
|
|
26
23
|
"eslint": "^9.34.0",
|
|
27
|
-
"jest": "^30.2.0",
|
|
28
|
-
"jest-environment-node": "^30.2.0",
|
|
29
24
|
"prettier": "^3.5.0",
|
|
30
|
-
"ts-jest": "^29.4.6",
|
|
31
25
|
"typescript": "~5.8.3",
|
|
26
|
+
"vitest": "^3.2.4",
|
|
32
27
|
"zod": "^3.25.76",
|
|
33
|
-
"@langchain/eslint": "0.1.1",
|
|
34
|
-
"@langchain/google-common": "2.1.25",
|
|
35
28
|
"@langchain/standard-tests": "0.0.23",
|
|
36
|
-
"@langchain/tsconfig": "0.0.1"
|
|
29
|
+
"@langchain/tsconfig": "0.0.1",
|
|
30
|
+
"@langchain/google-common": "2.1.26-dev-1773698445534",
|
|
31
|
+
"@langchain/eslint": "0.1.1"
|
|
37
32
|
},
|
|
38
33
|
"publishConfig": {
|
|
39
34
|
"access": "public"
|
|
@@ -91,10 +86,10 @@
|
|
|
91
86
|
"lint": "pnpm lint:eslint && pnpm lint:dpdm",
|
|
92
87
|
"lint:fix": "pnpm lint:eslint --fix && pnpm lint:dpdm",
|
|
93
88
|
"clean": "rm -rf .turbo dist/",
|
|
94
|
-
"test": "
|
|
95
|
-
"test:watch": "
|
|
96
|
-
"test:single": "
|
|
97
|
-
"test:int": "
|
|
89
|
+
"test": "vitest run",
|
|
90
|
+
"test:watch": "vitest",
|
|
91
|
+
"test:single": "vitest run",
|
|
92
|
+
"test:int": "vitest run --mode int",
|
|
98
93
|
"format": "prettier --write \"src\"",
|
|
99
94
|
"format:check": "prettier --check \"src\""
|
|
100
95
|
}
|