@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.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":["OpenAI","OpenAIClient","ResponseFormatText","ResponseFormatJSONObject","ResponseFormatJSONSchema","ResponseFormatTextPython","ResponseFormatTextGrammar","TiktokenModel","BaseLanguageModelCallOptions","InteropZodObject","OpenAIChatModelId","ChatModel","NonNullable","OpenAIVerbosityParam","OpenAIBaseInput","Record","OpenAICoreRequestOptions","RequestOptions","OpenAICallOptions","OpenAIInput","OpenAIChatInput","Chat","ChatCompletionMessageParam","ChatCompletionModality","Array","ChatCompletionAudioParam","Reasoning","Responses","ResponseCreateParams","AzureOpenAIInput","Promise","AzureOpenAIChatInput","ChatOpenAIResponseFormatJSONSchema","Omit","ChatOpenAIReasoningSummary","ResponseReasoningItem","Summary","ChatOpenAIResponseFormat","ResponseFormatConfiguration"],"sources":["../src/types.d.ts"],"sourcesContent":["import type { OpenAI as OpenAIClient } from \"openai\";\nimport type { ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema, ResponseFormatTextPython, ResponseFormatTextGrammar } from \"openai/resources/shared\";\nimport { TiktokenModel } from \"js-tiktoken/lite\";\nimport type { BaseLanguageModelCallOptions } from \"@langchain/core/language_models/base\";\nimport { InteropZodObject } from \"@langchain/core/utils/types\";\n// reexport this type from the included package so we can easily override and extend it if needed in the future\n// also makes it easier for folks to import this type without digging around into the dependent packages\nexport type { TiktokenModel };\n/**\n * @see https://platform.openai.com/docs/models\n */\nexport type OpenAIChatModelId = OpenAIClient.ChatModel | (string & NonNullable<unknown>);\nexport type OpenAIVerbosityParam = \"low\" | \"medium\" | \"high\" | null;\nexport declare interface OpenAIBaseInput {\n /** Sampling temperature to use */\n temperature: number;\n /**\n * Maximum number of tokens to generate in the completion. -1 returns as many\n * tokens as possible given the prompt and the model's maximum context size.\n */\n maxTokens?: number;\n /**\n * Maximum number of tokens to generate in the completion. -1 returns as many\n * tokens as possible given the prompt and the model's maximum context size.\n * Alias for `maxTokens` for reasoning models.\n */\n maxCompletionTokens?: number;\n /** Total probability mass of tokens to consider at each step */\n topP: number;\n /** Penalizes repeated tokens according to frequency */\n frequencyPenalty: number;\n /** Penalizes repeated tokens */\n presencePenalty: number;\n /** Number of completions to generate for each prompt */\n n: number;\n /** Dictionary used to adjust the probability of specific tokens being generated */\n logitBias?: Record<string, number>;\n /** Unique string identifier representing your end-user, which can help OpenAI to monitor and detect abuse. */\n user?: string;\n /** Whether to stream the results or not. Enabling disables tokenUsage reporting */\n streaming: boolean;\n /**\n * Whether or not to include token usage data in streamed chunks.\n * @default true\n */\n streamUsage?: boolean;\n /**\n * Model name to use\n * Alias for `model`\n * @deprecated Use \"model\" instead.\n */\n modelName: string;\n /** Model name to use */\n model: OpenAIChatModelId;\n /** Holds any additional parameters that are valid to pass to {@link\n * https://platform.openai.com/docs/api-reference/completions/create |\n * `openai.createCompletion`} that are not explicitly specified on this class.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n modelKwargs?: Record<string, any>;\n /**\n * List of stop words to use when generating\n * Alias for `stopSequences`\n */\n stop?: string[];\n /** List of stop words to use when generating */\n stopSequences?: string[];\n /**\n * Timeout to use when making requests to OpenAI.\n */\n timeout?: number;\n /**\n * API key to use when making requests to OpenAI. Defaults to the value of\n * `OPENAI_API_KEY` environment variable.\n * Alias for `apiKey`\n */\n openAIApiKey?: string;\n /**\n * API key to use when making requests to OpenAI. Defaults to the value of\n * `OPENAI_API_KEY` environment variable.\n */\n apiKey?: string;\n /**\n * The verbosity of the model's response.\n */\n verbosity?: OpenAIVerbosityParam;\n}\nexport type OpenAICoreRequestOptions = OpenAIClient.RequestOptions;\nexport interface OpenAICallOptions extends BaseLanguageModelCallOptions {\n /**\n * Additional options to pass to the underlying axios request.\n */\n options?: OpenAICoreRequestOptions;\n}\n/**\n * Input to OpenAI class.\n */\nexport declare interface OpenAIInput extends OpenAIBaseInput {\n /** Generates `bestOf` completions server side and returns the \"best\" */\n bestOf?: number;\n /** Batch size to use when passing multiple documents to generate */\n batchSize: number;\n}\nexport interface OpenAIChatInput extends OpenAIBaseInput {\n /**\n * Whether to return log probabilities of the output tokens or not.\n * If true, returns the log probabilities of each output token returned in the content of message.\n */\n logprobs?: boolean;\n /**\n * An integer between 0 and 5 specifying the number of most likely tokens to return at each token position,\n * each with an associated log probability. logprobs must be set to true if this parameter is used.\n */\n topLogprobs?: number;\n /** ChatGPT messages to pass as a prefix to the prompt */\n prefixMessages?: OpenAIClient.Chat.ChatCompletionMessageParam[];\n /**\n * Whether to include the raw OpenAI response in the output message's \"additional_kwargs\" field.\n * Currently in experimental beta.\n */\n __includeRawResponse?: boolean;\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 /**\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 * Options for reasoning models.\n *\n * Note that some options, like reasoning summaries, are only available when using the responses\n * API. This option is ignored when not using a reasoning model.\n */\n reasoning?: OpenAIClient.Reasoning;\n /**\n * Should be set to `true` in tenancies with Zero Data Retention\n * @see https://platform.openai.com/docs/guides/your-data\n *\n * @default false\n */\n zdrEnabled?: boolean;\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.Responses.ResponseCreateParams[\"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}\nexport interface AzureOpenAIInput {\n /**\n * API version to use when making requests to Azure OpenAI.\n */\n azureOpenAIApiVersion?: string;\n /**\n * API key to use when making requests to Azure OpenAI.\n */\n azureOpenAIApiKey?: string;\n /**\n * Azure OpenAI API instance name to use when making requests to Azure OpenAI.\n * this is the name of the instance you created in the Azure portal.\n * e.g. \"my-openai-instance\"\n * this will be used in the endpoint URL: https://my-openai-instance.openai.azure.com/openai/deployments/{DeploymentName}/\n */\n azureOpenAIApiInstanceName?: string;\n /**\n * Azure OpenAI API deployment name to use for completions when making requests to Azure OpenAI.\n * This is the name of the deployment you created in the Azure portal.\n * e.g. \"my-openai-deployment\"\n * this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/\n */\n azureOpenAIApiDeploymentName?: string;\n /**\n * Azure OpenAI API deployment name to use for embedding when making requests to Azure OpenAI.\n * This is the name of the deployment you created in the Azure portal.\n * This will fallback to azureOpenAIApiDeploymentName if not provided.\n * e.g. \"my-openai-deployment\"\n * this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/\n */\n azureOpenAIApiEmbeddingsDeploymentName?: string;\n /**\n * Azure OpenAI API deployment name to use for completions when making requests to Azure OpenAI.\n * Completions are only available for gpt-3.5-turbo and text-davinci-003 deployments.\n * This is the name of the deployment you created in the Azure portal.\n * This will fallback to azureOpenAIApiDeploymentName if not provided.\n * e.g. \"my-openai-deployment\"\n * this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/\n */\n azureOpenAIApiCompletionsDeploymentName?: string;\n /**\n * Custom base url for Azure OpenAI API. This is useful in case you have a deployment in another region.\n * e.g. setting this value to \"https://westeurope.api.cognitive.microsoft.com/openai/deployments\"\n * will be result in the endpoint URL: https://westeurope.api.cognitive.microsoft.com/openai/deployments/{DeploymentName}/\n */\n azureOpenAIBasePath?: string;\n /**\n * Custom endpoint for Azure OpenAI API. This is useful in case you have a deployment in another region.\n * e.g. setting this value to \"https://westeurope.api.cognitive.microsoft.com/\"\n * will be result in the endpoint URL: https://westeurope.api.cognitive.microsoft.com/openai/deployments/{DeploymentName}/\n */\n azureOpenAIEndpoint?: string;\n /**\n * A function that returns an access token for Microsoft Entra (formerly known as Azure Active Directory),\n * which will be invoked on every request.\n */\n azureADTokenProvider?: () => Promise<string>;\n}\nexport interface AzureOpenAIChatInput extends OpenAIChatInput, AzureOpenAIInput {\n openAIApiKey?: string;\n openAIApiVersion?: string;\n openAIBasePath?: string;\n deploymentName?: string;\n}\ntype ChatOpenAIResponseFormatJSONSchema = Omit<ResponseFormatJSONSchema, \"json_schema\"> & {\n json_schema: Omit<ResponseFormatJSONSchema[\"json_schema\"], \"schema\"> & {\n /**\n * The schema for the response format, described as a JSON Schema object\n * or a Zod object.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schema: Record<string, any> | InteropZodObject;\n };\n};\n/**\n * The summary of a model's reasoning step.\n */\nexport type ChatOpenAIReasoningSummary = Omit<OpenAIClient.Responses.ResponseReasoningItem, \"summary\"> & {\n /**\n * The summary of the reasoning step. The index field will be populated if the response was\n * streamed. This allows LangChain to recompose the reasoning summary output correctly when the\n * AIMessage is used as an input for future generation requests.\n */\n summary: Array<OpenAIClient.Responses.ResponseReasoningItem.Summary & {\n index?: number;\n }>;\n};\nexport type ChatOpenAIResponseFormat = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatTextGrammar | ResponseFormatTextPython | ChatOpenAIResponseFormatJSONSchema;\nexport type ResponseFormatConfiguration = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema;\n"],"mappings":";;;;;;;;;;;AAW8E,KAAlEU,iBAAAA,GAAoBT,QAAAA,CAAaU,SAAiC,GAAA,CAAA,MAAA,GAAXC,WAAW,CAAA,OAAA,CAAA,CAAA;AAClEC,KAAAA,oBAAAA,GAAoB,KAAA,GAAA,QAAA,GAAA,MAAA,GAAA,IAAA;AACPC,kBAAAA,eAAAA,CAAe;EAAA;EAAA,WAuBxBC,EAAAA,MAAAA;EAAM;;;AAiDc;EAExBC,SAAAA,CAAAA,EAAAA,MAAAA;EACKE;;;;AAAsD;EAS9CC,mBAAW,CAAA,EAAA,MAASL;EAM5BM;EAAe,IAAA,EAAA,MAAA;EAAA;EAYiC,gBAuB7BC,EAAKE,MAAAA;EAAsB;EAAzC,eAMGF,EAAKI,MAAAA;EAAwB;EAOhB,CAAA,EAYnBxB,MAAAA;EAA2C;EA5DN,SAAA,CAAA,EAnExCc,MAmEwC,CAAA,MAAA,EAAA,MAAA,CAAA;EAoEvCc;EA0DAE,IAAAA,CAAAA,EAAAA,MAAAA;EAAoB;EAAA,SAASX,EAAAA,OAAAA;EAAe;AAAkB;AAK9E;;EACsC,WAAQhB,CAAAA,EAAAA,OAAAA;EAAwB;;;;;EAOjB,SAAA,EAAA,MAAA;EAM1C8B;EAA0B,KAAA,EAnM3BxB,iBAmM2B;EAAA;;;;EAMpB;EAIN2B,WAAAA,CAAAA,EAvMMtB,MAuMNsB,CAAAA,MAAwB,EAAA,GAAA,CAAA;EAAA;;;;EAA4E,IAAGhC,CAAAA,EAAAA,MAAAA,EAAAA;EAAwB;EAAqC,aAAA,CAAA,EAAA,MAAA,EAAA;EACpKiC;;;EAAgD,OAAGnC,CAAAA,EAAAA,MAAAA;EAAwB;AAA2B;;;;;;;;;;;;;cA9KlGU;;KAEJG,wBAAAA,GAA2Bf,QAAAA,CAAagB;UACnCC,iBAAAA,SAA0BV;;;;YAI7BQ;;;;;kBAKWG,WAAAA,SAAoBL;;;;;;UAM5BM,eAAAA,SAAwBN;;;;;;;;;;;;mBAYpBb,QAAAA,CAAaoB,IAAAA,CAAKC;;;;;;;;;;;;;;;;;;;;;;;eAuBtBE,MAAMvB,QAAAA,CAAaoB,IAAAA,CAAKE;;;;;;UAM7BtB,QAAAA,CAAaoB,IAAAA,CAAKI;;;;;;;cAOdxB,QAAAA,CAAayB;;;;;;;;;;;;iBAYVzB,QAAAA,CAAa0B,SAAAA,CAAUC;;;;;;;;UAQzBC,gBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAwDgBC;;UAEhBC,oBAAAA,SAA6BX,iBAAiBS;;;;;;KAM1DG,kCAAAA,GAAqCC,KAAK7B;eAC9B6B,KAAK7B;;;;;;YAMNW,sBAAsBN;;;;;;KAM1ByB,0BAAAA,GAA6BD,KAAKhC,QAAAA,CAAa0B,SAAAA,CAAUQ;;;;;;WAMxDX,MAAMvB,QAAAA,CAAa0B,SAAAA,CAAUQ,qBAAAA,CAAsBC;;;;KAIpDC,wBAAAA,GAA2BnC,qBAAqBC,2BAA2BG,4BAA4BD,2BAA2B2B;KAClIM,2BAAAA,GAA8BpC,qBAAqBC,2BAA2BC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"azure.d.cts","names":["OpenAIEndpointConfig","Promise","getEndpoint","HeaderValue","HeadersLike","Headers","Record","isHeaders","normalizeHeaders"],"sources":["../../src/utils/azure.d.ts"],"sourcesContent":["export 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 * 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 declare function getEndpoint(config: OpenAIEndpointConfig): string | null | undefined;\ntype HeaderValue = string | undefined | null;\nexport type HeadersLike = Headers | readonly HeaderValue[][] | Record<string, HeaderValue | readonly HeaderValue[]> | undefined | null\n// NullableHeaders\n | {\n values: Headers;\n [key: string]: unknown;\n};\nexport declare function isHeaders(headers: unknown): headers is Headers;\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 declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;\nexport {};\n"],"mappings":";UAAiBA,oBAAAA;EAAAA,4BAAoB,CAAA,EAAA,MAIJC;EA6BTC,0BAAoBF,CAAAA,EAAAA,MAAAA;EACvCG,iBAAW,CAAA,EAAA,MAAA;EACJC,oBAAW,CAAA,EAAA,GAAA,GA/BUH,OA+BV,CAAA,MAAA,CAAA;EAAA,mBAAA,CAAA,EAAA,MAAA;EAAA,OAAGI,CAAAA,EAAAA,MAAAA,GAAAA,IAAAA;EAAO,mBAAYF,CAAAA,EAAAA,MAAAA;;;;;AAG1B;AAGnB;AA8BA;;;;;;AAAsE;;;;;;;;;;;;;iBAtC9CD,WAAAA,SAAoBF;KACvCG,WAAAA;KACOC,WAAAA,GAAcC,mBAAmBF,kBAAkBG,eAAeH,uBAAuBA;;;UAGzFE;;;iBAGYE,SAAAA,+BAAwCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BxCG,gBAAAA,UAA0BJ,cAAcE,eAAeH,uBAAuBA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"azure.d.ts","names":["OpenAIEndpointConfig","Promise","getEndpoint","HeaderValue","HeadersLike","Headers","Record","isHeaders","normalizeHeaders"],"sources":["../../src/utils/azure.d.ts"],"sourcesContent":["export 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 * 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 declare function getEndpoint(config: OpenAIEndpointConfig): string | null | undefined;\ntype HeaderValue = string | undefined | null;\nexport type HeadersLike = Headers | readonly HeaderValue[][] | Record<string, HeaderValue | readonly HeaderValue[]> | undefined | null\n// NullableHeaders\n | {\n values: Headers;\n [key: string]: unknown;\n};\nexport declare function isHeaders(headers: unknown): headers is Headers;\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 declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;\nexport {};\n"],"mappings":";UAAiBA,oBAAAA;EAAAA,4BAAoB,CAAA,EAAA,MAIJC;EA6BTC,0BAAoBF,CAAAA,EAAAA,MAAAA;EACvCG,iBAAW,CAAA,EAAA,MAAA;EACJC,oBAAW,CAAA,EAAA,GAAA,GA/BUH,OA+BV,CAAA,MAAA,CAAA;EAAA,mBAAA,CAAA,EAAA,MAAA;EAAA,OAAGI,CAAAA,EAAAA,MAAAA,GAAAA,IAAAA;EAAO,mBAAYF,CAAAA,EAAAA,MAAAA;;;;;AAG1B;AAGnB;AA8BA;;;;;;AAAsE;;;;;;;;;;;;;iBAtC9CD,WAAAA,SAAoBF;KACvCG,WAAAA;KACOC,WAAAA,GAAcC,mBAAmBF,kBAAkBG,eAAeH,uBAAuBA;;;UAGzFE;;;iBAGYE,SAAAA,+BAAwCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BxCG,gBAAAA,UAA0BJ,cAAcE,eAAeH,uBAAuBA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.cts","names":["wrapOpenAIClientError"],"sources":["../../src/utils/client.d.ts"],"sourcesContent":["export declare function wrapOpenAIClientError(e: unknown): any;\n"],"mappings":";iBAAwBA,qBAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","names":["wrapOpenAIClientError"],"sources":["../../src/utils/client.d.ts"],"sourcesContent":["export declare function wrapOpenAIClientError(e: unknown): any;\n"],"mappings":";iBAAwBA,qBAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"misc.d.cts","names":["OpenAI","OpenAIClient","BaseMessage","ChatMessage","iife","T","isReasoningModel","extractGenericMessageCustomRole","ChatCompletionRole","messageToOpenAIRole"],"sources":["../../src/utils/misc.d.ts"],"sourcesContent":["import type { OpenAI as OpenAIClient } from \"openai\";\nimport { BaseMessage, ChatMessage } from \"@langchain/core/messages\";\nexport declare const iife: <T>(fn: () => T) => T;\nexport declare function isReasoningModel(model?: string): boolean;\nexport declare function extractGenericMessageCustomRole(message: ChatMessage): OpenAIClient.ChatCompletionRole;\nexport declare function messageToOpenAIRole(message: BaseMessage): OpenAIClient.ChatCompletionRole;\n"],"mappings":";;;;;AAK2C,iBAAnBS,mBAAAA,CAAmB,OAAA,EAAUP,WAAV,CAAA,EAAwBD,QAAAA,CAAaO,kBAArC"}
|
package/dist/utils/misc.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"misc.d.ts","names":["OpenAI","OpenAIClient","BaseMessage","ChatMessage","iife","T","isReasoningModel","extractGenericMessageCustomRole","ChatCompletionRole","messageToOpenAIRole"],"sources":["../../src/utils/misc.d.ts"],"sourcesContent":["import type { OpenAI as OpenAIClient } from \"openai\";\nimport { BaseMessage, ChatMessage } from \"@langchain/core/messages\";\nexport declare const iife: <T>(fn: () => T) => T;\nexport declare function isReasoningModel(model?: string): boolean;\nexport declare function extractGenericMessageCustomRole(message: ChatMessage): OpenAIClient.ChatCompletionRole;\nexport declare function messageToOpenAIRole(message: BaseMessage): OpenAIClient.ChatCompletionRole;\n"],"mappings":";;;;;AAK2C,iBAAnBS,mBAAAA,CAAmB,OAAA,EAAUP,WAAV,CAAA,EAAwBD,QAAAA,CAAaO,kBAArC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.cts","names":["BasePromptValue","OpenAI","convertPromptToOpenAI","Chat","ChatCompletionMessageParam"],"sources":["../../src/utils/prompts.d.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport type { OpenAI } from \"openai\";\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by OpenAI's JS SDK.\n *\n * Requires the \"@langchain/openai\" package to be installed in addition\n * to the OpenAI SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToOpenAI } from \"langsmith/utils/hub/openai\";\n * import { pull } from \"langchain/hub\";\n *\n * import OpenAI from 'openai';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { messages } = convertPromptToOpenAI(formattedPrompt);\n *\n * const openAIClient = new OpenAI();\n *\n * const openaiResponse = await openAIClient.chat.completions.create({\n * model: \"gpt-4o-mini\",\n * messages,\n * });\n * ```\n * @param formattedPrompt\n * @returns A partial OpenAI payload.\n */\n// TODO: make this a converter\nexport declare function convertPromptToOpenAI(formattedPrompt: BasePromptValue): {\n messages: OpenAI.Chat.ChatCompletionMessageParam[];\n};\n"],"mappings":";;;;;;;AAkCA;;;;AACoD;;;;;;;;;;;;;;;;;;;;;;;;;;iBAD5BE,qBAAAA,kBAAuCF;YACjDC,QAAAA,CAAOE,IAAAA,CAAKC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","names":["BasePromptValue","OpenAI","convertPromptToOpenAI","Chat","ChatCompletionMessageParam"],"sources":["../../src/utils/prompts.d.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport type { OpenAI } from \"openai\";\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by OpenAI's JS SDK.\n *\n * Requires the \"@langchain/openai\" package to be installed in addition\n * to the OpenAI SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToOpenAI } from \"langsmith/utils/hub/openai\";\n * import { pull } from \"langchain/hub\";\n *\n * import OpenAI from 'openai';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { messages } = convertPromptToOpenAI(formattedPrompt);\n *\n * const openAIClient = new OpenAI();\n *\n * const openaiResponse = await openAIClient.chat.completions.create({\n * model: \"gpt-4o-mini\",\n * messages,\n * });\n * ```\n * @param formattedPrompt\n * @returns A partial OpenAI payload.\n */\n// TODO: make this a converter\nexport declare function convertPromptToOpenAI(formattedPrompt: BasePromptValue): {\n messages: OpenAI.Chat.ChatCompletionMessageParam[];\n};\n"],"mappings":";;;;;;;AAkCA;;;;AACoD;;;;;;;;;;;;;;;;;;;;;;;;;;iBAD5BE,qBAAAA,kBAAuCF;YACjDC,QAAAA,CAAOE,IAAAA,CAAKC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.cts","names":["OpenAI","OpenAIClient","ToolDefinition","BindToolsInput","DynamicTool","StructuredToolInterface","ToolCall","_convertToOpenAITool","ChatCompletionTool","OpenAIFunction","Chat","ChatCompletionCreateParams","Function","FunctionDef","ObjectProp","Omit","Prop","AnyOfProp","formatFunctionDefinitions","formatToOpenAIAssistantTool","OpenAIToolChoice","ChatCompletionToolChoiceOption","ResponsesToolChoice","Responses","ResponseCreateParams","NonNullable","ChatOpenAIToolType","ResponsesTool","formatToOpenAIToolChoice","isBuiltInTool","isBuiltInToolChoice","CustomToolCall","LangchainCustomTool","CustomTool","isCustomTool","isOpenAICustomTool","ChatCompletionCustomTool","parseCustomToolCall","Record","isCustomToolCall","convertCompletionsCustomTool","convertResponsesCustomTool"],"sources":["../../src/utils/tools.d.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nimport { DynamicTool, StructuredToolInterface } from \"@langchain/core/tools\";\nimport { ToolCall } from \"@langchain/core/messages/tool\";\n/**\n * Formats a tool in either OpenAI format, or LangChain structured tool format\n * into an OpenAI tool format. If the tool is already in OpenAI format, return without\n * any changes. If it is in LangChain structured tool format, convert it to OpenAI tool format\n * using OpenAI's `zodFunction` util, falling back to `convertToOpenAIFunction` if the parameters\n * returned from the `zodFunction` util are not defined.\n *\n * @param {BindToolsInput} tool The tool to convert to an OpenAI tool.\n * @param {Object} [fields] Additional fields to add to the OpenAI tool.\n * @returns {ToolDefinition} The inputted tool in OpenAI tool format.\n */\nexport declare function _convertToOpenAITool(tool: BindToolsInput, fields?: {\n /**\n * If `true`, model output is guaranteed to exactly match the JSON Schema\n * provided in the function definition.\n */\n strict?: boolean;\n}): OpenAIClient.ChatCompletionTool;\ntype OpenAIFunction = OpenAIClient.Chat.ChatCompletionCreateParams.Function;\n// Types representing the OpenAI function definitions. While the OpenAI client library\n// does have types for function definitions, the properties are just Record<string, unknown>,\n// which isn't very useful for type checking this formatting code.\nexport interface FunctionDef extends Omit<OpenAIFunction, \"parameters\"> {\n name: string;\n description?: string;\n parameters: ObjectProp;\n}\ninterface ObjectProp {\n type: \"object\";\n properties?: {\n [key: string]: Prop;\n };\n required?: string[];\n}\ninterface AnyOfProp {\n anyOf: Prop[];\n}\ntype Prop = {\n description?: string;\n} & (AnyOfProp | ObjectProp | {\n type: \"string\";\n enum?: string[];\n} | {\n type: \"number\" | \"integer\";\n minimum?: number;\n maximum?: number;\n enum?: number[];\n} | {\n type: \"boolean\";\n} | {\n type: \"null\";\n} | {\n type: \"array\";\n items?: Prop;\n});\n// When OpenAI use functions in the prompt, they format them as TypeScript definitions rather than OpenAPI JSON schemas.\n// This function converts the JSON schemas into TypeScript definitions.\nexport declare function formatFunctionDefinitions(functions: FunctionDef[]): string;\nexport declare function formatToOpenAIAssistantTool(tool: StructuredToolInterface): ToolDefinition;\nexport type OpenAIToolChoice = OpenAIClient.ChatCompletionToolChoiceOption | \"any\" | string;\nexport type ResponsesToolChoice = NonNullable<OpenAIClient.Responses.ResponseCreateParams[\"tool_choice\"]>;\nexport type ChatOpenAIToolType = BindToolsInput | OpenAIClient.Chat.ChatCompletionTool | ResponsesTool;\nexport type ResponsesTool = NonNullable<OpenAIClient.Responses.ResponseCreateParams[\"tools\"]>[number];\nexport declare function formatToOpenAIToolChoice(toolChoice?: OpenAIToolChoice): OpenAIClient.ChatCompletionToolChoiceOption | undefined;\nexport declare function isBuiltInTool(tool: ChatOpenAIToolType): tool is ResponsesTool;\nexport declare function isBuiltInToolChoice(tool_choice: OpenAIToolChoice | ResponsesToolChoice | undefined): tool_choice is ResponsesToolChoice;\nexport type CustomToolCall = ToolCall & {\n call_id: string;\n isCustomTool: true;\n};\ntype LangchainCustomTool = DynamicTool<string> & {\n metadata: {\n customTool: OpenAIClient.Responses.CustomTool;\n };\n};\nexport declare function isCustomTool(tool: unknown): tool is LangchainCustomTool;\nexport declare function isOpenAICustomTool(tool: ChatOpenAIToolType): tool is OpenAIClient.Chat.ChatCompletionCustomTool;\nexport declare function parseCustomToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>): CustomToolCall | undefined;\nexport declare function isCustomToolCall(toolCall: ToolCall): toolCall is CustomToolCall;\nexport declare function convertCompletionsCustomTool(tool: OpenAIClient.Chat.ChatCompletionCustomTool): OpenAIClient.Responses.CustomTool;\nexport declare function convertResponsesCustomTool(tool: OpenAIClient.Responses.CustomTool): OpenAIClient.Chat.ChatCompletionCustomTool;\nexport {};\n"],"mappings":";;;;;;KAgEYoB,gBAAAA,GAAmBnB,QAAAA,CAAaoB;KAChCC,mBAAAA,GAAsBG,YAAYxB,QAAAA,CAAasB,SAAAA,CAAUC;KACzDE,kBAAAA,GAAqBvB,iBAAiBF,QAAAA,CAAaS,IAAAA,CAAKF,qBAAqBmB;KAC7EA,aAAAA,GAAgBF,YAAYxB,QAAAA,CAAasB,SAAAA,CAAUC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","names":["OpenAI","OpenAIClient","ToolDefinition","BindToolsInput","DynamicTool","StructuredToolInterface","ToolCall","_convertToOpenAITool","ChatCompletionTool","OpenAIFunction","Chat","ChatCompletionCreateParams","Function","FunctionDef","ObjectProp","Omit","Prop","AnyOfProp","formatFunctionDefinitions","formatToOpenAIAssistantTool","OpenAIToolChoice","ChatCompletionToolChoiceOption","ResponsesToolChoice","Responses","ResponseCreateParams","NonNullable","ChatOpenAIToolType","ResponsesTool","formatToOpenAIToolChoice","isBuiltInTool","isBuiltInToolChoice","CustomToolCall","LangchainCustomTool","CustomTool","isCustomTool","isOpenAICustomTool","ChatCompletionCustomTool","parseCustomToolCall","Record","isCustomToolCall","convertCompletionsCustomTool","convertResponsesCustomTool"],"sources":["../../src/utils/tools.d.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nimport { DynamicTool, StructuredToolInterface } from \"@langchain/core/tools\";\nimport { ToolCall } from \"@langchain/core/messages/tool\";\n/**\n * Formats a tool in either OpenAI format, or LangChain structured tool format\n * into an OpenAI tool format. If the tool is already in OpenAI format, return without\n * any changes. If it is in LangChain structured tool format, convert it to OpenAI tool format\n * using OpenAI's `zodFunction` util, falling back to `convertToOpenAIFunction` if the parameters\n * returned from the `zodFunction` util are not defined.\n *\n * @param {BindToolsInput} tool The tool to convert to an OpenAI tool.\n * @param {Object} [fields] Additional fields to add to the OpenAI tool.\n * @returns {ToolDefinition} The inputted tool in OpenAI tool format.\n */\nexport declare function _convertToOpenAITool(tool: BindToolsInput, fields?: {\n /**\n * If `true`, model output is guaranteed to exactly match the JSON Schema\n * provided in the function definition.\n */\n strict?: boolean;\n}): OpenAIClient.ChatCompletionTool;\ntype OpenAIFunction = OpenAIClient.Chat.ChatCompletionCreateParams.Function;\n// Types representing the OpenAI function definitions. While the OpenAI client library\n// does have types for function definitions, the properties are just Record<string, unknown>,\n// which isn't very useful for type checking this formatting code.\nexport interface FunctionDef extends Omit<OpenAIFunction, \"parameters\"> {\n name: string;\n description?: string;\n parameters: ObjectProp;\n}\ninterface ObjectProp {\n type: \"object\";\n properties?: {\n [key: string]: Prop;\n };\n required?: string[];\n}\ninterface AnyOfProp {\n anyOf: Prop[];\n}\ntype Prop = {\n description?: string;\n} & (AnyOfProp | ObjectProp | {\n type: \"string\";\n enum?: string[];\n} | {\n type: \"number\" | \"integer\";\n minimum?: number;\n maximum?: number;\n enum?: number[];\n} | {\n type: \"boolean\";\n} | {\n type: \"null\";\n} | {\n type: \"array\";\n items?: Prop;\n});\n// When OpenAI use functions in the prompt, they format them as TypeScript definitions rather than OpenAPI JSON schemas.\n// This function converts the JSON schemas into TypeScript definitions.\nexport declare function formatFunctionDefinitions(functions: FunctionDef[]): string;\nexport declare function formatToOpenAIAssistantTool(tool: StructuredToolInterface): ToolDefinition;\nexport type OpenAIToolChoice = OpenAIClient.ChatCompletionToolChoiceOption | \"any\" | string;\nexport type ResponsesToolChoice = NonNullable<OpenAIClient.Responses.ResponseCreateParams[\"tool_choice\"]>;\nexport type ChatOpenAIToolType = BindToolsInput | OpenAIClient.Chat.ChatCompletionTool | ResponsesTool;\nexport type ResponsesTool = NonNullable<OpenAIClient.Responses.ResponseCreateParams[\"tools\"]>[number];\nexport declare function formatToOpenAIToolChoice(toolChoice?: OpenAIToolChoice): OpenAIClient.ChatCompletionToolChoiceOption | undefined;\nexport declare function isBuiltInTool(tool: ChatOpenAIToolType): tool is ResponsesTool;\nexport declare function isBuiltInToolChoice(tool_choice: OpenAIToolChoice | ResponsesToolChoice | undefined): tool_choice is ResponsesToolChoice;\nexport type CustomToolCall = ToolCall & {\n call_id: string;\n isCustomTool: true;\n};\ntype LangchainCustomTool = DynamicTool<string> & {\n metadata: {\n customTool: OpenAIClient.Responses.CustomTool;\n };\n};\nexport declare function isCustomTool(tool: unknown): tool is LangchainCustomTool;\nexport declare function isOpenAICustomTool(tool: ChatOpenAIToolType): tool is OpenAIClient.Chat.ChatCompletionCustomTool;\nexport declare function parseCustomToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>): CustomToolCall | undefined;\nexport declare function isCustomToolCall(toolCall: ToolCall): toolCall is CustomToolCall;\nexport declare function convertCompletionsCustomTool(tool: OpenAIClient.Chat.ChatCompletionCustomTool): OpenAIClient.Responses.CustomTool;\nexport declare function convertResponsesCustomTool(tool: OpenAIClient.Responses.CustomTool): OpenAIClient.Chat.ChatCompletionCustomTool;\nexport {};\n"],"mappings":";;;;;;;KAgEYoB,gBAAAA,GAAmBnB,QAAAA,CAAaoB;KAChCC,mBAAAA,GAAsBG,YAAYxB,QAAAA,CAAasB,SAAAA,CAAUC;KACzDE,kBAAAA,GAAqBvB,iBAAiBF,QAAAA,CAAaS,IAAAA,CAAKF,qBAAqBmB;KAC7EA,aAAAA,GAAgBF,YAAYxB,QAAAA,CAAasB,SAAAA,CAAUC"}
|