@langchain/openai 1.1.1 → 1.1.3
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 +14 -0
- package/dist/azure/chat_models/common.cjs +4 -9
- package/dist/azure/chat_models/common.cjs.map +1 -1
- package/dist/azure/chat_models/common.d.ts +1 -0
- package/dist/azure/chat_models/common.js +6 -11
- package/dist/azure/chat_models/common.js.map +1 -1
- package/dist/azure/embeddings.cjs +4 -7
- package/dist/azure/embeddings.cjs.map +1 -1
- package/dist/azure/embeddings.js +5 -8
- package/dist/azure/embeddings.js.map +1 -1
- package/dist/azure/llms.cjs +4 -7
- package/dist/azure/llms.cjs.map +1 -1
- package/dist/azure/llms.js +5 -8
- package/dist/azure/llms.js.map +1 -1
- package/dist/chat_models/base.cjs +2 -1
- package/dist/chat_models/base.cjs.map +1 -1
- package/dist/chat_models/base.d.cts +2 -2
- package/dist/chat_models/base.d.ts +2 -2
- package/dist/chat_models/base.js +3 -2
- package/dist/chat_models/base.js.map +1 -1
- package/dist/converters/index.d.ts +2 -0
- package/dist/embeddings.cjs +2 -0
- package/dist/embeddings.cjs.map +1 -1
- package/dist/embeddings.d.cts +4 -2
- package/dist/embeddings.d.ts +4 -2
- package/dist/embeddings.js +3 -1
- package/dist/embeddings.js.map +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2 -2
- package/dist/langchain-core/dist/documents/transformers.d.ts +2 -0
- package/dist/langchain-core/dist/language_models/base.d.ts +2 -0
- package/dist/langchain-core/dist/language_models/chat_models.d.ts +3 -0
- package/dist/langchain-core/dist/messages/index.d.ts +1 -0
- package/dist/langchain-core/dist/messages/transformers.d.ts +3 -0
- package/dist/langchain-core/dist/runnables/config.d.ts +2 -0
- package/dist/langchain-core/dist/tools/index.d.ts +8 -0
- package/dist/langchain-core/dist/tools/types.d.ts +2 -0
- package/dist/langchain-core/dist/tracers/event_stream.d.ts +2 -1
- package/dist/langchain-core/dist/utils/json_schema.d.ts +1 -0
- package/dist/llms.cjs +1 -0
- package/dist/llms.cjs.map +1 -1
- package/dist/llms.d.cts +3 -3
- package/dist/llms.d.ts +3 -3
- package/dist/llms.js +2 -1
- package/dist/llms.js.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/types.d.cts +5 -5
- package/dist/types.d.ts +5 -5
- package/dist/utils/azure.cjs +18 -0
- package/dist/utils/azure.cjs.map +1 -1
- package/dist/utils/azure.d.cts +5 -1
- package/dist/utils/azure.d.ts +5 -1
- package/dist/utils/azure.js +16 -1
- package/dist/utils/azure.js.map +1 -1
- package/package.json +13 -12
- package/dist/azure/chat_models/common.d.cts.map +0 -1
- package/dist/azure/chat_models/common.d.ts.map +0 -1
- package/dist/azure/chat_models/completions.d.cts.map +0 -1
- package/dist/azure/chat_models/completions.d.ts.map +0 -1
- package/dist/azure/chat_models/index.d.cts.map +0 -1
- package/dist/azure/chat_models/index.d.ts.map +0 -1
- package/dist/azure/chat_models/responses.d.cts.map +0 -1
- package/dist/azure/chat_models/responses.d.ts.map +0 -1
- package/dist/azure/embeddings.d.cts.map +0 -1
- package/dist/azure/embeddings.d.ts.map +0 -1
- package/dist/azure/llms.d.cts.map +0 -1
- package/dist/azure/llms.d.ts.map +0 -1
- package/dist/chat_models/base.d.cts.map +0 -1
- package/dist/chat_models/base.d.ts.map +0 -1
- package/dist/chat_models/completions.d.cts.map +0 -1
- package/dist/chat_models/completions.d.ts.map +0 -1
- package/dist/chat_models/index.d.cts.map +0 -1
- package/dist/chat_models/index.d.ts.map +0 -1
- package/dist/chat_models/responses.d.cts.map +0 -1
- package/dist/chat_models/responses.d.ts.map +0 -1
- package/dist/converters/completions.d.cts.map +0 -1
- package/dist/converters/completions.d.ts.map +0 -1
- package/dist/converters/responses.d.cts.map +0 -1
- package/dist/converters/responses.d.ts.map +0 -1
- package/dist/embeddings.d.cts.map +0 -1
- package/dist/embeddings.d.ts.map +0 -1
- package/dist/langchain-core/dist/language_models/chat_models.d.cts.map +0 -1
- package/dist/langchain-core/dist/language_models/chat_models.d.ts.map +0 -1
- package/dist/langchain-core/dist/types/_internal.d.cts.map +0 -1
- package/dist/langchain-core/dist/types/_internal.d.ts.map +0 -1
- package/dist/langchain-core/dist/utils/stream.d.cts.map +0 -1
- package/dist/langchain-core/dist/utils/stream.d.ts.map +0 -1
- package/dist/llms.d.cts.map +0 -1
- package/dist/llms.d.ts.map +0 -1
- package/dist/tools/custom.d.cts.map +0 -1
- package/dist/tools/custom.d.ts.map +0 -1
- package/dist/tools/dalle.d.cts.map +0 -1
- package/dist/tools/dalle.d.ts.map +0 -1
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/azure.d.cts.map +0 -1
- package/dist/utils/azure.d.ts.map +0 -1
- package/dist/utils/client.d.cts.map +0 -1
- package/dist/utils/client.d.ts.map +0 -1
- package/dist/utils/misc.d.cts.map +0 -1
- package/dist/utils/misc.d.ts.map +0 -1
- package/dist/utils/prompts.d.cts.map +0 -1
- package/dist/utils/prompts.d.ts.map +0 -1
- package/dist/utils/tools.d.cts.map +0 -1
- package/dist/utils/tools.d.ts.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAI as OpenAI$1 } from "openai";
|
|
1
|
+
import { ClientOptions, OpenAI as OpenAI$1 } from "openai";
|
|
2
2
|
import { InteropZodObject } from "@langchain/core/utils/types";
|
|
3
3
|
import { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base";
|
|
4
4
|
import { TiktokenModel } from "js-tiktoken/lite";
|
|
@@ -11,6 +11,7 @@ import { ResponseFormatJSONObject, ResponseFormatJSONSchema, ResponseFormatText,
|
|
|
11
11
|
*/
|
|
12
12
|
type OpenAIChatModelId = OpenAI$1.ChatModel | (string & NonNullable<unknown>);
|
|
13
13
|
type OpenAIVerbosityParam = "low" | "medium" | "high" | null;
|
|
14
|
+
type OpenAIApiKey = ClientOptions["apiKey"];
|
|
14
15
|
declare interface OpenAIBaseInput {
|
|
15
16
|
/** Sampling temperature to use */
|
|
16
17
|
temperature: number;
|
|
@@ -74,12 +75,12 @@ declare interface OpenAIBaseInput {
|
|
|
74
75
|
* `OPENAI_API_KEY` environment variable.
|
|
75
76
|
* Alias for `apiKey`
|
|
76
77
|
*/
|
|
77
|
-
openAIApiKey?:
|
|
78
|
+
openAIApiKey?: OpenAIApiKey;
|
|
78
79
|
/**
|
|
79
80
|
* API key to use when making requests to OpenAI. Defaults to the value of
|
|
80
81
|
* `OPENAI_API_KEY` environment variable.
|
|
81
82
|
*/
|
|
82
|
-
apiKey?:
|
|
83
|
+
apiKey?: OpenAIApiKey;
|
|
83
84
|
/**
|
|
84
85
|
* The verbosity of the model's response.
|
|
85
86
|
*/
|
|
@@ -228,7 +229,6 @@ interface AzureOpenAIInput {
|
|
|
228
229
|
azureADTokenProvider?: () => Promise<string>;
|
|
229
230
|
}
|
|
230
231
|
interface AzureOpenAIChatInput extends OpenAIChatInput, AzureOpenAIInput {
|
|
231
|
-
openAIApiKey?: string;
|
|
232
232
|
openAIApiVersion?: string;
|
|
233
233
|
openAIBasePath?: string;
|
|
234
234
|
deploymentName?: string;
|
|
@@ -259,5 +259,5 @@ type ChatOpenAIReasoningSummary = Omit<OpenAI$1.Responses.ResponseReasoningItem,
|
|
|
259
259
|
type ChatOpenAIResponseFormat = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatTextGrammar | ResponseFormatTextPython | ChatOpenAIResponseFormatJSONSchema;
|
|
260
260
|
type ResponseFormatConfiguration = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema;
|
|
261
261
|
//#endregion
|
|
262
|
-
export { AzureOpenAIChatInput, AzureOpenAIInput, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, OpenAIBaseInput, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAICoreRequestOptions, OpenAIInput, OpenAIVerbosityParam, ResponseFormatConfiguration, type TiktokenModel };
|
|
262
|
+
export { AzureOpenAIChatInput, AzureOpenAIInput, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, OpenAIApiKey, OpenAIBaseInput, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAICoreRequestOptions, OpenAIInput, OpenAIVerbosityParam, ResponseFormatConfiguration, type TiktokenModel };
|
|
263
263
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/utils/azure.cjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
1
2
|
const require_misc = require('./misc.cjs');
|
|
3
|
+
const __langchain_core_utils_env = require_rolldown_runtime.__toESM(require("@langchain/core/utils/env"));
|
|
2
4
|
|
|
3
5
|
//#region src/utils/azure.ts
|
|
4
6
|
/**
|
|
@@ -81,9 +83,25 @@ function normalizeHeaders(headers) {
|
|
|
81
83
|
});
|
|
82
84
|
return Object.fromEntries(output.entries());
|
|
83
85
|
}
|
|
86
|
+
function getFormattedEnv() {
|
|
87
|
+
let env = (0, __langchain_core_utils_env.getEnv)();
|
|
88
|
+
if (env === "node" || env === "deno") env = `(${env}/${process.version}; ${process.platform}; ${process.arch})`;
|
|
89
|
+
return env;
|
|
90
|
+
}
|
|
91
|
+
function getHeadersWithUserAgent(headers, isAzure = false, version = "1.0.0") {
|
|
92
|
+
const normalizedHeaders = normalizeHeaders(headers);
|
|
93
|
+
const env = getFormattedEnv();
|
|
94
|
+
const library = `langchainjs${isAzure ? "-azure" : ""}-openai`;
|
|
95
|
+
return {
|
|
96
|
+
...normalizedHeaders,
|
|
97
|
+
"User-Agent": normalizedHeaders["User-Agent"] ? `${library}/${version} (${env})${normalizedHeaders["User-Agent"]}` : `${library}/${version} (${env})`
|
|
98
|
+
};
|
|
99
|
+
}
|
|
84
100
|
|
|
85
101
|
//#endregion
|
|
86
102
|
exports.getEndpoint = getEndpoint;
|
|
103
|
+
exports.getFormattedEnv = getFormattedEnv;
|
|
104
|
+
exports.getHeadersWithUserAgent = getHeadersWithUserAgent;
|
|
87
105
|
exports.isHeaders = isHeaders;
|
|
88
106
|
exports.normalizeHeaders = normalizeHeaders;
|
|
89
107
|
//# sourceMappingURL=azure.cjs.map
|
package/dist/utils/azure.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azure.cjs","names":["config: OpenAIEndpointConfig","headers: unknown","headers: HeadersLike","iife","entries: [string, string][]"],"sources":["../../src/utils/azure.ts"],"sourcesContent":["import { iife } from \"./misc.js\";\n\nexport interface OpenAIEndpointConfig {\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIBasePath?: string;\n baseURL?: string | null;\n azureOpenAIEndpoint?: string;\n}\n\n/**\n * This function generates an endpoint URL for (Azure) OpenAI\n * based on the configuration parameters provided.\n *\n * @param {OpenAIEndpointConfig} config - The configuration object for the (Azure) endpoint.\n *\n * @property {string} config.azureOpenAIApiDeploymentName - The deployment name of Azure OpenAI.\n * @property {string} config.azureOpenAIApiInstanceName - The instance name of Azure OpenAI, e.g. `example-resource`.\n * @property {string} config.azureOpenAIApiKey - The API Key for Azure OpenAI.\n * @property {string} config.azureOpenAIBasePath - The base path for Azure OpenAI, e.g. `https://example-resource.azure.openai.com/openai/deployments/`.\n * @property {string} config.baseURL - Some other custom base path URL.\n * @property {string} config.azureOpenAIEndpoint - The endpoint for the Azure OpenAI instance, e.g. `https://example-resource.azure.openai.com/`.\n *\n * The function operates as follows:\n * - If both `azureOpenAIBasePath` and `azureOpenAIApiDeploymentName` (plus `azureOpenAIApiKey`) are provided, it returns an URL combining these two parameters (`${azureOpenAIBasePath}/${azureOpenAIApiDeploymentName}`).\n * - If both `azureOpenAIEndpoint` and `azureOpenAIApiDeploymentName` (plus `azureOpenAIApiKey`) are provided, it returns an URL combining these two parameters (`${azureOpenAIEndpoint}/openai/deployments/${azureOpenAIApiDeploymentName}`).\n * - If `azureOpenAIApiKey` is provided, it checks for `azureOpenAIApiInstanceName` and `azureOpenAIApiDeploymentName` and throws an error if any of these is missing. If both are provided, it generates an URL incorporating these parameters.\n * - If none of the above conditions are met, return any custom `baseURL`.\n * - The function returns the generated URL as a string, or undefined if no custom paths are specified.\n *\n * @throws Will throw an error if the necessary parameters for generating the URL are missing.\n *\n * @returns {string | undefined} The generated (Azure) OpenAI endpoint URL.\n */\nexport function getEndpoint(config: OpenAIEndpointConfig) {\n const {\n azureOpenAIApiDeploymentName,\n azureOpenAIApiInstanceName,\n azureOpenAIApiKey,\n azureOpenAIBasePath,\n baseURL,\n azureADTokenProvider,\n azureOpenAIEndpoint,\n } = config;\n\n if (\n (azureOpenAIApiKey || azureADTokenProvider) &&\n azureOpenAIBasePath &&\n azureOpenAIApiDeploymentName\n ) {\n return `${azureOpenAIBasePath}/${azureOpenAIApiDeploymentName}`;\n }\n if (\n (azureOpenAIApiKey || azureADTokenProvider) &&\n azureOpenAIEndpoint &&\n azureOpenAIApiDeploymentName\n ) {\n return `${azureOpenAIEndpoint}/openai/deployments/${azureOpenAIApiDeploymentName}`;\n }\n\n if (azureOpenAIApiKey || azureADTokenProvider) {\n if (!azureOpenAIApiInstanceName) {\n throw new Error(\n \"azureOpenAIApiInstanceName is required when using azureOpenAIApiKey\"\n );\n }\n if (!azureOpenAIApiDeploymentName) {\n throw new Error(\n \"azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey\"\n );\n }\n return `https://${azureOpenAIApiInstanceName}.openai.azure.com/openai/deployments/${azureOpenAIApiDeploymentName}`;\n }\n\n return baseURL;\n}\n\ntype HeaderValue = string | undefined | null;\nexport type HeadersLike =\n | Headers\n | readonly HeaderValue[][]\n | Record<string, HeaderValue | readonly HeaderValue[]>\n | undefined\n | null\n // NullableHeaders\n | { values: Headers; [key: string]: unknown };\n\nexport function isHeaders(headers: unknown): headers is Headers {\n return (\n typeof Headers !== \"undefined\" &&\n headers !== null &&\n typeof headers === \"object\" &&\n Object.prototype.toString.call(headers) === \"[object Headers]\"\n );\n}\n\n/**\n * Normalizes various header formats into a consistent Record format.\n *\n * This function accepts headers in multiple formats and converts them to a\n * Record<string, HeaderValue | readonly HeaderValue[]> for consistent handling.\n *\n * @param headers - The headers to normalize. Can be:\n * - A Headers instance\n * - An array of [key, value] pairs\n * - A plain object with string keys\n * - A NullableHeaders-like object with a 'values' property containing Headers\n * - null or undefined\n * @returns A normalized Record containing the header key-value pairs\n *\n * @example\n * ```ts\n * // With Headers instance\n * const headers1 = new Headers([['content-type', 'application/json']]);\n * const normalized1 = normalizeHeaders(headers1);\n *\n * // With plain object\n * const headers2 = { 'content-type': 'application/json' };\n * const normalized2 = normalizeHeaders(headers2);\n *\n * // With array of pairs\n * const headers3 = [['content-type', 'application/json']];\n * const normalized3 = normalizeHeaders(headers3);\n * ```\n */\nexport function normalizeHeaders(\n headers: HeadersLike\n): Record<string, HeaderValue | readonly HeaderValue[]> {\n const output = iife(() => {\n // If headers is a Headers instance\n if (isHeaders(headers)) {\n return headers;\n }\n // If headers is an array of [key, value] pairs\n else if (Array.isArray(headers)) {\n return new Headers(headers);\n }\n // If headers is a NullableHeaders-like object (has 'values' property that is a Headers)\n else if (\n typeof headers === \"object\" &&\n headers !== null &&\n \"values\" in headers &&\n isHeaders(headers.values)\n ) {\n return headers.values;\n }\n // If headers is a plain object\n else if (typeof headers === \"object\" && headers !== null) {\n const entries: [string, string][] = Object.entries(headers)\n .filter(([, v]) => typeof v === \"string\")\n .map(([k, v]) => [k, v as string]);\n return new Headers(entries);\n }\n return new Headers();\n });\n\n return Object.fromEntries(output.entries());\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"azure.cjs","names":["config: OpenAIEndpointConfig","headers: unknown","headers: HeadersLike","iife","entries: [string, string][]"],"sources":["../../src/utils/azure.ts"],"sourcesContent":["import { getEnv } from \"@langchain/core/utils/env\";\nimport { iife } from \"./misc.js\";\n\nexport interface OpenAIEndpointConfig {\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIBasePath?: string;\n baseURL?: string | null;\n azureOpenAIEndpoint?: string;\n}\n\n/**\n * This function generates an endpoint URL for (Azure) OpenAI\n * based on the configuration parameters provided.\n *\n * @param {OpenAIEndpointConfig} config - The configuration object for the (Azure) endpoint.\n *\n * @property {string} config.azureOpenAIApiDeploymentName - The deployment name of Azure OpenAI.\n * @property {string} config.azureOpenAIApiInstanceName - The instance name of Azure OpenAI, e.g. `example-resource`.\n * @property {string} config.azureOpenAIApiKey - The API Key for Azure OpenAI.\n * @property {string} config.azureOpenAIBasePath - The base path for Azure OpenAI, e.g. `https://example-resource.azure.openai.com/openai/deployments/`.\n * @property {string} config.baseURL - Some other custom base path URL.\n * @property {string} config.azureOpenAIEndpoint - The endpoint for the Azure OpenAI instance, e.g. `https://example-resource.azure.openai.com/`.\n *\n * The function operates as follows:\n * - If both `azureOpenAIBasePath` and `azureOpenAIApiDeploymentName` (plus `azureOpenAIApiKey`) are provided, it returns an URL combining these two parameters (`${azureOpenAIBasePath}/${azureOpenAIApiDeploymentName}`).\n * - If both `azureOpenAIEndpoint` and `azureOpenAIApiDeploymentName` (plus `azureOpenAIApiKey`) are provided, it returns an URL combining these two parameters (`${azureOpenAIEndpoint}/openai/deployments/${azureOpenAIApiDeploymentName}`).\n * - If `azureOpenAIApiKey` is provided, it checks for `azureOpenAIApiInstanceName` and `azureOpenAIApiDeploymentName` and throws an error if any of these is missing. If both are provided, it generates an URL incorporating these parameters.\n * - If none of the above conditions are met, return any custom `baseURL`.\n * - The function returns the generated URL as a string, or undefined if no custom paths are specified.\n *\n * @throws Will throw an error if the necessary parameters for generating the URL are missing.\n *\n * @returns {string | undefined} The generated (Azure) OpenAI endpoint URL.\n */\nexport function getEndpoint(config: OpenAIEndpointConfig) {\n const {\n azureOpenAIApiDeploymentName,\n azureOpenAIApiInstanceName,\n azureOpenAIApiKey,\n azureOpenAIBasePath,\n baseURL,\n azureADTokenProvider,\n azureOpenAIEndpoint,\n } = config;\n\n if (\n (azureOpenAIApiKey || azureADTokenProvider) &&\n azureOpenAIBasePath &&\n azureOpenAIApiDeploymentName\n ) {\n return `${azureOpenAIBasePath}/${azureOpenAIApiDeploymentName}`;\n }\n if (\n (azureOpenAIApiKey || azureADTokenProvider) &&\n azureOpenAIEndpoint &&\n azureOpenAIApiDeploymentName\n ) {\n return `${azureOpenAIEndpoint}/openai/deployments/${azureOpenAIApiDeploymentName}`;\n }\n\n if (azureOpenAIApiKey || azureADTokenProvider) {\n if (!azureOpenAIApiInstanceName) {\n throw new Error(\n \"azureOpenAIApiInstanceName is required when using azureOpenAIApiKey\"\n );\n }\n if (!azureOpenAIApiDeploymentName) {\n throw new Error(\n \"azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey\"\n );\n }\n return `https://${azureOpenAIApiInstanceName}.openai.azure.com/openai/deployments/${azureOpenAIApiDeploymentName}`;\n }\n\n return baseURL;\n}\n\ntype HeaderValue = string | undefined | null;\nexport type HeadersLike =\n | Headers\n | readonly HeaderValue[][]\n | Record<string, HeaderValue | readonly HeaderValue[]>\n | undefined\n | null\n // NullableHeaders\n | { values: Headers; [key: string]: unknown };\n\nexport function isHeaders(headers: unknown): headers is Headers {\n return (\n typeof Headers !== \"undefined\" &&\n headers !== null &&\n typeof headers === \"object\" &&\n Object.prototype.toString.call(headers) === \"[object Headers]\"\n );\n}\n\n/**\n * Normalizes various header formats into a consistent Record format.\n *\n * This function accepts headers in multiple formats and converts them to a\n * Record<string, HeaderValue | readonly HeaderValue[]> for consistent handling.\n *\n * @param headers - The headers to normalize. Can be:\n * - A Headers instance\n * - An array of [key, value] pairs\n * - A plain object with string keys\n * - A NullableHeaders-like object with a 'values' property containing Headers\n * - null or undefined\n * @returns A normalized Record containing the header key-value pairs\n *\n * @example\n * ```ts\n * // With Headers instance\n * const headers1 = new Headers([['content-type', 'application/json']]);\n * const normalized1 = normalizeHeaders(headers1);\n *\n * // With plain object\n * const headers2 = { 'content-type': 'application/json' };\n * const normalized2 = normalizeHeaders(headers2);\n *\n * // With array of pairs\n * const headers3 = [['content-type', 'application/json']];\n * const normalized3 = normalizeHeaders(headers3);\n * ```\n */\nexport function normalizeHeaders(\n headers: HeadersLike\n): Record<string, HeaderValue | readonly HeaderValue[]> {\n const output = iife(() => {\n // If headers is a Headers instance\n if (isHeaders(headers)) {\n return headers;\n }\n // If headers is an array of [key, value] pairs\n else if (Array.isArray(headers)) {\n return new Headers(headers);\n }\n // If headers is a NullableHeaders-like object (has 'values' property that is a Headers)\n else if (\n typeof headers === \"object\" &&\n headers !== null &&\n \"values\" in headers &&\n isHeaders(headers.values)\n ) {\n return headers.values;\n }\n // If headers is a plain object\n else if (typeof headers === \"object\" && headers !== null) {\n const entries: [string, string][] = Object.entries(headers)\n .filter(([, v]) => typeof v === \"string\")\n .map(([k, v]) => [k, v as string]);\n return new Headers(entries);\n }\n return new Headers();\n });\n\n return Object.fromEntries(output.entries());\n}\n\nexport function getFormattedEnv() {\n let env = getEnv();\n if (env === \"node\" || env === \"deno\") {\n env = `(${env}/${process.version}; ${process.platform}; ${process.arch})`;\n }\n return env;\n}\n\n// Note: ideally version would be imported from package.json, but there's\n// currently no good way to do that for all supported environments (Node, Deno, Browser).\nexport function getHeadersWithUserAgent(\n headers: HeadersLike,\n isAzure = false,\n version = \"1.0.0\"\n): Record<string, string> {\n const normalizedHeaders = normalizeHeaders(headers);\n const env = getFormattedEnv();\n const library = `langchainjs${isAzure ? \"-azure\" : \"\"}-openai`;\n return {\n ...normalizedHeaders,\n \"User-Agent\": normalizedHeaders[\"User-Agent\"]\n ? `${library}/${version} (${env})${normalizedHeaders[\"User-Agent\"]}`\n : `${library}/${version} (${env})`,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,YAAYA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AM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,QAAQ,QAAQ,EAAE,EAAE,QAAQ,SAAS,EAAE,EAAE,QAAQ,KAAK,CAAC,CAAC;AAE3E,QAAO;AACR;AAID,SAAgB,wBACdF,SACA,UAAU,OACV,UAAU,SACc;CACxB,MAAM,oBAAoB,iBAAiB,QAAQ;CACnD,MAAM,MAAM,iBAAiB;CAC7B,MAAM,UAAU,CAAC,WAAW,EAAE,UAAU,WAAW,GAAG,OAAO,CAAC;AAC9D,QAAO;EACL,GAAG;EACH,cAAc,kBAAkB,gBAC5B,GAAG,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,EAAE,kBAAkB,eAAe,GAClE,GAAG,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;CACrC;AACF"}
|
package/dist/utils/azure.d.cts
CHANGED
|
@@ -71,6 +71,10 @@ declare function isHeaders(headers: unknown): headers is Headers;
|
|
|
71
71
|
* ```
|
|
72
72
|
*/
|
|
73
73
|
declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;
|
|
74
|
+
declare function getFormattedEnv(): string;
|
|
75
|
+
// Note: ideally version would be imported from package.json, but there's
|
|
76
|
+
// currently no good way to do that for all supported environments (Node, Deno, Browser).
|
|
77
|
+
declare function getHeadersWithUserAgent(headers: HeadersLike, isAzure?: boolean, version?: string): Record<string, string>;
|
|
74
78
|
//#endregion
|
|
75
|
-
export { HeadersLike, OpenAIEndpointConfig, getEndpoint, isHeaders, normalizeHeaders };
|
|
79
|
+
export { HeadersLike, OpenAIEndpointConfig, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders };
|
|
76
80
|
//# sourceMappingURL=azure.d.cts.map
|
package/dist/utils/azure.d.ts
CHANGED
|
@@ -71,6 +71,10 @@ declare function isHeaders(headers: unknown): headers is Headers;
|
|
|
71
71
|
* ```
|
|
72
72
|
*/
|
|
73
73
|
declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;
|
|
74
|
+
declare function getFormattedEnv(): string;
|
|
75
|
+
// Note: ideally version would be imported from package.json, but there's
|
|
76
|
+
// currently no good way to do that for all supported environments (Node, Deno, Browser).
|
|
77
|
+
declare function getHeadersWithUserAgent(headers: HeadersLike, isAzure?: boolean, version?: string): Record<string, string>;
|
|
74
78
|
//#endregion
|
|
75
|
-
export { HeadersLike, OpenAIEndpointConfig, getEndpoint, isHeaders, normalizeHeaders };
|
|
79
|
+
export { HeadersLike, OpenAIEndpointConfig, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders };
|
|
76
80
|
//# sourceMappingURL=azure.d.ts.map
|
package/dist/utils/azure.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { iife } from "./misc.js";
|
|
2
|
+
import { getEnv } from "@langchain/core/utils/env";
|
|
2
3
|
|
|
3
4
|
//#region src/utils/azure.ts
|
|
4
5
|
/**
|
|
@@ -81,7 +82,21 @@ function normalizeHeaders(headers) {
|
|
|
81
82
|
});
|
|
82
83
|
return Object.fromEntries(output.entries());
|
|
83
84
|
}
|
|
85
|
+
function getFormattedEnv() {
|
|
86
|
+
let env = getEnv();
|
|
87
|
+
if (env === "node" || env === "deno") env = `(${env}/${process.version}; ${process.platform}; ${process.arch})`;
|
|
88
|
+
return env;
|
|
89
|
+
}
|
|
90
|
+
function getHeadersWithUserAgent(headers, isAzure = false, version = "1.0.0") {
|
|
91
|
+
const normalizedHeaders = normalizeHeaders(headers);
|
|
92
|
+
const env = getFormattedEnv();
|
|
93
|
+
const library = `langchainjs${isAzure ? "-azure" : ""}-openai`;
|
|
94
|
+
return {
|
|
95
|
+
...normalizedHeaders,
|
|
96
|
+
"User-Agent": normalizedHeaders["User-Agent"] ? `${library}/${version} (${env})${normalizedHeaders["User-Agent"]}` : `${library}/${version} (${env})`
|
|
97
|
+
};
|
|
98
|
+
}
|
|
84
99
|
|
|
85
100
|
//#endregion
|
|
86
|
-
export { getEndpoint, isHeaders, normalizeHeaders };
|
|
101
|
+
export { getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders };
|
|
87
102
|
//# sourceMappingURL=azure.js.map
|
package/dist/utils/azure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azure.js","names":["config: OpenAIEndpointConfig","headers: unknown","headers: HeadersLike","entries: [string, string][]"],"sources":["../../src/utils/azure.ts"],"sourcesContent":["import { iife } from \"./misc.js\";\n\nexport interface OpenAIEndpointConfig {\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIBasePath?: string;\n baseURL?: string | null;\n azureOpenAIEndpoint?: string;\n}\n\n/**\n * This function generates an endpoint URL for (Azure) OpenAI\n * based on the configuration parameters provided.\n *\n * @param {OpenAIEndpointConfig} config - The configuration object for the (Azure) endpoint.\n *\n * @property {string} config.azureOpenAIApiDeploymentName - The deployment name of Azure OpenAI.\n * @property {string} config.azureOpenAIApiInstanceName - The instance name of Azure OpenAI, e.g. `example-resource`.\n * @property {string} config.azureOpenAIApiKey - The API Key for Azure OpenAI.\n * @property {string} config.azureOpenAIBasePath - The base path for Azure OpenAI, e.g. `https://example-resource.azure.openai.com/openai/deployments/`.\n * @property {string} config.baseURL - Some other custom base path URL.\n * @property {string} config.azureOpenAIEndpoint - The endpoint for the Azure OpenAI instance, e.g. `https://example-resource.azure.openai.com/`.\n *\n * The function operates as follows:\n * - If both `azureOpenAIBasePath` and `azureOpenAIApiDeploymentName` (plus `azureOpenAIApiKey`) are provided, it returns an URL combining these two parameters (`${azureOpenAIBasePath}/${azureOpenAIApiDeploymentName}`).\n * - If both `azureOpenAIEndpoint` and `azureOpenAIApiDeploymentName` (plus `azureOpenAIApiKey`) are provided, it returns an URL combining these two parameters (`${azureOpenAIEndpoint}/openai/deployments/${azureOpenAIApiDeploymentName}`).\n * - If `azureOpenAIApiKey` is provided, it checks for `azureOpenAIApiInstanceName` and `azureOpenAIApiDeploymentName` and throws an error if any of these is missing. If both are provided, it generates an URL incorporating these parameters.\n * - If none of the above conditions are met, return any custom `baseURL`.\n * - The function returns the generated URL as a string, or undefined if no custom paths are specified.\n *\n * @throws Will throw an error if the necessary parameters for generating the URL are missing.\n *\n * @returns {string | undefined} The generated (Azure) OpenAI endpoint URL.\n */\nexport function getEndpoint(config: OpenAIEndpointConfig) {\n const {\n azureOpenAIApiDeploymentName,\n azureOpenAIApiInstanceName,\n azureOpenAIApiKey,\n azureOpenAIBasePath,\n baseURL,\n azureADTokenProvider,\n azureOpenAIEndpoint,\n } = config;\n\n if (\n (azureOpenAIApiKey || azureADTokenProvider) &&\n azureOpenAIBasePath &&\n azureOpenAIApiDeploymentName\n ) {\n return `${azureOpenAIBasePath}/${azureOpenAIApiDeploymentName}`;\n }\n if (\n (azureOpenAIApiKey || azureADTokenProvider) &&\n azureOpenAIEndpoint &&\n azureOpenAIApiDeploymentName\n ) {\n return `${azureOpenAIEndpoint}/openai/deployments/${azureOpenAIApiDeploymentName}`;\n }\n\n if (azureOpenAIApiKey || azureADTokenProvider) {\n if (!azureOpenAIApiInstanceName) {\n throw new Error(\n \"azureOpenAIApiInstanceName is required when using azureOpenAIApiKey\"\n );\n }\n if (!azureOpenAIApiDeploymentName) {\n throw new Error(\n \"azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey\"\n );\n }\n return `https://${azureOpenAIApiInstanceName}.openai.azure.com/openai/deployments/${azureOpenAIApiDeploymentName}`;\n }\n\n return baseURL;\n}\n\ntype HeaderValue = string | undefined | null;\nexport type HeadersLike =\n | Headers\n | readonly HeaderValue[][]\n | Record<string, HeaderValue | readonly HeaderValue[]>\n | undefined\n | null\n // NullableHeaders\n | { values: Headers; [key: string]: unknown };\n\nexport function isHeaders(headers: unknown): headers is Headers {\n return (\n typeof Headers !== \"undefined\" &&\n headers !== null &&\n typeof headers === \"object\" &&\n Object.prototype.toString.call(headers) === \"[object Headers]\"\n );\n}\n\n/**\n * Normalizes various header formats into a consistent Record format.\n *\n * This function accepts headers in multiple formats and converts them to a\n * Record<string, HeaderValue | readonly HeaderValue[]> for consistent handling.\n *\n * @param headers - The headers to normalize. Can be:\n * - A Headers instance\n * - An array of [key, value] pairs\n * - A plain object with string keys\n * - A NullableHeaders-like object with a 'values' property containing Headers\n * - null or undefined\n * @returns A normalized Record containing the header key-value pairs\n *\n * @example\n * ```ts\n * // With Headers instance\n * const headers1 = new Headers([['content-type', 'application/json']]);\n * const normalized1 = normalizeHeaders(headers1);\n *\n * // With plain object\n * const headers2 = { 'content-type': 'application/json' };\n * const normalized2 = normalizeHeaders(headers2);\n *\n * // With array of pairs\n * const headers3 = [['content-type', 'application/json']];\n * const normalized3 = normalizeHeaders(headers3);\n * ```\n */\nexport function normalizeHeaders(\n headers: HeadersLike\n): Record<string, HeaderValue | readonly HeaderValue[]> {\n const output = iife(() => {\n // If headers is a Headers instance\n if (isHeaders(headers)) {\n return headers;\n }\n // If headers is an array of [key, value] pairs\n else if (Array.isArray(headers)) {\n return new Headers(headers);\n }\n // If headers is a NullableHeaders-like object (has 'values' property that is a Headers)\n else if (\n typeof headers === \"object\" &&\n headers !== null &&\n \"values\" in headers &&\n isHeaders(headers.values)\n ) {\n return headers.values;\n }\n // If headers is a plain object\n else if (typeof headers === \"object\" && headers !== null) {\n const entries: [string, string][] = Object.entries(headers)\n .filter(([, v]) => typeof v === \"string\")\n .map(([k, v]) => [k, v as string]);\n return new Headers(entries);\n }\n return new Headers();\n });\n\n return Object.fromEntries(output.entries());\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"azure.js","names":["config: OpenAIEndpointConfig","headers: unknown","headers: HeadersLike","entries: [string, string][]"],"sources":["../../src/utils/azure.ts"],"sourcesContent":["import { getEnv } from \"@langchain/core/utils/env\";\nimport { iife } from \"./misc.js\";\n\nexport interface OpenAIEndpointConfig {\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIBasePath?: string;\n baseURL?: string | null;\n azureOpenAIEndpoint?: string;\n}\n\n/**\n * This function generates an endpoint URL for (Azure) OpenAI\n * based on the configuration parameters provided.\n *\n * @param {OpenAIEndpointConfig} config - The configuration object for the (Azure) endpoint.\n *\n * @property {string} config.azureOpenAIApiDeploymentName - The deployment name of Azure OpenAI.\n * @property {string} config.azureOpenAIApiInstanceName - The instance name of Azure OpenAI, e.g. `example-resource`.\n * @property {string} config.azureOpenAIApiKey - The API Key for Azure OpenAI.\n * @property {string} config.azureOpenAIBasePath - The base path for Azure OpenAI, e.g. `https://example-resource.azure.openai.com/openai/deployments/`.\n * @property {string} config.baseURL - Some other custom base path URL.\n * @property {string} config.azureOpenAIEndpoint - The endpoint for the Azure OpenAI instance, e.g. `https://example-resource.azure.openai.com/`.\n *\n * The function operates as follows:\n * - If both `azureOpenAIBasePath` and `azureOpenAIApiDeploymentName` (plus `azureOpenAIApiKey`) are provided, it returns an URL combining these two parameters (`${azureOpenAIBasePath}/${azureOpenAIApiDeploymentName}`).\n * - If both `azureOpenAIEndpoint` and `azureOpenAIApiDeploymentName` (plus `azureOpenAIApiKey`) are provided, it returns an URL combining these two parameters (`${azureOpenAIEndpoint}/openai/deployments/${azureOpenAIApiDeploymentName}`).\n * - If `azureOpenAIApiKey` is provided, it checks for `azureOpenAIApiInstanceName` and `azureOpenAIApiDeploymentName` and throws an error if any of these is missing. If both are provided, it generates an URL incorporating these parameters.\n * - If none of the above conditions are met, return any custom `baseURL`.\n * - The function returns the generated URL as a string, or undefined if no custom paths are specified.\n *\n * @throws Will throw an error if the necessary parameters for generating the URL are missing.\n *\n * @returns {string | undefined} The generated (Azure) OpenAI endpoint URL.\n */\nexport function getEndpoint(config: OpenAIEndpointConfig) {\n const {\n azureOpenAIApiDeploymentName,\n azureOpenAIApiInstanceName,\n azureOpenAIApiKey,\n azureOpenAIBasePath,\n baseURL,\n azureADTokenProvider,\n azureOpenAIEndpoint,\n } = config;\n\n if (\n (azureOpenAIApiKey || azureADTokenProvider) &&\n azureOpenAIBasePath &&\n azureOpenAIApiDeploymentName\n ) {\n return `${azureOpenAIBasePath}/${azureOpenAIApiDeploymentName}`;\n }\n if (\n (azureOpenAIApiKey || azureADTokenProvider) &&\n azureOpenAIEndpoint &&\n azureOpenAIApiDeploymentName\n ) {\n return `${azureOpenAIEndpoint}/openai/deployments/${azureOpenAIApiDeploymentName}`;\n }\n\n if (azureOpenAIApiKey || azureADTokenProvider) {\n if (!azureOpenAIApiInstanceName) {\n throw new Error(\n \"azureOpenAIApiInstanceName is required when using azureOpenAIApiKey\"\n );\n }\n if (!azureOpenAIApiDeploymentName) {\n throw new Error(\n \"azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey\"\n );\n }\n return `https://${azureOpenAIApiInstanceName}.openai.azure.com/openai/deployments/${azureOpenAIApiDeploymentName}`;\n }\n\n return baseURL;\n}\n\ntype HeaderValue = string | undefined | null;\nexport type HeadersLike =\n | Headers\n | readonly HeaderValue[][]\n | Record<string, HeaderValue | readonly HeaderValue[]>\n | undefined\n | null\n // NullableHeaders\n | { values: Headers; [key: string]: unknown };\n\nexport function isHeaders(headers: unknown): headers is Headers {\n return (\n typeof Headers !== \"undefined\" &&\n headers !== null &&\n typeof headers === \"object\" &&\n Object.prototype.toString.call(headers) === \"[object Headers]\"\n );\n}\n\n/**\n * Normalizes various header formats into a consistent Record format.\n *\n * This function accepts headers in multiple formats and converts them to a\n * Record<string, HeaderValue | readonly HeaderValue[]> for consistent handling.\n *\n * @param headers - The headers to normalize. Can be:\n * - A Headers instance\n * - An array of [key, value] pairs\n * - A plain object with string keys\n * - A NullableHeaders-like object with a 'values' property containing Headers\n * - null or undefined\n * @returns A normalized Record containing the header key-value pairs\n *\n * @example\n * ```ts\n * // With Headers instance\n * const headers1 = new Headers([['content-type', 'application/json']]);\n * const normalized1 = normalizeHeaders(headers1);\n *\n * // With plain object\n * const headers2 = { 'content-type': 'application/json' };\n * const normalized2 = normalizeHeaders(headers2);\n *\n * // With array of pairs\n * const headers3 = [['content-type', 'application/json']];\n * const normalized3 = normalizeHeaders(headers3);\n * ```\n */\nexport function normalizeHeaders(\n headers: HeadersLike\n): Record<string, HeaderValue | readonly HeaderValue[]> {\n const output = iife(() => {\n // If headers is a Headers instance\n if (isHeaders(headers)) {\n return headers;\n }\n // If headers is an array of [key, value] pairs\n else if (Array.isArray(headers)) {\n return new Headers(headers);\n }\n // If headers is a NullableHeaders-like object (has 'values' property that is a Headers)\n else if (\n typeof headers === \"object\" &&\n headers !== null &&\n \"values\" in headers &&\n isHeaders(headers.values)\n ) {\n return headers.values;\n }\n // If headers is a plain object\n else if (typeof headers === \"object\" && headers !== null) {\n const entries: [string, string][] = Object.entries(headers)\n .filter(([, v]) => typeof v === \"string\")\n .map(([k, v]) => [k, v as string]);\n return new Headers(entries);\n }\n return new Headers();\n });\n\n return Object.fromEntries(output.entries());\n}\n\nexport function getFormattedEnv() {\n let env = getEnv();\n if (env === \"node\" || env === \"deno\") {\n env = `(${env}/${process.version}; ${process.platform}; ${process.arch})`;\n }\n return env;\n}\n\n// Note: ideally version would be imported from package.json, but there's\n// currently no good way to do that for all supported environments (Node, Deno, Browser).\nexport function getHeadersWithUserAgent(\n headers: HeadersLike,\n isAzure = false,\n version = \"1.0.0\"\n): Record<string, string> {\n const normalizedHeaders = normalizeHeaders(headers);\n const env = getFormattedEnv();\n const library = `langchainjs${isAzure ? \"-azure\" : \"\"}-openai`;\n return {\n ...normalizedHeaders,\n \"User-Agent\": normalizedHeaders[\"User-Agent\"]\n ? `${library}/${version} (${env})${normalizedHeaders[\"User-Agent\"]}`\n : `${library}/${version} (${env})`,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,YAAYA,QAA8B;CACxD,MAAM,EACJ,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IAAI,CAAC,EAAE,QAAQ,QAAQ,EAAE,EAAE,QAAQ,SAAS,EAAE,EAAE,QAAQ,KAAK,CAAC,CAAC;AAE3E,QAAO;AACR;AAID,SAAgB,wBACdD,SACA,UAAU,OACV,UAAU,SACc;CACxB,MAAM,oBAAoB,iBAAiB,QAAQ;CACnD,MAAM,MAAM,iBAAiB;CAC7B,MAAM,UAAU,CAAC,WAAW,EAAE,UAAU,WAAW,GAAG,OAAO,CAAC;AAC9D,QAAO;EACL,GAAG;EACH,cAAc,kBAAkB,gBAC5B,GAAG,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,EAAE,kBAAkB,eAAe,GAClE,GAAG,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;CACrC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/openai",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "OpenAI integrations for LangChain.js",
|
|
5
5
|
"author": "LangChain",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"uuid": "^11.1.0",
|
|
36
36
|
"vitest": "^3.2.4",
|
|
37
37
|
"zod-to-json-schema": "^3.24.6",
|
|
38
|
-
"@langchain/
|
|
39
|
-
"@langchain/
|
|
40
|
-
"@langchain/
|
|
38
|
+
"@langchain/core": "1.1.0",
|
|
39
|
+
"@langchain/eslint": "0.1.1",
|
|
40
|
+
"@langchain/standard-tests": "0.0.3"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
@@ -56,18 +56,18 @@
|
|
|
56
56
|
"embeddings",
|
|
57
57
|
"vectorstores"
|
|
58
58
|
],
|
|
59
|
-
"main": "./dist/index.
|
|
60
|
-
"types": "./dist/index.d.
|
|
59
|
+
"main": "./dist/index.cjs",
|
|
60
|
+
"types": "./dist/index.d.cts",
|
|
61
61
|
"exports": {
|
|
62
62
|
".": {
|
|
63
63
|
"input": "./src/index.ts",
|
|
64
|
-
"import": {
|
|
65
|
-
"types": "./dist/index.d.ts",
|
|
66
|
-
"default": "./dist/index.js"
|
|
67
|
-
},
|
|
68
64
|
"require": {
|
|
69
65
|
"types": "./dist/index.d.cts",
|
|
70
66
|
"default": "./dist/index.cjs"
|
|
67
|
+
},
|
|
68
|
+
"import": {
|
|
69
|
+
"types": "./dist/index.d.ts",
|
|
70
|
+
"default": "./dist/index.js"
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"./package.json": "./package.json"
|
|
@@ -78,9 +78,10 @@
|
|
|
78
78
|
"README.md",
|
|
79
79
|
"LICENSE"
|
|
80
80
|
],
|
|
81
|
+
"module": "./dist/index.js",
|
|
81
82
|
"scripts": {
|
|
82
|
-
"build": "turbo build:compile --filter @langchain/openai",
|
|
83
|
-
"build:compile": "
|
|
83
|
+
"build": "turbo build:compile --filter @langchain/openai --output-logs new-only",
|
|
84
|
+
"build:compile": "tsdown",
|
|
84
85
|
"lint:eslint": "eslint --cache src/",
|
|
85
86
|
"lint:dpdm": "dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
|
|
86
87
|
"lint": "pnpm lint:eslint && pnpm lint:dpdm",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.cts","names":["Serialized","ChatOpenAICallOptions","AzureOpenAIChatInput","OpenAICoreRequestOptions","BaseChatOpenAI","BaseChatOpenAIFields","AZURE_ALIASES","AZURE_SECRETS","AZURE_SERIALIZABLE_KEYS","AzureChatOpenAIFields","Partial","_constructAzureFields","_getAzureClientOptions","_serializeAzureChat"],"sources":["../../../src/azure/chat_models/common.d.ts"],"sourcesContent":["import type { Serialized } from \"@langchain/core/load/serializable\";\nimport { ChatOpenAICallOptions } from \"../../chat_models/index.js\";\nimport { AzureOpenAIChatInput, OpenAICoreRequestOptions } from \"../../types.js\";\nimport { BaseChatOpenAI, BaseChatOpenAIFields } from \"../../chat_models/base.js\";\nexport declare const AZURE_ALIASES: {\n openAIApiKey: string;\n openAIApiVersion: string;\n openAIBasePath: string;\n deploymentName: string;\n azureOpenAIEndpoint: string;\n azureOpenAIApiVersion: string;\n azureOpenAIBasePath: string;\n azureOpenAIApiDeploymentName: string;\n};\nexport declare const AZURE_SECRETS: {\n azureOpenAIApiKey: string;\n};\nexport declare const AZURE_SERIALIZABLE_KEYS: string[];\nexport interface AzureChatOpenAIFields extends BaseChatOpenAIFields, Partial<AzureOpenAIChatInput> {\n /**\n * Whether to use the responses API for all requests. If `false` the responses API will be used\n * only when required in order to fulfill the request.\n */\n useResponsesApi?: boolean;\n}\nexport declare function _constructAzureFields(this: Partial<AzureOpenAIChatInput>, fields?: AzureChatOpenAIFields): void;\nexport declare function _getAzureClientOptions(this: BaseChatOpenAI<ChatOpenAICallOptions> & Partial<AzureOpenAIChatInput>, options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\nexport declare function _serializeAzureChat(this: BaseChatOpenAI<ChatOpenAICallOptions> & Partial<AzureOpenAIChatInput>, input: Serialized): Serialized;\n"],"mappings":";;;;;;UAkBiBS,qBAAAA,SAA8BJ,sBAAsBK,QAAQR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","names":["Serialized","ChatOpenAICallOptions","AzureOpenAIChatInput","OpenAICoreRequestOptions","BaseChatOpenAI","BaseChatOpenAIFields","AZURE_ALIASES","AZURE_SECRETS","AZURE_SERIALIZABLE_KEYS","AzureChatOpenAIFields","Partial","_constructAzureFields","_getAzureClientOptions","_serializeAzureChat"],"sources":["../../../src/azure/chat_models/common.d.ts"],"sourcesContent":["import type { Serialized } from \"@langchain/core/load/serializable\";\nimport { ChatOpenAICallOptions } from \"../../chat_models/index.js\";\nimport { AzureOpenAIChatInput, OpenAICoreRequestOptions } from \"../../types.js\";\nimport { BaseChatOpenAI, BaseChatOpenAIFields } from \"../../chat_models/base.js\";\nexport declare const AZURE_ALIASES: {\n openAIApiKey: string;\n openAIApiVersion: string;\n openAIBasePath: string;\n deploymentName: string;\n azureOpenAIEndpoint: string;\n azureOpenAIApiVersion: string;\n azureOpenAIBasePath: string;\n azureOpenAIApiDeploymentName: string;\n};\nexport declare const AZURE_SECRETS: {\n azureOpenAIApiKey: string;\n};\nexport declare const AZURE_SERIALIZABLE_KEYS: string[];\nexport interface AzureChatOpenAIFields extends BaseChatOpenAIFields, Partial<AzureOpenAIChatInput> {\n /**\n * Whether to use the responses API for all requests. If `false` the responses API will be used\n * only when required in order to fulfill the request.\n */\n useResponsesApi?: boolean;\n}\nexport declare function _constructAzureFields(this: Partial<AzureOpenAIChatInput>, fields?: AzureChatOpenAIFields): void;\nexport declare function _getAzureClientOptions(this: BaseChatOpenAI<ChatOpenAICallOptions> & Partial<AzureOpenAIChatInput>, options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\nexport declare function _serializeAzureChat(this: BaseChatOpenAI<ChatOpenAICallOptions> & Partial<AzureOpenAIChatInput>, input: Serialized): Serialized;\n"],"mappings":";;;;;;UAkBiBS,qBAAAA,SAA8BJ,sBAAsBK,QAAQR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completions.d.cts","names":["LangSmithParams","Serialized","ChatOpenAICompletions","ChatOpenAICompletionsCallOptions","AzureOpenAIChatInput","OpenAICoreRequestOptions","AzureChatOpenAIFields","AzureChatOpenAICompletions","CallOptions","Promise","Record","Partial"],"sources":["../../../src/azure/chat_models/completions.d.ts"],"sourcesContent":["import { LangSmithParams } from \"@langchain/core/language_models/chat_models\";\nimport { Serialized } from \"@langchain/core/load/serializable\";\nimport { ChatOpenAICompletions, ChatOpenAICompletionsCallOptions } from \"../../chat_models/completions.js\";\nimport { AzureOpenAIChatInput, OpenAICoreRequestOptions } from \"../../types.js\";\nimport { AzureChatOpenAIFields } from \"./common.js\";\nexport declare class AzureChatOpenAICompletions<CallOptions extends ChatOpenAICompletionsCallOptions = ChatOpenAICompletionsCallOptions> extends ChatOpenAICompletions<CallOptions> implements Partial<AzureOpenAIChatInput> {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n azureOpenAIEndpoint?: string;\n _llmType(): string;\n get lc_aliases(): Record<string, string>;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n get lc_serializable_keys(): string[];\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n constructor(fields?: AzureChatOpenAIFields);\n _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\n toJSON(): Serialized;\n}\n"],"mappings":";;;;;;;cAKqBO,+CAA+CJ,mCAAmCA,0CAA0CD,sBAAsBM,wBAAwBG,QAAQP;;EAAlLG,iBAAAA,CAAAA,EAAAA,MAAAA;EAA0B,oBAAA,CAAA,EAAA,GAAA,GAGdE,OAHc,CAAA,MAAA,CAAA;EAAA,0BAAqBN,CAAAA,EAAAA,MAAAA;EAAgC,4BAAGA,CAAAA,EAAAA,MAAAA;EAAgC,mBAAgCK,CAAAA,EAAAA,MAAAA;EAAW,mBAAqBJ,CAAAA,EAAAA,MAAAA;EAAoB,QAG1LK,CAAAA,CAAAA,EAAAA,MAAAA;EAAO,IAMlBC,UAAAA,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAM,IAKyBV,UAAAA,CAAAA,CAAAA,EAAAA;IAC5BM,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAqB,CAAA,GACfD,SAAAA;EAAwB,IAAeA,oBAAAA,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAwB,WAChFJ,CAAAA,OAAAA,EAAAA,IAAAA,CAAAA,mBAAAA,CAAAA,CAAAA,EAHuCD,eAGvCC;EAAU,WAjByHC,CAAAA,MAAAA,CAAAA,EAexHI,qBAfwHJ;EAAqB,iBAAyBS,CAAAA,OAAAA,EAgBhKN,wBAhBgKM,GAAAA,SAAAA,CAAAA,EAgBzHN,wBAhByHM;EAAO,MAAA,CAAA,CAAA,EAiBxLV,UAjBwL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completions.d.ts","names":["LangSmithParams","Serialized","ChatOpenAICompletions","ChatOpenAICompletionsCallOptions","AzureOpenAIChatInput","OpenAICoreRequestOptions","AzureChatOpenAIFields","AzureChatOpenAICompletions","CallOptions","Promise","Record","Partial"],"sources":["../../../src/azure/chat_models/completions.d.ts"],"sourcesContent":["import { LangSmithParams } from \"@langchain/core/language_models/chat_models\";\nimport { Serialized } from \"@langchain/core/load/serializable\";\nimport { ChatOpenAICompletions, ChatOpenAICompletionsCallOptions } from \"../../chat_models/completions.js\";\nimport { AzureOpenAIChatInput, OpenAICoreRequestOptions } from \"../../types.js\";\nimport { AzureChatOpenAIFields } from \"./common.js\";\nexport declare class AzureChatOpenAICompletions<CallOptions extends ChatOpenAICompletionsCallOptions = ChatOpenAICompletionsCallOptions> extends ChatOpenAICompletions<CallOptions> implements Partial<AzureOpenAIChatInput> {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n azureOpenAIEndpoint?: string;\n _llmType(): string;\n get lc_aliases(): Record<string, string>;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n get lc_serializable_keys(): string[];\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n constructor(fields?: AzureChatOpenAIFields);\n _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\n toJSON(): Serialized;\n}\n"],"mappings":";;;;;;;cAKqBO,+CAA+CJ,mCAAmCA,0CAA0CD,sBAAsBM,wBAAwBG,QAAQP;;EAAlLG,iBAAAA,CAAAA,EAAAA,MAAAA;EAA0B,oBAAA,CAAA,EAAA,GAAA,GAGdE,OAHc,CAAA,MAAA,CAAA;EAAA,0BAAqBN,CAAAA,EAAAA,MAAAA;EAAgC,4BAAGA,CAAAA,EAAAA,MAAAA;EAAgC,mBAAgCK,CAAAA,EAAAA,MAAAA;EAAW,mBAAqBJ,CAAAA,EAAAA,MAAAA;EAAoB,QAG1LK,CAAAA,CAAAA,EAAAA,MAAAA;EAAO,IAMlBC,UAAAA,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAM,IAKyBV,UAAAA,CAAAA,CAAAA,EAAAA;IAC5BM,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAqB,CAAA,GACfD,SAAAA;EAAwB,IAAeA,oBAAAA,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAwB,WAChFJ,CAAAA,OAAAA,EAAAA,IAAAA,CAAAA,mBAAAA,CAAAA,CAAAA,EAHuCD,eAGvCC;EAAU,WAjByHC,CAAAA,MAAAA,CAAAA,EAexHI,qBAfwHJ;EAAqB,iBAAyBS,CAAAA,OAAAA,EAgBhKN,wBAhBgKM,GAAAA,SAAAA,CAAAA,EAgBzHN,wBAhByHM;EAAO,MAAA,CAAA,CAAA,EAiBxLV,UAjBwL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["StructuredOutputMethodOptions","Serialized","LangSmithParams","ChatOpenAI","ChatOpenAICallOptions","AzureOpenAIChatInput","AzureChatOpenAIFields","AzureChatOpenAI","CallOptions","Promise","Record","Partial"],"sources":["../../../src/azure/chat_models/index.d.ts"],"sourcesContent":["import { StructuredOutputMethodOptions } from \"@langchain/core/language_models/base\";\nimport type { Serialized } from \"@langchain/core/load/serializable\";\nimport { LangSmithParams } from \"@langchain/core/language_models/chat_models\";\nimport { ChatOpenAI, ChatOpenAICallOptions } from \"../../chat_models/index.js\";\nimport { AzureOpenAIChatInput } from \"../../types.js\";\nimport { AzureChatOpenAIFields } from \"./common.js\";\n/**\n * Azure OpenAI chat model integration.\n *\n * Setup:\n * Install `@langchain/openai` and set the following environment variables:\n *\n * ```bash\n * npm install @langchain/openai\n * export AZURE_OPENAI_API_KEY=\"your-api-key\"\n * export AZURE_OPENAI_API_DEPLOYMENT_NAME=\"your-deployment-name\"\n * export AZURE_OPENAI_API_VERSION=\"your-version\"\n * export AZURE_OPENAI_BASE_PATH=\"your-base-path\"\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/langchain_openai.AzureChatOpenAI.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/langchain_openai.ChatOpenAICallOptions.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 * // When calling `.withConfig`, call options should be passed via the first argument\n * const llmWithArgsBound = llm.withConfig({\n * stop: [\"\\n\"],\n * tools: [...],\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 { AzureChatOpenAI } from '@langchain/openai';\n *\n * const llm = new AzureChatOpenAI({\n * azureOpenAIApiKey: process.env.AZURE_OPENAI_API_KEY, // In Node.js defaults to process.env.AZURE_OPENAI_API_KEY\n * azureOpenAIApiInstanceName: process.env.AZURE_OPENAI_API_INSTANCE_NAME, // In Node.js defaults to process.env.AZURE_OPENAI_API_INSTANCE_NAME\n * azureOpenAIApiDeploymentName: process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME, // In Node.js defaults to process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME\n * azureOpenAIApiVersion: process.env.AZURE_OPENAI_API_VERSION, // In Node.js defaults to process.env.AZURE_OPENAI_API_VERSION\n * temperature: 0,\n * maxTokens: undefined,\n * timeout: undefined,\n * maxRetries: 2,\n * // apiKey: \"...\",\n * // baseUrl: \"...\",\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 * AIMessage {\n * \"id\": \"chatcmpl-9u4Mpu44CbPjwYFkTbeoZgvzB00Tz\",\n * \"content\": \"J'adore la programmation.\",\n * \"response_metadata\": {\n * \"tokenUsage\": {\n * \"completionTokens\": 5,\n * \"promptTokens\": 28,\n * \"totalTokens\": 33\n * },\n * \"finish_reason\": \"stop\",\n * \"system_fingerprint\": \"fp_3aa7262c27\"\n * },\n * \"usage_metadata\": {\n * \"input_tokens\": 28,\n * \"output_tokens\": 5,\n * \"total_tokens\": 33\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 * \"id\": \"chatcmpl-9u4NWB7yUeHCKdLr6jP3HpaOYHTqs\",\n * \"content\": \"\"\n * }\n * AIMessageChunk {\n * \"content\": \"J\"\n * }\n * AIMessageChunk {\n * \"content\": \"'adore\"\n * }\n * AIMessageChunk {\n * \"content\": \" la\"\n * }\n * AIMessageChunk {\n * \"content\": \" programmation\",,\n * }\n * AIMessageChunk {\n * \"content\": \".\",,\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"response_metadata\": {\n * \"finish_reason\": \"stop\",\n * \"system_fingerprint\": \"fp_c9aa9c0491\"\n * },\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"usage_metadata\": {\n * \"input_tokens\": 28,\n * \"output_tokens\": 5,\n * \"total_tokens\": 33\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 * \"id\": \"chatcmpl-9u4PnX6Fy7OmK46DASy0bH6cxn5Xu\",\n * \"content\": \"J'adore la programmation.\",\n * \"response_metadata\": {\n * \"prompt\": 0,\n * \"completion\": 0,\n * \"finish_reason\": \"stop\",\n * },\n * \"usage_metadata\": {\n * \"input_tokens\": 28,\n * \"output_tokens\": 5,\n * \"total_tokens\": 33\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: 'GetWeather',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_uPU4FiFzoKAtMxfmPnfQL6UK'\n * },\n * {\n * name: 'GetWeather',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_UNkEwuQsHrGYqgDQuH9nPAtX'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_kL3OXxaq9OjIKqRTpvjaCH14'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_s9KQB1UWj45LLGaEnjz0179q'\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().nullable().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: 'Why was the cat sitting on the computer?',\n * punchline: 'Because it wanted to keep an eye on the mouse!',\n * rating: 7\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>JSON Object Response Format</strong></summary>\n *\n * ```typescript\n * const jsonLlm = llm.withConfig({ response_format: { type: \"json_object\" } });\n * const jsonLlmAiMsg = await jsonLlm.invoke(\n * \"Return a JSON object with key 'randomInts' and a value of 10 random ints in [0-99]\"\n * );\n * console.log(jsonLlmAiMsg.content);\n * ```\n *\n * ```txt\n * {\n * \"randomInts\": [23, 87, 45, 12, 78, 34, 56, 90, 11, 67]\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Multimodal</strong></summary>\n *\n * ```typescript\n * import { HumanMessage } from '@langchain/core/messages';\n *\n * const imageUrl = \"https://example.com/image.jpg\";\n * const imageData = await fetch(imageUrl).then(res => res.arrayBuffer());\n * const base64Image = Buffer.from(imageData).toString('base64');\n *\n * const message = new HumanMessage({\n * content: [\n * { type: \"text\", text: \"describe the weather in this image\" },\n * {\n * type: \"image_url\",\n * image_url: { url: `data:image/jpeg;base64,${base64Image}` },\n * },\n * ]\n * });\n *\n * const imageDescriptionAiMsg = await llm.invoke([message]);\n * console.log(imageDescriptionAiMsg.content);\n * ```\n *\n * ```txt\n * The weather in the image appears to be clear and sunny. The sky is mostly blue with a few scattered white clouds, indicating fair weather. The bright sunlight is casting shadows on the green, grassy hill, suggesting it is a pleasant day with good visibility. There are no signs of rain or stormy conditions.\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: 28, output_tokens: 5, total_tokens: 33 }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Logprobs</strong></summary>\n *\n * ```typescript\n * const logprobsLlm = new ChatOpenAI({ model: \"gpt-4o-mini\", logprobs: true });\n * const aiMsgForLogprobs = await logprobsLlm.invoke(input);\n * console.log(aiMsgForLogprobs.response_metadata.logprobs);\n * ```\n *\n * ```txt\n * {\n * content: [\n * {\n * token: 'J',\n * logprob: -0.000050616763,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * {\n * token: \"'\",\n * logprob: -0.01868736,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * {\n * token: 'ad',\n * logprob: -0.0000030545007,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * { token: 'ore', logprob: 0, bytes: [Array], top_logprobs: [] },\n * {\n * token: ' la',\n * logprob: -0.515404,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * {\n * token: ' programm',\n * logprob: -0.0000118755715,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * { token: 'ation', logprob: 0, bytes: [Array], top_logprobs: [] },\n * {\n * token: '.',\n * logprob: -0.0000037697225,\n * bytes: [Array],\n * top_logprobs: []\n * }\n * ],\n * refusal: null\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Response Metadata</strong></summary>\n *\n * ```typescript\n * const aiMsgForResponseMetadata = await llm.invoke(input);\n * console.log(aiMsgForResponseMetadata.response_metadata);\n * ```\n *\n * ```txt\n * {\n * tokenUsage: { completionTokens: 5, promptTokens: 28, totalTokens: 33 },\n * finish_reason: 'stop',\n * system_fingerprint: 'fp_3aa7262c27'\n * }\n * ```\n * </details>\n */\nexport declare class AzureChatOpenAI<CallOptions extends ChatOpenAICallOptions = ChatOpenAICallOptions> extends ChatOpenAI<CallOptions> implements Partial<AzureOpenAIChatInput> {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n azureOpenAIEndpoint?: string;\n _llmType(): string;\n get lc_aliases(): Record<string, string>;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n get lc_serializable_keys(): string[];\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n constructor(fields?: AzureChatOpenAIFields);\n /** @internal */\n _getStructuredOutputMethod(config: StructuredOutputMethodOptions<boolean>): string | undefined;\n toJSON(): Serialized;\n}\n"],"mappings":";;;;;;;;;;;AAkaA;;;;;;;;;;;;;;AAA0J;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAArIO,oCAAoCH,wBAAwBA,+BAA+BD,WAAWK,wBAAwBG,QAAQN;;;+BAG1HI;;;;;;oBAMXC;;;;;mDAK+BR;uBAC5BI;;qCAEcN;YACzBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["StructuredOutputMethodOptions","Serialized","LangSmithParams","ChatOpenAI","ChatOpenAICallOptions","AzureOpenAIChatInput","AzureChatOpenAIFields","AzureChatOpenAI","CallOptions","Promise","Record","Partial"],"sources":["../../../src/azure/chat_models/index.d.ts"],"sourcesContent":["import { StructuredOutputMethodOptions } from \"@langchain/core/language_models/base\";\nimport type { Serialized } from \"@langchain/core/load/serializable\";\nimport { LangSmithParams } from \"@langchain/core/language_models/chat_models\";\nimport { ChatOpenAI, ChatOpenAICallOptions } from \"../../chat_models/index.js\";\nimport { AzureOpenAIChatInput } from \"../../types.js\";\nimport { AzureChatOpenAIFields } from \"./common.js\";\n/**\n * Azure OpenAI chat model integration.\n *\n * Setup:\n * Install `@langchain/openai` and set the following environment variables:\n *\n * ```bash\n * npm install @langchain/openai\n * export AZURE_OPENAI_API_KEY=\"your-api-key\"\n * export AZURE_OPENAI_API_DEPLOYMENT_NAME=\"your-deployment-name\"\n * export AZURE_OPENAI_API_VERSION=\"your-version\"\n * export AZURE_OPENAI_BASE_PATH=\"your-base-path\"\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/langchain_openai.AzureChatOpenAI.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/langchain_openai.ChatOpenAICallOptions.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 * // When calling `.withConfig`, call options should be passed via the first argument\n * const llmWithArgsBound = llm.withConfig({\n * stop: [\"\\n\"],\n * tools: [...],\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 { AzureChatOpenAI } from '@langchain/openai';\n *\n * const llm = new AzureChatOpenAI({\n * azureOpenAIApiKey: process.env.AZURE_OPENAI_API_KEY, // In Node.js defaults to process.env.AZURE_OPENAI_API_KEY\n * azureOpenAIApiInstanceName: process.env.AZURE_OPENAI_API_INSTANCE_NAME, // In Node.js defaults to process.env.AZURE_OPENAI_API_INSTANCE_NAME\n * azureOpenAIApiDeploymentName: process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME, // In Node.js defaults to process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME\n * azureOpenAIApiVersion: process.env.AZURE_OPENAI_API_VERSION, // In Node.js defaults to process.env.AZURE_OPENAI_API_VERSION\n * temperature: 0,\n * maxTokens: undefined,\n * timeout: undefined,\n * maxRetries: 2,\n * // apiKey: \"...\",\n * // baseUrl: \"...\",\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 * AIMessage {\n * \"id\": \"chatcmpl-9u4Mpu44CbPjwYFkTbeoZgvzB00Tz\",\n * \"content\": \"J'adore la programmation.\",\n * \"response_metadata\": {\n * \"tokenUsage\": {\n * \"completionTokens\": 5,\n * \"promptTokens\": 28,\n * \"totalTokens\": 33\n * },\n * \"finish_reason\": \"stop\",\n * \"system_fingerprint\": \"fp_3aa7262c27\"\n * },\n * \"usage_metadata\": {\n * \"input_tokens\": 28,\n * \"output_tokens\": 5,\n * \"total_tokens\": 33\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 * \"id\": \"chatcmpl-9u4NWB7yUeHCKdLr6jP3HpaOYHTqs\",\n * \"content\": \"\"\n * }\n * AIMessageChunk {\n * \"content\": \"J\"\n * }\n * AIMessageChunk {\n * \"content\": \"'adore\"\n * }\n * AIMessageChunk {\n * \"content\": \" la\"\n * }\n * AIMessageChunk {\n * \"content\": \" programmation\",,\n * }\n * AIMessageChunk {\n * \"content\": \".\",,\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"response_metadata\": {\n * \"finish_reason\": \"stop\",\n * \"system_fingerprint\": \"fp_c9aa9c0491\"\n * },\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"usage_metadata\": {\n * \"input_tokens\": 28,\n * \"output_tokens\": 5,\n * \"total_tokens\": 33\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 * \"id\": \"chatcmpl-9u4PnX6Fy7OmK46DASy0bH6cxn5Xu\",\n * \"content\": \"J'adore la programmation.\",\n * \"response_metadata\": {\n * \"prompt\": 0,\n * \"completion\": 0,\n * \"finish_reason\": \"stop\",\n * },\n * \"usage_metadata\": {\n * \"input_tokens\": 28,\n * \"output_tokens\": 5,\n * \"total_tokens\": 33\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: 'GetWeather',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_uPU4FiFzoKAtMxfmPnfQL6UK'\n * },\n * {\n * name: 'GetWeather',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_UNkEwuQsHrGYqgDQuH9nPAtX'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_kL3OXxaq9OjIKqRTpvjaCH14'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_s9KQB1UWj45LLGaEnjz0179q'\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().nullable().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: 'Why was the cat sitting on the computer?',\n * punchline: 'Because it wanted to keep an eye on the mouse!',\n * rating: 7\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>JSON Object Response Format</strong></summary>\n *\n * ```typescript\n * const jsonLlm = llm.withConfig({ response_format: { type: \"json_object\" } });\n * const jsonLlmAiMsg = await jsonLlm.invoke(\n * \"Return a JSON object with key 'randomInts' and a value of 10 random ints in [0-99]\"\n * );\n * console.log(jsonLlmAiMsg.content);\n * ```\n *\n * ```txt\n * {\n * \"randomInts\": [23, 87, 45, 12, 78, 34, 56, 90, 11, 67]\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Multimodal</strong></summary>\n *\n * ```typescript\n * import { HumanMessage } from '@langchain/core/messages';\n *\n * const imageUrl = \"https://example.com/image.jpg\";\n * const imageData = await fetch(imageUrl).then(res => res.arrayBuffer());\n * const base64Image = Buffer.from(imageData).toString('base64');\n *\n * const message = new HumanMessage({\n * content: [\n * { type: \"text\", text: \"describe the weather in this image\" },\n * {\n * type: \"image_url\",\n * image_url: { url: `data:image/jpeg;base64,${base64Image}` },\n * },\n * ]\n * });\n *\n * const imageDescriptionAiMsg = await llm.invoke([message]);\n * console.log(imageDescriptionAiMsg.content);\n * ```\n *\n * ```txt\n * The weather in the image appears to be clear and sunny. The sky is mostly blue with a few scattered white clouds, indicating fair weather. The bright sunlight is casting shadows on the green, grassy hill, suggesting it is a pleasant day with good visibility. There are no signs of rain or stormy conditions.\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: 28, output_tokens: 5, total_tokens: 33 }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Logprobs</strong></summary>\n *\n * ```typescript\n * const logprobsLlm = new ChatOpenAI({ model: \"gpt-4o-mini\", logprobs: true });\n * const aiMsgForLogprobs = await logprobsLlm.invoke(input);\n * console.log(aiMsgForLogprobs.response_metadata.logprobs);\n * ```\n *\n * ```txt\n * {\n * content: [\n * {\n * token: 'J',\n * logprob: -0.000050616763,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * {\n * token: \"'\",\n * logprob: -0.01868736,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * {\n * token: 'ad',\n * logprob: -0.0000030545007,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * { token: 'ore', logprob: 0, bytes: [Array], top_logprobs: [] },\n * {\n * token: ' la',\n * logprob: -0.515404,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * {\n * token: ' programm',\n * logprob: -0.0000118755715,\n * bytes: [Array],\n * top_logprobs: []\n * },\n * { token: 'ation', logprob: 0, bytes: [Array], top_logprobs: [] },\n * {\n * token: '.',\n * logprob: -0.0000037697225,\n * bytes: [Array],\n * top_logprobs: []\n * }\n * ],\n * refusal: null\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Response Metadata</strong></summary>\n *\n * ```typescript\n * const aiMsgForResponseMetadata = await llm.invoke(input);\n * console.log(aiMsgForResponseMetadata.response_metadata);\n * ```\n *\n * ```txt\n * {\n * tokenUsage: { completionTokens: 5, promptTokens: 28, totalTokens: 33 },\n * finish_reason: 'stop',\n * system_fingerprint: 'fp_3aa7262c27'\n * }\n * ```\n * </details>\n */\nexport declare class AzureChatOpenAI<CallOptions extends ChatOpenAICallOptions = ChatOpenAICallOptions> extends ChatOpenAI<CallOptions> implements Partial<AzureOpenAIChatInput> {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n azureOpenAIEndpoint?: string;\n _llmType(): string;\n get lc_aliases(): Record<string, string>;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n get lc_serializable_keys(): string[];\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n constructor(fields?: AzureChatOpenAIFields);\n /** @internal */\n _getStructuredOutputMethod(config: StructuredOutputMethodOptions<boolean>): string | undefined;\n toJSON(): Serialized;\n}\n"],"mappings":";;;;;;;;;;;AAkaA;;;;;;;;;;;;;;AAA0J;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAArIO,oCAAoCH,wBAAwBA,+BAA+BD,WAAWK,wBAAwBG,QAAQN;;;+BAG1HI;;;;;;oBAMXC;;;;;mDAK+BR;uBAC5BI;;qCAEcN;YACzBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.cts","names":["LangSmithParams","Serialized","ChatOpenAIResponsesCallOptions","ChatOpenAIResponses","AzureOpenAIChatInput","OpenAICoreRequestOptions","AzureChatOpenAIFields","AzureChatOpenAIResponses","CallOptions","Promise","Record","Partial"],"sources":["../../../src/azure/chat_models/responses.d.ts"],"sourcesContent":["import { LangSmithParams } from \"@langchain/core/language_models/chat_models\";\nimport { Serialized } from \"@langchain/core/load/serializable\";\nimport { ChatOpenAIResponsesCallOptions, ChatOpenAIResponses } from \"../../chat_models/responses.js\";\nimport { AzureOpenAIChatInput, OpenAICoreRequestOptions } from \"../../types.js\";\nimport { AzureChatOpenAIFields } from \"./common.js\";\nexport declare class AzureChatOpenAIResponses<CallOptions extends ChatOpenAIResponsesCallOptions = ChatOpenAIResponsesCallOptions> extends ChatOpenAIResponses<CallOptions> implements Partial<AzureOpenAIChatInput> {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n azureOpenAIEndpoint?: string;\n _llmType(): string;\n get lc_aliases(): Record<string, string>;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n get lc_serializable_keys(): string[];\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n constructor(fields?: AzureChatOpenAIFields);\n _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\n toJSON(): Serialized;\n}\n"],"mappings":";;;;;;;cAKqBO,6CAA6CL,iCAAiCA,wCAAwCC,oBAAoBK,wBAAwBG,QAAQP;;EAA1KG,iBAAAA,CAAAA,EAAAA,MAAAA;EAAwB,oBAAA,CAAA,EAAA,GAAA,GAGZE,OAHY,CAAA,MAAA,CAAA;EAAA,0BAAqBP,CAAAA,EAAAA,MAAAA;EAA8B,4BAAGA,CAAAA,EAAAA,MAAAA;EAA8B,mBAA8BM,CAAAA,EAAAA,MAAAA;EAAW,mBAAqBJ,CAAAA,EAAAA,MAAAA;EAAoB,QAGlLK,CAAAA,CAAAA,EAAAA,MAAAA;EAAO,IAMlBC,UAAAA,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAM,IAKyBV,UAAAA,CAAAA,CAAAA,EAAAA;IAC5BM,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAqB,CAAA,GACfD,SAAAA;EAAwB,IAAeA,oBAAAA,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAwB,WAChFJ,CAAAA,OAAAA,EAAAA,IAAAA,CAAAA,mBAAAA,CAAAA,CAAAA,EAHuCD,eAGvCC;EAAU,WAjBmHE,CAAAA,MAAAA,CAAAA,EAelHG,qBAfkHH;EAAmB,iBAAyBQ,CAAAA,OAAAA,EAgBxJN,wBAhBwJM,GAAAA,SAAAA,CAAAA,EAgBjHN,wBAhBiHM;EAAO,MAAA,CAAA,CAAA,EAiBhLV,UAjBgL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","names":["LangSmithParams","Serialized","ChatOpenAIResponsesCallOptions","ChatOpenAIResponses","AzureOpenAIChatInput","OpenAICoreRequestOptions","AzureChatOpenAIFields","AzureChatOpenAIResponses","CallOptions","Promise","Record","Partial"],"sources":["../../../src/azure/chat_models/responses.d.ts"],"sourcesContent":["import { LangSmithParams } from \"@langchain/core/language_models/chat_models\";\nimport { Serialized } from \"@langchain/core/load/serializable\";\nimport { ChatOpenAIResponsesCallOptions, ChatOpenAIResponses } from \"../../chat_models/responses.js\";\nimport { AzureOpenAIChatInput, OpenAICoreRequestOptions } from \"../../types.js\";\nimport { AzureChatOpenAIFields } from \"./common.js\";\nexport declare class AzureChatOpenAIResponses<CallOptions extends ChatOpenAIResponsesCallOptions = ChatOpenAIResponsesCallOptions> extends ChatOpenAIResponses<CallOptions> implements Partial<AzureOpenAIChatInput> {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n azureOpenAIEndpoint?: string;\n _llmType(): string;\n get lc_aliases(): Record<string, string>;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n get lc_serializable_keys(): string[];\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n constructor(fields?: AzureChatOpenAIFields);\n _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\n toJSON(): Serialized;\n}\n"],"mappings":";;;;;;;cAKqBO,6CAA6CL,iCAAiCA,wCAAwCC,oBAAoBK,wBAAwBG,QAAQP;;EAA1KG,iBAAAA,CAAAA,EAAAA,MAAAA;EAAwB,oBAAA,CAAA,EAAA,GAAA,GAGZE,OAHY,CAAA,MAAA,CAAA;EAAA,0BAAqBP,CAAAA,EAAAA,MAAAA;EAA8B,4BAAGA,CAAAA,EAAAA,MAAAA;EAA8B,mBAA8BM,CAAAA,EAAAA,MAAAA;EAAW,mBAAqBJ,CAAAA,EAAAA,MAAAA;EAAoB,QAGlLK,CAAAA,CAAAA,EAAAA,MAAAA;EAAO,IAMlBC,UAAAA,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAM,IAKyBV,UAAAA,CAAAA,CAAAA,EAAAA;IAC5BM,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAqB,CAAA,GACfD,SAAAA;EAAwB,IAAeA,oBAAAA,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAwB,WAChFJ,CAAAA,OAAAA,EAAAA,IAAAA,CAAAA,mBAAAA,CAAAA,CAAAA,EAHuCD,eAGvCC;EAAU,WAjBmHE,CAAAA,MAAAA,CAAAA,EAelHG,qBAfkHH;EAAmB,iBAAyBQ,CAAAA,OAAAA,EAgBxJN,wBAhBwJM,GAAAA,SAAAA,CAAAA,EAgBjHN,wBAhBiHM;EAAO,MAAA,CAAA,CAAA,EAiBhLV,UAjBgL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.d.cts","names":["ClientOptions","OpenAI","OpenAIClient","OpenAIEmbeddings","OpenAIEmbeddingsParams","AzureOpenAIInput","AzureOpenAIEmbeddings","Promise","Partial","EmbeddingCreateParams","CreateEmbeddingResponse"],"sources":["../../src/azure/embeddings.d.ts"],"sourcesContent":["import { type ClientOptions, OpenAI as OpenAIClient } from \"openai\";\nimport { OpenAIEmbeddings, OpenAIEmbeddingsParams } from \"../embeddings.js\";\nimport { AzureOpenAIInput } from \"../types.js\";\nexport declare class AzureOpenAIEmbeddings extends OpenAIEmbeddings {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n constructor(fields?: Partial<OpenAIEmbeddingsParams> & Partial<AzureOpenAIInput> & {\n verbose?: boolean;\n /** The OpenAI API key to use. */\n apiKey?: string;\n configuration?: ClientOptions;\n deploymentName?: string;\n openAIApiVersion?: string;\n });\n protected embeddingWithRetry(request: OpenAIClient.EmbeddingCreateParams): Promise<OpenAIClient.CreateEmbeddingResponse & {\n _request_id?: string | null | undefined;\n }>;\n}\n"],"mappings":";;;;;cAGqBM,qBAAAA,SAA8BH,gBAAAA;;EAA9BG,iBAAAA,CAAAA,EAAAA,MAAqB;EAAA,oBAAA,CAAA,EAAA,GAAA,GAGTC,OAHS,CAAA,MAAA,CAAA;EAAA,0BAGTA,CAAAA,EAAAA,MAAAA;EAAO,4BAIPH,CAAAA,EAAAA,MAAAA;EAAsB,mBAA9BI,CAAAA,EAAAA,MAAAA;EAAO,WAAmCH,CAAAA,MAPA,CAOAA,EAA1CG,OAA0CH,CAAlCD,sBAAkCC,CAAAA,GAARG,OAAQH,CAAAA,gBAAAA,CAAAA,GAAAA;IAARG,OAAAA,CAAAA,EAAAA,OAAAA;IAInCR;IAIkBE,MAAAA,CAAAA,EAAaO,MAAAA;IAAgCP,aAAaQ,CAAAA,EAJ5EV,aAI4EU;IAArBH,cAAAA,CAAAA,EAAAA,MAAAA;IAf5BJ,gBAAAA,CAAAA,EAAAA,MAAAA;EAAgB,CAAA;wCAezBD,QAAAA,CAAaO,wBAAwBF,QAAQL,QAAAA,CAAaQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.d.ts","names":["ClientOptions","OpenAI","OpenAIClient","OpenAIEmbeddings","OpenAIEmbeddingsParams","AzureOpenAIInput","AzureOpenAIEmbeddings","Promise","Partial","EmbeddingCreateParams","CreateEmbeddingResponse"],"sources":["../../src/azure/embeddings.d.ts"],"sourcesContent":["import { type ClientOptions, OpenAI as OpenAIClient } from \"openai\";\nimport { OpenAIEmbeddings, OpenAIEmbeddingsParams } from \"../embeddings.js\";\nimport { AzureOpenAIInput } from \"../types.js\";\nexport declare class AzureOpenAIEmbeddings extends OpenAIEmbeddings {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n constructor(fields?: Partial<OpenAIEmbeddingsParams> & Partial<AzureOpenAIInput> & {\n verbose?: boolean;\n /** The OpenAI API key to use. */\n apiKey?: string;\n configuration?: ClientOptions;\n deploymentName?: string;\n openAIApiVersion?: string;\n });\n protected embeddingWithRetry(request: OpenAIClient.EmbeddingCreateParams): Promise<OpenAIClient.CreateEmbeddingResponse & {\n _request_id?: string | null | undefined;\n }>;\n}\n"],"mappings":";;;;;cAGqBM,qBAAAA,SAA8BH,gBAAAA;;EAA9BG,iBAAAA,CAAAA,EAAAA,MAAqB;EAAA,oBAAA,CAAA,EAAA,GAAA,GAGTC,OAHS,CAAA,MAAA,CAAA;EAAA,0BAGTA,CAAAA,EAAAA,MAAAA;EAAO,4BAIPH,CAAAA,EAAAA,MAAAA;EAAsB,mBAA9BI,CAAAA,EAAAA,MAAAA;EAAO,WAAmCH,CAAAA,MAPA,CAOAA,EAA1CG,OAA0CH,CAAlCD,sBAAkCC,CAAAA,GAARG,OAAQH,CAAAA,gBAAAA,CAAAA,GAAAA;IAARG,OAAAA,CAAAA,EAAAA,OAAAA;IAInCR;IAIkBE,MAAAA,CAAAA,EAAaO,MAAAA;IAAgCP,aAAaQ,CAAAA,EAJ5EV,aAI4EU;IAArBH,cAAAA,CAAAA,EAAAA,MAAAA;IAf5BJ,gBAAAA,CAAAA,EAAAA,MAAAA;EAAgB,CAAA;wCAezBD,QAAAA,CAAaO,wBAAwBF,QAAQL,QAAAA,CAAaQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"llms.d.cts","names":["ClientOptions","BaseLLMParams","OpenAI","OpenAIInput","AzureOpenAIInput","OpenAICoreRequestOptions","AzureOpenAI","Promise","Record","Partial"],"sources":["../../src/azure/llms.d.ts"],"sourcesContent":["import { type ClientOptions } from \"openai\";\nimport { type BaseLLMParams } from \"@langchain/core/language_models/llms\";\nimport { OpenAI } from \"../llms.js\";\nimport type { OpenAIInput, AzureOpenAIInput, OpenAICoreRequestOptions } from \"../types.js\";\nexport declare class AzureOpenAI extends OpenAI {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n azureOpenAIEndpoint?: string;\n get lc_aliases(): Record<string, string>;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n constructor(fields?: Partial<OpenAIInput> & {\n openAIApiKey?: string;\n openAIApiVersion?: string;\n openAIBasePath?: string;\n deploymentName?: string;\n } & Partial<AzureOpenAIInput> & BaseLLMParams & {\n configuration?: ClientOptions;\n });\n protected _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n toJSON(): any;\n}\n"],"mappings":";;;;;;cAIqBM,WAAAA,SAAoBJ,MAAAA;;EAApBI,iBAAW,CAAA,EAAA,MAAA;EAAA,oBAAA,CAAA,EAAA,GAAA,GAGCC,OAHD,CAAA,MAAA,CAAA;EAAA,0BAGCA,CAAAA,EAAAA,MAAAA;EAAO,4BAKlBC,CAAAA,EAAAA,MAAAA;EAAM,mBAIKL,CAAAA,EAAAA,MAAAA;EAAW,mBAAnBM,CAAAA,EAAAA,MAAAA;EAAO,IAKhBL,UAAAA,CAAAA,CAAAA,EATMI,MASNJ,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAgB,IAAxBK,UAAAA,CAAAA,CAAAA,EAAAA;IAA4BR,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAa,CAAA,GACzBD,SAAAA;EAAa,WAEIK,CAAAA,OAAAA,EARhBI,OAQgBJ,CARRF,WAQQE,CAAAA,GAAAA;IAAuCA,YAAAA,CAAAA,EAAAA,MAAAA;IApBvCH,gBAAAA,CAAAA,EAAAA,MAAAA;IAAM,cAAA,CAAA,EAAA,MAAA;;MAiBvCO,QAAQL,oBAAoBH;oBACZD;;uCAEiBK,uCAAuCA"}
|
package/dist/azure/llms.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"llms.d.ts","names":["ClientOptions","BaseLLMParams","OpenAI","OpenAIInput","AzureOpenAIInput","OpenAICoreRequestOptions","AzureOpenAI","Promise","Record","Partial"],"sources":["../../src/azure/llms.d.ts"],"sourcesContent":["import { type ClientOptions } from \"openai\";\nimport { type BaseLLMParams } from \"@langchain/core/language_models/llms\";\nimport { OpenAI } from \"../llms.js\";\nimport type { OpenAIInput, AzureOpenAIInput, OpenAICoreRequestOptions } from \"../types.js\";\nexport declare class AzureOpenAI extends OpenAI {\n azureOpenAIApiVersion?: string;\n azureOpenAIApiKey?: string;\n azureADTokenProvider?: () => Promise<string>;\n azureOpenAIApiInstanceName?: string;\n azureOpenAIApiDeploymentName?: string;\n azureOpenAIBasePath?: string;\n azureOpenAIEndpoint?: string;\n get lc_aliases(): Record<string, string>;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n constructor(fields?: Partial<OpenAIInput> & {\n openAIApiKey?: string;\n openAIApiVersion?: string;\n openAIBasePath?: string;\n deploymentName?: string;\n } & Partial<AzureOpenAIInput> & BaseLLMParams & {\n configuration?: ClientOptions;\n });\n protected _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n toJSON(): any;\n}\n"],"mappings":";;;;;;cAIqBM,aAAAA,SAAoBJ,MAAAA;;EAApBI,iBAAW,CAAA,EAAA,MAAA;EAAA,oBAAA,CAAA,EAAA,GAAA,GAGCC,OAHD,CAAA,MAAA,CAAA;EAAA,0BAGCA,CAAAA,EAAAA,MAAAA;EAAO,4BAKlBC,CAAAA,EAAAA,MAAAA;EAAM,mBAIKL,CAAAA,EAAAA,MAAAA;EAAW,mBAAnBM,CAAAA,EAAAA,MAAAA;EAAO,IAKhBL,UAAAA,CAAAA,CAAAA,EATMI,MASNJ,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAgB,IAAxBK,UAAAA,CAAAA,CAAAA,EAAAA;IAA4BR,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAa,CAAA,GACzBD,SAAAA;EAAa,WAEIK,CAAAA,OAAAA,EARhBI,OAQgBJ,CARRF,WAQQE,CAAAA,GAAAA;IAAuCA,YAAAA,CAAAA,EAAAA,MAAAA;IApBvCH,gBAAAA,CAAAA,EAAAA,MAAAA;IAAM,cAAA,CAAA,EAAA,MAAA;;MAiBvCO,QAAQL,oBAAoBH;oBACZD;;uCAEiBK,uCAAuCA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.cts","names":["____________langchain_core_dist_utils_stream_js0","ClientOptions","OpenAI","OpenAIClient","AIMessageChunk","BaseMessage","ChatGeneration","BaseChatModel","LangSmithParams","BaseChatModelParams","BaseChatModelCallOptions","BaseFunctionCallOptions","BaseLanguageModelInput","StructuredOutputMethodOptions","ModelProfile","Runnable","InteropZodType","OpenAICallOptions","OpenAIChatInput","OpenAICoreRequestOptions","ChatOpenAIResponseFormat","ResponseFormatConfiguration","OpenAIVerbosityParam","OpenAIToolChoice","ChatOpenAIToolType","ResponsesToolChoice","OpenAILLMOutput","BaseChatOpenAICallOptions","Chat","ChatCompletionStreamOptions","ChatCompletionModality","Array","ChatCompletionAudioParam","ChatCompletionPredictionContent","Reasoning","ChatCompletionCreateParams","BaseChatOpenAIFields","Partial","BaseChatOpenAI","CallOptions","Record","Omit","ChatCompletionTool","_langchain_core_messages0","MessageStructure","IterableReadableStream","Promise","Function","ChatCompletionFunctionCallOption","RunOutput"],"sources":["../../src/chat_models/base.d.ts"],"sourcesContent":["import { type ClientOptions, OpenAI as OpenAIClient } from \"openai\";\nimport { AIMessageChunk, type BaseMessage } from \"@langchain/core/messages\";\nimport { type ChatGeneration } from \"@langchain/core/outputs\";\nimport { BaseChatModel, type LangSmithParams, type BaseChatModelParams, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { type BaseFunctionCallOptions, type BaseLanguageModelInput, type StructuredOutputMethodOptions } from \"@langchain/core/language_models/base\";\nimport { ModelProfile } from \"@langchain/core/language_models/profile\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { InteropZodType } from \"@langchain/core/utils/types\";\nimport { type OpenAICallOptions, type OpenAIChatInput, type OpenAICoreRequestOptions, type ChatOpenAIResponseFormat, ResponseFormatConfiguration, OpenAIVerbosityParam } from \"../types.js\";\nimport { OpenAIToolChoice, ChatOpenAIToolType, ResponsesToolChoice } from \"../utils/tools.js\";\ninterface OpenAILLMOutput {\n tokenUsage: {\n completionTokens?: number;\n promptTokens?: number;\n totalTokens?: number;\n };\n}\nexport type { OpenAICallOptions, OpenAIChatInput };\nexport interface BaseChatOpenAICallOptions extends BaseChatModelCallOptions, BaseFunctionCallOptions {\n /**\n * Additional options to pass to the underlying axios request.\n */\n options?: OpenAICoreRequestOptions;\n /**\n * A list of tools that the model may use to generate responses.\n * Each tool can be a function, a built-in tool, or a custom tool definition.\n * If not provided, the model will not use any tools.\n */\n tools?: ChatOpenAIToolType[];\n /**\n * Specifies which tool the model should use to respond.\n * Can be an {@link OpenAIToolChoice} or a {@link ResponsesToolChoice}.\n * If not set, the model will decide which tool to use automatically.\n */\n // TODO: break OpenAIToolChoice and ResponsesToolChoice into options sub classes\n tool_choice?: OpenAIToolChoice | ResponsesToolChoice;\n /**\n * Adds a prompt index to prompts passed to the model to track\n * what prompt is being used for a given generation.\n */\n promptIndex?: number;\n /**\n * An object specifying the format that the model must output.\n */\n response_format?: ChatOpenAIResponseFormat;\n /**\n * When provided, the completions API will make a best effort to sample\n * deterministically, such that repeated requests with the same `seed`\n * and parameters should return the same result.\n */\n seed?: number;\n /**\n * Additional options to pass to streamed completions.\n * If provided, this takes precedence over \"streamUsage\" set at\n * initialization time.\n */\n stream_options?: OpenAIClient.Chat.ChatCompletionStreamOptions;\n /**\n * The model may choose to call multiple functions in a single turn. You can\n * set parallel_tool_calls to false which ensures only one tool is called at most.\n * [Learn more](https://platform.openai.com/docs/guides/function-calling#parallel-function-calling)\n */\n parallel_tool_calls?: boolean;\n /**\n * If `true`, model output is guaranteed to exactly match the JSON Schema\n * provided in the tool definition. If `true`, the input schema will also be\n * validated according to\n * https://platform.openai.com/docs/guides/structured-outputs/supported-schemas.\n *\n * If `false`, input schema will not be validated and model output will not\n * be validated.\n *\n * If `undefined`, `strict` argument will not be passed to the model.\n */\n strict?: boolean;\n /**\n * Output types that you would like the model to generate for this request. Most\n * models are capable of generating text, which is the default:\n *\n * `[\"text\"]`\n *\n * The `gpt-4o-audio-preview` model can also be used to\n * [generate audio](https://platform.openai.com/docs/guides/audio). To request that\n * this model generate both text and audio responses, you can use:\n *\n * `[\"text\", \"audio\"]`\n */\n modalities?: Array<OpenAIClient.Chat.ChatCompletionModality>;\n /**\n * Parameters for audio output. Required when audio output is requested with\n * `modalities: [\"audio\"]`.\n * [Learn more](https://platform.openai.com/docs/guides/audio).\n */\n audio?: OpenAIClient.Chat.ChatCompletionAudioParam;\n /**\n * Static predicted output content, such as the content of a text file that is being regenerated.\n * [Learn more](https://platform.openai.com/docs/guides/latency-optimization#use-predicted-outputs).\n */\n prediction?: OpenAIClient.ChatCompletionPredictionContent;\n /**\n * Options for reasoning models.\n *\n * Note that some options, like reasoning summaries, are only available when using the responses\n * API. If these options are set, the responses API will be used to fulfill the request.\n *\n * These options will be ignored when not using a reasoning model.\n */\n reasoning?: OpenAIClient.Reasoning;\n /**\n * Service tier to use for this request. Can be \"auto\", \"default\", or \"flex\"\n * Specifies the service tier for prioritization and latency optimization.\n */\n service_tier?: OpenAIClient.Chat.ChatCompletionCreateParams[\"service_tier\"];\n /**\n * Used by OpenAI to cache responses for similar requests to optimize your cache\n * hit rates. Replaces the `user` field.\n * [Learn more](https://platform.openai.com/docs/guides/prompt-caching).\n */\n promptCacheKey?: string;\n /**\n * The verbosity of the model's response.\n */\n verbosity?: OpenAIVerbosityParam;\n}\nexport interface BaseChatOpenAIFields extends Partial<OpenAIChatInput>, BaseChatModelParams {\n /**\n * Optional configuration options for the OpenAI client.\n */\n configuration?: ClientOptions;\n}\n/** @internal */\nexport declare abstract class BaseChatOpenAI<CallOptions extends BaseChatOpenAICallOptions> extends BaseChatModel<CallOptions, AIMessageChunk> implements Partial<OpenAIChatInput> {\n temperature?: number;\n topP?: number;\n frequencyPenalty?: number;\n presencePenalty?: number;\n n?: number;\n logitBias?: Record<string, number>;\n model: string;\n modelKwargs?: OpenAIChatInput[\"modelKwargs\"];\n stop?: string[];\n stopSequences?: string[];\n user?: string;\n timeout?: number;\n streaming: boolean;\n streamUsage: boolean;\n maxTokens?: number;\n logprobs?: boolean;\n topLogprobs?: number;\n apiKey?: string;\n organization?: string;\n __includeRawResponse?: boolean;\n /** @internal */\n client: OpenAIClient;\n /** @internal */\n clientConfig: ClientOptions;\n /**\n * Whether the model supports the `strict` argument when passing in tools.\n * If `undefined` the `strict` argument will not be passed to OpenAI.\n */\n supportsStrictToolCalling?: boolean;\n audio?: OpenAIClient.Chat.ChatCompletionAudioParam;\n modalities?: Array<OpenAIClient.Chat.ChatCompletionModality>;\n reasoning?: OpenAIClient.Reasoning;\n /**\n * Must be set to `true` in tenancies with Zero Data Retention. Setting to `true` will disable\n * output storage in the Responses API, but this DOES NOT enable Zero Data Retention in your\n * OpenAI organization or project. This must be configured directly with OpenAI.\n *\n * See:\n * https://platform.openai.com/docs/guides/your-data\n * https://platform.openai.com/docs/api-reference/responses/create#responses-create-store\n *\n * @default false\n */\n zdrEnabled?: boolean | undefined;\n /**\n * Service tier to use for this request. Can be \"auto\", \"default\", or \"flex\" or \"priority\".\n * Specifies the service tier for prioritization and latency optimization.\n */\n service_tier?: OpenAIClient.Chat.ChatCompletionCreateParams[\"service_tier\"];\n /**\n * Used by OpenAI to cache responses for similar requests to optimize your cache\n * hit rates.\n * [Learn more](https://platform.openai.com/docs/guides/prompt-caching).\n */\n promptCacheKey: string;\n /**\n * The verbosity of the model's response.\n */\n verbosity?: OpenAIVerbosityParam;\n protected defaultOptions: CallOptions;\n _llmType(): string;\n static lc_name(): string;\n get callKeys(): string[];\n lc_serializable: boolean;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n get lc_aliases(): Record<string, string>;\n get lc_serializable_keys(): string[];\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n /** @ignore */\n _identifyingParams(): Omit<OpenAIClient.Chat.ChatCompletionCreateParams, \"messages\"> & {\n model_name: string;\n } & ClientOptions;\n /**\n * Get the identifying parameters for the model\n */\n identifyingParams(): Omit<OpenAIClient.ChatCompletionCreateParams, \"messages\"> & {\n model_name: string;\n } & ClientOptions;\n constructor(fields?: BaseChatOpenAIFields);\n /**\n * Returns backwards compatible reasoning parameters from constructor params and call options\n * @internal\n */\n protected _getReasoningParams(options?: this[\"ParsedCallOptions\"]): OpenAIClient.Reasoning | undefined;\n /**\n * Returns an openai compatible response format from a set of options\n * @internal\n */\n protected _getResponseFormat(resFormat?: CallOptions[\"response_format\"]): ResponseFormatConfiguration | undefined;\n protected _combineCallOptions(additionalOptions?: this[\"ParsedCallOptions\"]): this[\"ParsedCallOptions\"];\n /** @internal */\n _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\n // TODO: move to completions class\n protected _convertChatOpenAIToolToCompletionsTool(tool: ChatOpenAIToolType, fields?: {\n strict?: boolean;\n }): OpenAIClient.ChatCompletionTool;\n bindTools(tools: ChatOpenAIToolType[], kwargs?: Partial<CallOptions>): Runnable<BaseLanguageModelInput, AIMessageChunk, CallOptions>;\n stream(input: BaseLanguageModelInput, options?: CallOptions): Promise<import(\"../../../../langchain-core/dist/utils/stream.js\").IterableReadableStream<AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure>>>;\n invoke(input: BaseLanguageModelInput, options?: CallOptions): Promise<AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure>>;\n /** @ignore */\n _combineLLMOutput(...llmOutputs: OpenAILLMOutput[]): OpenAILLMOutput;\n getNumTokensFromMessages(messages: BaseMessage[]): Promise<{\n totalCount: number;\n countPerMessage: number[];\n }>;\n /** @internal */\n protected _getNumTokensFromGenerations(generations: ChatGeneration[]): Promise<number>;\n /** @internal */\n protected _getEstimatedTokenCountFromPrompt(messages: BaseMessage[], functions?: OpenAIClient.Chat.ChatCompletionCreateParams.Function[], function_call?: \"none\" | \"auto\" | OpenAIClient.Chat.ChatCompletionFunctionCallOption): Promise<number>;\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 * @example\n * ```typescript\n * const model = new ChatOpenAI({ model: \"gpt-4o\" });\n * const profile = model.profile;\n * console.log(profile.maxInputTokens); // 128000\n * console.log(profile.imageInputs); // true\n * ```\n */\n get profile(): ModelProfile;\n /** @internal */\n protected _getStructuredOutputMethod(config: StructuredOutputMethodOptions<boolean>): string | undefined;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\n"],"mappings":";;;;;;;;;;;;;;UAUU0B,eAAAA;;;;IAAAA,WAAAA,CAAAA,EAAe,MAAA;EAQRC,CAAAA;;AAULH,UAVKG,yBAAAA,SAAkCjB,wBAUvCc,EAViEb,uBAUjEa,CAAAA;EAAkB;;;EAgBgB,OAYzBrB,CAAAA,EAlCPgB,wBAkCyBU;EAA2B;;;;;EAmD5B,KAKnB1B,CAAAA,EApFPqB,kBAoFyBW,EAAAA;EAA0B;;;AA9FqC;AA0GpG;EAAqC;EAAA,WAAiBjB,CAAAA,EAzFpCK,gBAyFoCL,GAzFjBO,mBAyFiBP;EAAe;;;AAAsB;EAO7DoB,WAAAA,CAAAA,EAAAA,MAAc;EAAA;;;EAAiF,eAAElC,CAAAA,EAvFzGgB,wBAuFyGhB;EAAc;;;;;EAwB9G,IAMnBD,CAAAA,EAAAA,MAAayB;EAA6B;;;;;EA6BlB,cACNW,CAAAA,EAvITpC,QAAAA,CAAayB,IAAAA,CAAKC,2BAuITU;EA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;YACG4C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":["____________langchain_core_dist_utils_stream_js0","ClientOptions","OpenAI","OpenAIClient","AIMessageChunk","BaseMessage","ChatGeneration","BaseChatModel","LangSmithParams","BaseChatModelParams","BaseChatModelCallOptions","BaseFunctionCallOptions","BaseLanguageModelInput","StructuredOutputMethodOptions","ModelProfile","Runnable","InteropZodType","OpenAICallOptions","OpenAIChatInput","OpenAICoreRequestOptions","ChatOpenAIResponseFormat","ResponseFormatConfiguration","OpenAIVerbosityParam","OpenAIToolChoice","ChatOpenAIToolType","ResponsesToolChoice","OpenAILLMOutput","BaseChatOpenAICallOptions","Chat","ChatCompletionStreamOptions","ChatCompletionModality","Array","ChatCompletionAudioParam","ChatCompletionPredictionContent","Reasoning","ChatCompletionCreateParams","BaseChatOpenAIFields","Partial","BaseChatOpenAI","CallOptions","Record","Omit","ChatCompletionTool","_langchain_core_messages0","MessageStructure","IterableReadableStream","Promise","Function","ChatCompletionFunctionCallOption","RunOutput"],"sources":["../../src/chat_models/base.d.ts"],"sourcesContent":["import { type ClientOptions, OpenAI as OpenAIClient } from \"openai\";\nimport { AIMessageChunk, type BaseMessage } from \"@langchain/core/messages\";\nimport { type ChatGeneration } from \"@langchain/core/outputs\";\nimport { BaseChatModel, type LangSmithParams, type BaseChatModelParams, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { type BaseFunctionCallOptions, type BaseLanguageModelInput, type StructuredOutputMethodOptions } from \"@langchain/core/language_models/base\";\nimport { ModelProfile } from \"@langchain/core/language_models/profile\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { InteropZodType } from \"@langchain/core/utils/types\";\nimport { type OpenAICallOptions, type OpenAIChatInput, type OpenAICoreRequestOptions, type ChatOpenAIResponseFormat, ResponseFormatConfiguration, OpenAIVerbosityParam } from \"../types.js\";\nimport { OpenAIToolChoice, ChatOpenAIToolType, ResponsesToolChoice } from \"../utils/tools.js\";\ninterface OpenAILLMOutput {\n tokenUsage: {\n completionTokens?: number;\n promptTokens?: number;\n totalTokens?: number;\n };\n}\nexport type { OpenAICallOptions, OpenAIChatInput };\nexport interface BaseChatOpenAICallOptions extends BaseChatModelCallOptions, BaseFunctionCallOptions {\n /**\n * Additional options to pass to the underlying axios request.\n */\n options?: OpenAICoreRequestOptions;\n /**\n * A list of tools that the model may use to generate responses.\n * Each tool can be a function, a built-in tool, or a custom tool definition.\n * If not provided, the model will not use any tools.\n */\n tools?: ChatOpenAIToolType[];\n /**\n * Specifies which tool the model should use to respond.\n * Can be an {@link OpenAIToolChoice} or a {@link ResponsesToolChoice}.\n * If not set, the model will decide which tool to use automatically.\n */\n // TODO: break OpenAIToolChoice and ResponsesToolChoice into options sub classes\n tool_choice?: OpenAIToolChoice | ResponsesToolChoice;\n /**\n * Adds a prompt index to prompts passed to the model to track\n * what prompt is being used for a given generation.\n */\n promptIndex?: number;\n /**\n * An object specifying the format that the model must output.\n */\n response_format?: ChatOpenAIResponseFormat;\n /**\n * When provided, the completions API will make a best effort to sample\n * deterministically, such that repeated requests with the same `seed`\n * and parameters should return the same result.\n */\n seed?: number;\n /**\n * Additional options to pass to streamed completions.\n * If provided, this takes precedence over \"streamUsage\" set at\n * initialization time.\n */\n stream_options?: OpenAIClient.Chat.ChatCompletionStreamOptions;\n /**\n * The model may choose to call multiple functions in a single turn. You can\n * set parallel_tool_calls to false which ensures only one tool is called at most.\n * [Learn more](https://platform.openai.com/docs/guides/function-calling#parallel-function-calling)\n */\n parallel_tool_calls?: boolean;\n /**\n * If `true`, model output is guaranteed to exactly match the JSON Schema\n * provided in the tool definition. If `true`, the input schema will also be\n * validated according to\n * https://platform.openai.com/docs/guides/structured-outputs/supported-schemas.\n *\n * If `false`, input schema will not be validated and model output will not\n * be validated.\n *\n * If `undefined`, `strict` argument will not be passed to the model.\n */\n strict?: boolean;\n /**\n * Output types that you would like the model to generate for this request. Most\n * models are capable of generating text, which is the default:\n *\n * `[\"text\"]`\n *\n * The `gpt-4o-audio-preview` model can also be used to\n * [generate audio](https://platform.openai.com/docs/guides/audio). To request that\n * this model generate both text and audio responses, you can use:\n *\n * `[\"text\", \"audio\"]`\n */\n modalities?: Array<OpenAIClient.Chat.ChatCompletionModality>;\n /**\n * Parameters for audio output. Required when audio output is requested with\n * `modalities: [\"audio\"]`.\n * [Learn more](https://platform.openai.com/docs/guides/audio).\n */\n audio?: OpenAIClient.Chat.ChatCompletionAudioParam;\n /**\n * Static predicted output content, such as the content of a text file that is being regenerated.\n * [Learn more](https://platform.openai.com/docs/guides/latency-optimization#use-predicted-outputs).\n */\n prediction?: OpenAIClient.ChatCompletionPredictionContent;\n /**\n * Options for reasoning models.\n *\n * Note that some options, like reasoning summaries, are only available when using the responses\n * API. If these options are set, the responses API will be used to fulfill the request.\n *\n * These options will be ignored when not using a reasoning model.\n */\n reasoning?: OpenAIClient.Reasoning;\n /**\n * Service tier to use for this request. Can be \"auto\", \"default\", or \"flex\"\n * Specifies the service tier for prioritization and latency optimization.\n */\n service_tier?: OpenAIClient.Chat.ChatCompletionCreateParams[\"service_tier\"];\n /**\n * Used by OpenAI to cache responses for similar requests to optimize your cache\n * hit rates. Replaces the `user` field.\n * [Learn more](https://platform.openai.com/docs/guides/prompt-caching).\n */\n promptCacheKey?: string;\n /**\n * The verbosity of the model's response.\n */\n verbosity?: OpenAIVerbosityParam;\n}\nexport interface BaseChatOpenAIFields extends Partial<OpenAIChatInput>, BaseChatModelParams {\n /**\n * Optional configuration options for the OpenAI client.\n */\n configuration?: ClientOptions;\n}\n/** @internal */\nexport declare abstract class BaseChatOpenAI<CallOptions extends BaseChatOpenAICallOptions> extends BaseChatModel<CallOptions, AIMessageChunk> implements Partial<OpenAIChatInput> {\n temperature?: number;\n topP?: number;\n frequencyPenalty?: number;\n presencePenalty?: number;\n n?: number;\n logitBias?: Record<string, number>;\n model: string;\n modelKwargs?: OpenAIChatInput[\"modelKwargs\"];\n stop?: string[];\n stopSequences?: string[];\n user?: string;\n timeout?: number;\n streaming: boolean;\n streamUsage: boolean;\n maxTokens?: number;\n logprobs?: boolean;\n topLogprobs?: number;\n apiKey?: string;\n organization?: string;\n __includeRawResponse?: boolean;\n /** @internal */\n client: OpenAIClient;\n /** @internal */\n clientConfig: ClientOptions;\n /**\n * Whether the model supports the `strict` argument when passing in tools.\n * If `undefined` the `strict` argument will not be passed to OpenAI.\n */\n supportsStrictToolCalling?: boolean;\n audio?: OpenAIClient.Chat.ChatCompletionAudioParam;\n modalities?: Array<OpenAIClient.Chat.ChatCompletionModality>;\n reasoning?: OpenAIClient.Reasoning;\n /**\n * Must be set to `true` in tenancies with Zero Data Retention. Setting to `true` will disable\n * output storage in the Responses API, but this DOES NOT enable Zero Data Retention in your\n * OpenAI organization or project. This must be configured directly with OpenAI.\n *\n * See:\n * https://platform.openai.com/docs/guides/your-data\n * https://platform.openai.com/docs/api-reference/responses/create#responses-create-store\n *\n * @default false\n */\n zdrEnabled?: boolean | undefined;\n /**\n * Service tier to use for this request. Can be \"auto\", \"default\", or \"flex\" or \"priority\".\n * Specifies the service tier for prioritization and latency optimization.\n */\n service_tier?: OpenAIClient.Chat.ChatCompletionCreateParams[\"service_tier\"];\n /**\n * Used by OpenAI to cache responses for similar requests to optimize your cache\n * hit rates.\n * [Learn more](https://platform.openai.com/docs/guides/prompt-caching).\n */\n promptCacheKey: string;\n /**\n * The verbosity of the model's response.\n */\n verbosity?: OpenAIVerbosityParam;\n protected defaultOptions: CallOptions;\n _llmType(): string;\n static lc_name(): string;\n get callKeys(): string[];\n lc_serializable: boolean;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n get lc_aliases(): Record<string, string>;\n get lc_serializable_keys(): string[];\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n /** @ignore */\n _identifyingParams(): Omit<OpenAIClient.Chat.ChatCompletionCreateParams, \"messages\"> & {\n model_name: string;\n } & ClientOptions;\n /**\n * Get the identifying parameters for the model\n */\n identifyingParams(): Omit<OpenAIClient.ChatCompletionCreateParams, \"messages\"> & {\n model_name: string;\n } & ClientOptions;\n constructor(fields?: BaseChatOpenAIFields);\n /**\n * Returns backwards compatible reasoning parameters from constructor params and call options\n * @internal\n */\n protected _getReasoningParams(options?: this[\"ParsedCallOptions\"]): OpenAIClient.Reasoning | undefined;\n /**\n * Returns an openai compatible response format from a set of options\n * @internal\n */\n protected _getResponseFormat(resFormat?: CallOptions[\"response_format\"]): ResponseFormatConfiguration | undefined;\n protected _combineCallOptions(additionalOptions?: this[\"ParsedCallOptions\"]): this[\"ParsedCallOptions\"];\n /** @internal */\n _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;\n // TODO: move to completions class\n protected _convertChatOpenAIToolToCompletionsTool(tool: ChatOpenAIToolType, fields?: {\n strict?: boolean;\n }): OpenAIClient.ChatCompletionTool;\n bindTools(tools: ChatOpenAIToolType[], kwargs?: Partial<CallOptions>): Runnable<BaseLanguageModelInput, AIMessageChunk, CallOptions>;\n stream(input: BaseLanguageModelInput, options?: CallOptions): Promise<import(\"../../../../langchain-core/dist/utils/stream.js\").IterableReadableStream<AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure>>>;\n invoke(input: BaseLanguageModelInput, options?: CallOptions): Promise<AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure>>;\n /** @ignore */\n _combineLLMOutput(...llmOutputs: OpenAILLMOutput[]): OpenAILLMOutput;\n getNumTokensFromMessages(messages: BaseMessage[]): Promise<{\n totalCount: number;\n countPerMessage: number[];\n }>;\n /** @internal */\n protected _getNumTokensFromGenerations(generations: ChatGeneration[]): Promise<number>;\n /** @internal */\n protected _getEstimatedTokenCountFromPrompt(messages: BaseMessage[], functions?: OpenAIClient.Chat.ChatCompletionCreateParams.Function[], function_call?: \"none\" | \"auto\" | OpenAIClient.Chat.ChatCompletionFunctionCallOption): Promise<number>;\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 * @example\n * ```typescript\n * const model = new ChatOpenAI({ model: \"gpt-4o\" });\n * const profile = model.profile;\n * console.log(profile.maxInputTokens); // 128000\n * console.log(profile.imageInputs); // true\n * ```\n */\n get profile(): ModelProfile;\n /** @internal */\n protected _getStructuredOutputMethod(config: StructuredOutputMethodOptions<boolean>): string | undefined;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\n"],"mappings":";;;;;;;;;;;;;;UAUU0B,eAAAA;;;;IAAAA,WAAAA,CAAAA,EAAe,MAAA;EAQRC,CAAAA;;AAULH,UAVKG,yBAAAA,SAAkCjB,wBAUvCc,EAViEb,uBAUjEa,CAAAA;EAAkB;;;EAgBgB,OAYzBrB,CAAAA,EAlCPgB,wBAkCyBU;EAA2B;;;;;EAmD5B,KAKnB1B,CAAAA,EApFPqB,kBAoFyBW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B,mCAAmCF;;;;;;;;;;;;;;;;;;iBAkBlNhC;;+CAE8BD;;;oBAG3B2B,sBAAsBA,mCAAmCxB,eAAeiC;;IAEvFT,8BAA8B3B,uCAAuCE,SAASH,wBAAwBqC;;;oBAGvFT,sBAAsBA,mCAAmCxB,eAAeiC;;IAEvFT,8BAA8B3B,sCAAsCE,SAASH;SACvEP;YACG4C;;;;oBAIMT,sBAAsBA,mCAAmCxB,eAAeiC;;IAEvFT,8BAA8B3B,yCAAyCE,SAASH,wBAAwBqC,aAAalC,SAASH;SACxHP;YACG4C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completions.d.cts","names":["OpenAI","OpenAIClient","CallbackManagerForLLMRun","BaseMessage","BaseMessageChunk","ChatGenerationChunk","ChatResult","BaseChatOpenAICallOptions","BaseChatOpenAI","ChatOpenAICompletionsCallOptions","ChatCompletionsInvocationParams","Chat","Completions","ChatCompletionCreateParams","Omit","ChatOpenAICompletions","CallOptions","Promise","AsyncGenerator","ChatCompletionCreateParamsStreaming","RequestOptions","ChatCompletionChunk","AsyncIterable","ChatCompletionCreateParamsNonStreaming","ChatCompletion","Record","ChatCompletionRole","ChatCompletionMessage"],"sources":["../../src/chat_models/completions.d.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport { type BaseMessage, BaseMessageChunk } from \"@langchain/core/messages\";\nimport { ChatGenerationChunk, type ChatResult } from \"@langchain/core/outputs\";\nimport { BaseChatOpenAICallOptions } from \"./base.js\";\nimport { BaseChatOpenAI } from \"./base.js\";\nexport interface ChatOpenAICompletionsCallOptions extends BaseChatOpenAICallOptions {\n}\ntype ChatCompletionsInvocationParams = Omit<OpenAIClient.Chat.Completions.ChatCompletionCreateParams, \"messages\">;\n/**\n * OpenAI Completions API implementation.\n * @internal\n */\nexport declare class ChatOpenAICompletions<CallOptions extends ChatOpenAICompletionsCallOptions = ChatOpenAICompletionsCallOptions> extends BaseChatOpenAI<CallOptions> {\n /** @internal */\n invocationParams(options?: this[\"ParsedCallOptions\"], extra?: {\n streaming?: boolean;\n }): ChatCompletionsInvocationParams;\n _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n _streamResponseChunks(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;\n completionWithRetry(request: OpenAIClient.Chat.ChatCompletionCreateParamsStreaming, requestOptions?: OpenAIClient.RequestOptions): Promise<AsyncIterable<OpenAIClient.Chat.Completions.ChatCompletionChunk>>;\n completionWithRetry(request: OpenAIClient.Chat.ChatCompletionCreateParamsNonStreaming, requestOptions?: OpenAIClient.RequestOptions): Promise<OpenAIClient.Chat.Completions.ChatCompletion>;\n /**\n * @deprecated\n * This function was hoisted into a publicly accessible function from a\n * different export, but to maintain backwards compatibility with chat models\n * that depend on ChatOpenAICompletions, we'll keep it here as an overridable\n * method. This will be removed in a future release\n */\n protected _convertCompletionsDeltaToBaseMessageChunk(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delta: Record<string, any>, rawResponse: OpenAIClient.Chat.Completions.ChatCompletionChunk, defaultRole?: OpenAIClient.Chat.ChatCompletionRole): BaseMessageChunk;\n /**\n * @deprecated\n * This function was hoisted into a publicly accessible function from a\n * different export, but to maintain backwards compatibility with chat models\n * that depend on ChatOpenAICompletions, we'll keep it here as an overridable\n * method. This will be removed in a future release\n */\n protected _convertCompletionsMessageToBaseMessage(message: OpenAIClient.ChatCompletionMessage, rawResponse: OpenAIClient.ChatCompletion): BaseMessage;\n}\nexport {};\n"],"mappings":";;;;;;;UAMiBS,gCAAAA,SAAyCF,2BAA1D;AACC,KACIG,+BAAAA,GAAkCI,IAAH,CAAQb,QAAAA,CAAaU,IAAAA,CAAKC,WAAAA,CAAYC,0BAAtC,EAAA,UAAA,CAAA;;;;AAAO;AAKtB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EAAAA,GAAAA,CAAAA,EAAAA,WAAAA,EAW1FhB,QAAAA,CAAaU,IAAAA,CAAKC,WAAAA,CAAYS,mBAX4DJ,EAAAA,WAAAA,CAAAA,EAWzBhB,QAAAA,CAAaU,IAAAA,CAAKe,kBAXOT,CAAAA,EAWcb,gBAXda;EAAO;;;;;;;EAWI,UAAGb,uCAAAA,CAAAA,OAAAA,EAQtFH,QAAAA,CAAa0B,qBARyEvB,EAAAA,WAAAA,EAQrCH,QAAAA,CAAauB,cARwBpB,CAAAA,EAQPD,WAROC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completions.d.ts","names":["OpenAI","OpenAIClient","CallbackManagerForLLMRun","BaseMessage","BaseMessageChunk","ChatGenerationChunk","ChatResult","BaseChatOpenAICallOptions","BaseChatOpenAI","ChatOpenAICompletionsCallOptions","ChatCompletionsInvocationParams","Chat","Completions","ChatCompletionCreateParams","Omit","ChatOpenAICompletions","CallOptions","Promise","AsyncGenerator","ChatCompletionCreateParamsStreaming","RequestOptions","ChatCompletionChunk","AsyncIterable","ChatCompletionCreateParamsNonStreaming","ChatCompletion","Record","ChatCompletionRole","ChatCompletionMessage"],"sources":["../../src/chat_models/completions.d.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport { type BaseMessage, BaseMessageChunk } from \"@langchain/core/messages\";\nimport { ChatGenerationChunk, type ChatResult } from \"@langchain/core/outputs\";\nimport { BaseChatOpenAICallOptions } from \"./base.js\";\nimport { BaseChatOpenAI } from \"./base.js\";\nexport interface ChatOpenAICompletionsCallOptions extends BaseChatOpenAICallOptions {\n}\ntype ChatCompletionsInvocationParams = Omit<OpenAIClient.Chat.Completions.ChatCompletionCreateParams, \"messages\">;\n/**\n * OpenAI Completions API implementation.\n * @internal\n */\nexport declare class ChatOpenAICompletions<CallOptions extends ChatOpenAICompletionsCallOptions = ChatOpenAICompletionsCallOptions> extends BaseChatOpenAI<CallOptions> {\n /** @internal */\n invocationParams(options?: this[\"ParsedCallOptions\"], extra?: {\n streaming?: boolean;\n }): ChatCompletionsInvocationParams;\n _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n _streamResponseChunks(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;\n completionWithRetry(request: OpenAIClient.Chat.ChatCompletionCreateParamsStreaming, requestOptions?: OpenAIClient.RequestOptions): Promise<AsyncIterable<OpenAIClient.Chat.Completions.ChatCompletionChunk>>;\n completionWithRetry(request: OpenAIClient.Chat.ChatCompletionCreateParamsNonStreaming, requestOptions?: OpenAIClient.RequestOptions): Promise<OpenAIClient.Chat.Completions.ChatCompletion>;\n /**\n * @deprecated\n * This function was hoisted into a publicly accessible function from a\n * different export, but to maintain backwards compatibility with chat models\n * that depend on ChatOpenAICompletions, we'll keep it here as an overridable\n * method. This will be removed in a future release\n */\n protected _convertCompletionsDeltaToBaseMessageChunk(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delta: Record<string, any>, rawResponse: OpenAIClient.Chat.Completions.ChatCompletionChunk, defaultRole?: OpenAIClient.Chat.ChatCompletionRole): BaseMessageChunk;\n /**\n * @deprecated\n * This function was hoisted into a publicly accessible function from a\n * different export, but to maintain backwards compatibility with chat models\n * that depend on ChatOpenAICompletions, we'll keep it here as an overridable\n * method. This will be removed in a future release\n */\n protected _convertCompletionsMessageToBaseMessage(message: OpenAIClient.ChatCompletionMessage, rawResponse: OpenAIClient.ChatCompletion): BaseMessage;\n}\nexport {};\n"],"mappings":";;;;;;;UAMiBS,gCAAAA,SAAyCF,2BAA1D;AACC,KACIG,+BAAAA,GAAkCI,IAAH,CAAQb,QAAAA,CAAaU,IAAAA,CAAKC,WAAAA,CAAYC,0BAAtC,EAAA,UAAA,CAAA;;;;AAAO;AAKtBE,cAAAA,qB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