@langchain/openai 1.0.0-alpha.3 → 1.1.0

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.
Files changed (139) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/azure/chat_models/common.cjs +130 -0
  3. package/dist/azure/chat_models/common.cjs.map +1 -0
  4. package/dist/azure/chat_models/common.d.cts +16 -0
  5. package/dist/azure/chat_models/common.d.cts.map +1 -0
  6. package/dist/azure/chat_models/common.d.ts +16 -0
  7. package/dist/azure/chat_models/common.d.ts.map +1 -0
  8. package/dist/azure/chat_models/common.js +124 -0
  9. package/dist/azure/chat_models/common.js.map +1 -0
  10. package/dist/azure/chat_models/completions.cjs +50 -0
  11. package/dist/azure/chat_models/completions.cjs.map +1 -0
  12. package/dist/azure/chat_models/completions.d.cts +29 -0
  13. package/dist/azure/chat_models/completions.d.cts.map +1 -0
  14. package/dist/azure/chat_models/completions.d.ts +29 -0
  15. package/dist/azure/chat_models/completions.d.ts.map +1 -0
  16. package/dist/azure/chat_models/completions.js +50 -0
  17. package/dist/azure/chat_models/completions.js.map +1 -0
  18. package/dist/azure/{chat_models.cjs → chat_models/index.cjs} +14 -214
  19. package/dist/azure/chat_models/index.cjs.map +1 -0
  20. package/dist/azure/{chat_models.d.ts → chat_models/index.d.cts} +6 -11
  21. package/dist/azure/chat_models/index.d.cts.map +1 -0
  22. package/dist/azure/{chat_models.d.cts → chat_models/index.d.ts} +6 -11
  23. package/dist/azure/chat_models/index.d.ts.map +1 -0
  24. package/dist/azure/{chat_models.js → chat_models/index.js} +6 -205
  25. package/dist/azure/chat_models/index.js.map +1 -0
  26. package/dist/azure/chat_models/responses.cjs +50 -0
  27. package/dist/azure/chat_models/responses.cjs.map +1 -0
  28. package/dist/azure/chat_models/responses.d.cts +29 -0
  29. package/dist/azure/chat_models/responses.d.cts.map +1 -0
  30. package/dist/azure/chat_models/responses.d.ts +29 -0
  31. package/dist/azure/chat_models/responses.d.ts.map +1 -0
  32. package/dist/azure/chat_models/responses.js +50 -0
  33. package/dist/azure/chat_models/responses.js.map +1 -0
  34. package/dist/chat_models/base.cjs +533 -0
  35. package/dist/chat_models/base.cjs.map +1 -0
  36. package/dist/chat_models/base.d.cts +272 -0
  37. package/dist/chat_models/base.d.cts.map +1 -0
  38. package/dist/chat_models/base.d.ts +272 -0
  39. package/dist/chat_models/base.d.ts.map +1 -0
  40. package/dist/chat_models/base.js +532 -0
  41. package/dist/chat_models/base.js.map +1 -0
  42. package/dist/chat_models/completions.cjs +258 -0
  43. package/dist/chat_models/completions.cjs.map +1 -0
  44. package/dist/chat_models/completions.d.cts +44 -0
  45. package/dist/chat_models/completions.d.cts.map +1 -0
  46. package/dist/chat_models/completions.d.ts +44 -0
  47. package/dist/chat_models/completions.d.ts.map +1 -0
  48. package/dist/chat_models/completions.js +257 -0
  49. package/dist/chat_models/completions.js.map +1 -0
  50. package/dist/chat_models/index.cjs +608 -0
  51. package/dist/chat_models/index.cjs.map +1 -0
  52. package/dist/chat_models/index.d.cts +593 -0
  53. package/dist/chat_models/index.d.cts.map +1 -0
  54. package/dist/chat_models/index.d.ts +593 -0
  55. package/dist/chat_models/index.d.ts.map +1 -0
  56. package/dist/chat_models/index.js +608 -0
  57. package/dist/chat_models/index.js.map +1 -0
  58. package/dist/chat_models/responses.cjs +189 -0
  59. package/dist/chat_models/responses.cjs.map +1 -0
  60. package/dist/chat_models/responses.d.cts +62 -0
  61. package/dist/chat_models/responses.d.cts.map +1 -0
  62. package/dist/chat_models/responses.d.ts +62 -0
  63. package/dist/chat_models/responses.d.ts.map +1 -0
  64. package/dist/chat_models/responses.js +188 -0
  65. package/dist/chat_models/responses.js.map +1 -0
  66. package/dist/converters/completions.cjs +603 -0
  67. package/dist/converters/completions.cjs.map +1 -0
  68. package/dist/converters/completions.js +599 -0
  69. package/dist/converters/completions.js.map +1 -0
  70. package/dist/converters/responses.cjs +892 -0
  71. package/dist/converters/responses.cjs.map +1 -0
  72. package/dist/converters/responses.js +889 -0
  73. package/dist/converters/responses.js.map +1 -0
  74. package/dist/index.cjs +14 -9
  75. package/dist/index.d.cts +9 -4
  76. package/dist/index.d.ts +9 -4
  77. package/dist/index.js +8 -4
  78. package/dist/langchain-core/dist/callbacks/base.d.ts +1 -0
  79. package/dist/langchain-core/dist/callbacks/manager.d.ts +2 -0
  80. package/dist/langchain-core/dist/language_models/base.d.ts +5 -0
  81. package/dist/langchain-core/dist/language_models/chat_models.d.cts +13 -0
  82. package/dist/langchain-core/dist/language_models/chat_models.d.cts.map +1 -0
  83. package/dist/langchain-core/dist/language_models/chat_models.d.ts +20 -0
  84. package/dist/langchain-core/dist/language_models/chat_models.d.ts.map +1 -0
  85. package/dist/langchain-core/dist/runnables/base.d.ts +7 -0
  86. package/dist/langchain-core/dist/runnables/graph.d.ts +1 -0
  87. package/dist/langchain-core/dist/runnables/types.d.ts +2 -0
  88. package/dist/langchain-core/dist/tools/types.d.ts +5 -0
  89. package/dist/langchain-core/dist/tracers/base.d.ts +2 -0
  90. package/dist/langchain-core/dist/tracers/event_stream.d.ts +1 -0
  91. package/dist/langchain-core/dist/tracers/log_stream.d.ts +3 -0
  92. package/dist/langchain-core/dist/utils/types/index.d.ts +1 -0
  93. package/dist/langchain-core/dist/utils/types/zod.d.ts +1 -0
  94. package/dist/llms.cjs +1 -1
  95. package/dist/llms.d.cts +1 -1
  96. package/dist/llms.js +1 -1
  97. package/dist/utils/errors.cjs +1 -1
  98. package/dist/utils/errors.cjs.map +1 -1
  99. package/dist/utils/errors.js +1 -1
  100. package/dist/utils/errors.js.map +1 -1
  101. package/dist/utils/misc.js +2 -2
  102. package/dist/utils/misc.js.map +1 -1
  103. package/dist/utils/output.cjs +0 -12
  104. package/dist/utils/output.cjs.map +1 -1
  105. package/dist/utils/output.js +1 -12
  106. package/dist/utils/output.js.map +1 -1
  107. package/dist/utils/prompts.cjs +2 -2
  108. package/dist/utils/prompts.cjs.map +1 -1
  109. package/dist/utils/prompts.d.cts +1 -0
  110. package/dist/utils/prompts.d.cts.map +1 -1
  111. package/dist/utils/prompts.d.ts +1 -0
  112. package/dist/utils/prompts.d.ts.map +1 -1
  113. package/dist/utils/prompts.js +2 -2
  114. package/dist/utils/prompts.js.map +1 -1
  115. package/package.json +10 -7
  116. package/dist/azure/chat_models.cjs.map +0 -1
  117. package/dist/azure/chat_models.d.cts.map +0 -1
  118. package/dist/azure/chat_models.d.ts.map +0 -1
  119. package/dist/azure/chat_models.js.map +0 -1
  120. package/dist/chat_models.cjs +0 -1967
  121. package/dist/chat_models.cjs.map +0 -1
  122. package/dist/chat_models.d.cts +0 -933
  123. package/dist/chat_models.d.cts.map +0 -1
  124. package/dist/chat_models.d.ts +0 -933
  125. package/dist/chat_models.d.ts.map +0 -1
  126. package/dist/chat_models.js +0 -1963
  127. package/dist/chat_models.js.map +0 -1
  128. package/dist/utils/message_inputs.cjs +0 -139
  129. package/dist/utils/message_inputs.cjs.map +0 -1
  130. package/dist/utils/message_inputs.d.cts +0 -9
  131. package/dist/utils/message_inputs.d.cts.map +0 -1
  132. package/dist/utils/message_inputs.d.ts +0 -9
  133. package/dist/utils/message_inputs.d.ts.map +0 -1
  134. package/dist/utils/message_inputs.js +0 -137
  135. package/dist/utils/message_inputs.js.map +0 -1
  136. package/dist/utils/standard.cjs +0 -315
  137. package/dist/utils/standard.cjs.map +0 -1
  138. package/dist/utils/standard.js +0 -313
  139. package/dist/utils/standard.js.map +0 -1
@@ -1,933 +0,0 @@
1
- import { IterableReadableStream } from "./langchain-core/dist/utils/stream.cjs";
2
- import { ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, OpenAICallOptions, OpenAIChatInput, OpenAICoreRequestOptions, OpenAIVerbosityParam, ResponseFormatConfiguration } from "./types.cjs";
3
- import { ChatOpenAIToolType, OpenAIToolChoice, ResponsesTool, ResponsesToolChoice } from "./utils/tools.cjs";
4
- import { ClientOptions, OpenAI as OpenAI$1 } from "openai";
5
- import * as _langchain_core_messages0 from "@langchain/core/messages";
6
- import { AIMessageChunk, BaseMessage, ChatMessageChunk, FunctionMessageChunk, HumanMessageChunk, SystemMessageChunk, ToolMessageChunk } from "@langchain/core/messages";
7
- import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
8
- import { ChatGeneration, ChatGenerationChunk, ChatResult } from "@langchain/core/outputs";
9
- import { BaseChatModel, BaseChatModelParams, LangSmithParams } from "@langchain/core/language_models/chat_models";
10
- import { BaseFunctionCallOptions, BaseLanguageModelInput, StructuredOutputMethodOptions } from "@langchain/core/language_models/base";
11
- import { Runnable } from "@langchain/core/runnables";
12
- import { InteropZodType } from "@langchain/core/utils/types";
13
-
14
- //#region src/chat_models.d.ts
15
- interface OpenAILLMOutput {
16
- tokenUsage: {
17
- completionTokens?: number;
18
- promptTokens?: number;
19
- totalTokens?: number;
20
- };
21
- }
22
- interface BaseChatOpenAICallOptions extends OpenAICallOptions, BaseFunctionCallOptions {
23
- /**
24
- * A list of tools that the model may use to generate responses.
25
- * Each tool can be a function, a built-in tool, or a custom tool definition.
26
- * If not provided, the model will not use any tools.
27
- */
28
- tools?: ChatOpenAIToolType[];
29
- /**
30
- * Specifies which tool the model should use to respond.
31
- * Can be an {@link OpenAIToolChoice} or a {@link ResponsesToolChoice}.
32
- * If not set, the model will decide which tool to use automatically.
33
- */
34
- // TODO: break OpenAIToolChoice and ResponsesToolChoice into options sub classes
35
- tool_choice?: OpenAIToolChoice | ResponsesToolChoice;
36
- /**
37
- * Adds a prompt index to prompts passed to the model to track
38
- * what prompt is being used for a given generation.
39
- */
40
- promptIndex?: number;
41
- /**
42
- * An object specifying the format that the model must output.
43
- */
44
- response_format?: ChatOpenAIResponseFormat;
45
- /**
46
- * When provided, the completions API will make a best effort to sample
47
- * deterministically, such that repeated requests with the same `seed`
48
- * and parameters should return the same result.
49
- */
50
- seed?: number;
51
- /**
52
- * Additional options to pass to streamed completions.
53
- * If provided, this takes precedence over "streamUsage" set at
54
- * initialization time.
55
- */
56
- stream_options?: OpenAI$1.Chat.ChatCompletionStreamOptions;
57
- /**
58
- * The model may choose to call multiple functions in a single turn. You can
59
- * set parallel_tool_calls to false which ensures only one tool is called at most.
60
- * [Learn more](https://platform.openai.com/docs/guides/function-calling#parallel-function-calling)
61
- */
62
- parallel_tool_calls?: boolean;
63
- /**
64
- * If `true`, model output is guaranteed to exactly match the JSON Schema
65
- * provided in the tool definition. If `true`, the input schema will also be
66
- * validated according to
67
- * https://platform.openai.com/docs/guides/structured-outputs/supported-schemas.
68
- *
69
- * If `false`, input schema will not be validated and model output will not
70
- * be validated.
71
- *
72
- * If `undefined`, `strict` argument will not be passed to the model.
73
- */
74
- strict?: boolean;
75
- /**
76
- * Output types that you would like the model to generate for this request. Most
77
- * models are capable of generating text, which is the default:
78
- *
79
- * `["text"]`
80
- *
81
- * The `gpt-4o-audio-preview` model can also be used to
82
- * [generate audio](https://platform.openai.com/docs/guides/audio). To request that
83
- * this model generate both text and audio responses, you can use:
84
- *
85
- * `["text", "audio"]`
86
- */
87
- modalities?: Array<OpenAI$1.Chat.ChatCompletionModality>;
88
- /**
89
- * Parameters for audio output. Required when audio output is requested with
90
- * `modalities: ["audio"]`.
91
- * [Learn more](https://platform.openai.com/docs/guides/audio).
92
- */
93
- audio?: OpenAI$1.Chat.ChatCompletionAudioParam;
94
- /**
95
- * Static predicted output content, such as the content of a text file that is being regenerated.
96
- * [Learn more](https://platform.openai.com/docs/guides/latency-optimization#use-predicted-outputs).
97
- */
98
- prediction?: OpenAI$1.ChatCompletionPredictionContent;
99
- /**
100
- * Options for reasoning models.
101
- *
102
- * Note that some options, like reasoning summaries, are only available when using the responses
103
- * API. If these options are set, the responses API will be used to fulfill the request.
104
- *
105
- * These options will be ignored when not using a reasoning model.
106
- */
107
- reasoning?: OpenAI$1.Reasoning;
108
- /**
109
- * Service tier to use for this request. Can be "auto", "default", or "flex"
110
- * Specifies the service tier for prioritization and latency optimization.
111
- */
112
- service_tier?: OpenAI$1.Chat.ChatCompletionCreateParams["service_tier"];
113
- /**
114
- * Used by OpenAI to cache responses for similar requests to optimize your cache
115
- * hit rates. Replaces the `user` field.
116
- * [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
117
- */
118
- promptCacheKey?: string;
119
- /**
120
- * The verbosity of the model's response.
121
- */
122
- verbosity?: OpenAIVerbosityParam;
123
- }
124
- interface BaseChatOpenAIFields extends Partial<OpenAIChatInput>, BaseChatModelParams {
125
- /**
126
- * Optional configuration options for the OpenAI client.
127
- */
128
- configuration?: ClientOptions;
129
- }
130
- /** @internal */
131
- declare abstract class BaseChatOpenAI<CallOptions extends BaseChatOpenAICallOptions> extends BaseChatModel<CallOptions, AIMessageChunk> implements Partial<OpenAIChatInput> {
132
- temperature?: number;
133
- topP?: number;
134
- frequencyPenalty?: number;
135
- presencePenalty?: number;
136
- n?: number;
137
- logitBias?: Record<string, number>;
138
- model: string;
139
- modelKwargs?: OpenAIChatInput["modelKwargs"];
140
- stop?: string[];
141
- stopSequences?: string[];
142
- user?: string;
143
- timeout?: number;
144
- streaming: boolean;
145
- streamUsage: boolean;
146
- maxTokens?: number;
147
- logprobs?: boolean;
148
- topLogprobs?: number;
149
- apiKey?: string;
150
- organization?: string;
151
- __includeRawResponse?: boolean;
152
- /** @internal */
153
- client: OpenAI$1;
154
- /** @internal */
155
- clientConfig: ClientOptions;
156
- /**
157
- * Whether the model supports the `strict` argument when passing in tools.
158
- * If `undefined` the `strict` argument will not be passed to OpenAI.
159
- */
160
- supportsStrictToolCalling?: boolean;
161
- audio?: OpenAI$1.Chat.ChatCompletionAudioParam;
162
- modalities?: Array<OpenAI$1.Chat.ChatCompletionModality>;
163
- reasoning?: OpenAI$1.Reasoning;
164
- /**
165
- * Must be set to `true` in tenancies with Zero Data Retention. Setting to `true` will disable
166
- * output storage in the Responses API, but this DOES NOT enable Zero Data Retention in your
167
- * OpenAI organization or project. This must be configured directly with OpenAI.
168
- *
169
- * See:
170
- * https://platform.openai.com/docs/guides/your-data
171
- * https://platform.openai.com/docs/api-reference/responses/create#responses-create-store
172
- *
173
- * @default false
174
- */
175
- zdrEnabled?: boolean | undefined;
176
- /**
177
- * Service tier to use for this request. Can be "auto", "default", or "flex" or "priority".
178
- * Specifies the service tier for prioritization and latency optimization.
179
- */
180
- service_tier?: OpenAI$1.Chat.ChatCompletionCreateParams["service_tier"];
181
- /**
182
- * Used by OpenAI to cache responses for similar requests to optimize your cache
183
- * hit rates.
184
- * [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
185
- */
186
- promptCacheKey: string;
187
- /**
188
- * The verbosity of the model's response.
189
- */
190
- verbosity?: OpenAIVerbosityParam;
191
- protected defaultOptions: CallOptions;
192
- _llmType(): string;
193
- static lc_name(): string;
194
- get callKeys(): string[];
195
- lc_serializable: boolean;
196
- get lc_secrets(): {
197
- [key: string]: string;
198
- } | undefined;
199
- get lc_aliases(): Record<string, string>;
200
- get lc_serializable_keys(): string[];
201
- getLsParams(options: this["ParsedCallOptions"]): LangSmithParams;
202
- /** @ignore */
203
- _identifyingParams(): Omit<OpenAI$1.Chat.ChatCompletionCreateParams, "messages"> & {
204
- model_name: string;
205
- } & ClientOptions;
206
- /**
207
- * Get the identifying parameters for the model
208
- */
209
- identifyingParams(): Omit<OpenAI$1.ChatCompletionCreateParams, "messages"> & {
210
- model_name: string;
211
- } & ClientOptions;
212
- constructor(fields?: BaseChatOpenAIFields);
213
- /**
214
- * Returns backwards compatible reasoning parameters from constructor params and call options
215
- * @internal
216
- */
217
- protected _getReasoningParams(options?: this["ParsedCallOptions"]): OpenAI$1.Reasoning | undefined;
218
- /**
219
- * Returns an openai compatible response format from a set of options
220
- * @internal
221
- */
222
- protected _getResponseFormat(resFormat?: CallOptions["response_format"]): ResponseFormatConfiguration | undefined;
223
- protected _combineCallOptions(additionalOptions?: this["ParsedCallOptions"]): this["ParsedCallOptions"];
224
- /** @internal */
225
- _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;
226
- // TODO: move to completions class
227
- protected _convertChatOpenAIToolToCompletionsTool(tool: ChatOpenAIToolType, fields?: {
228
- strict?: boolean;
229
- }): OpenAI$1.ChatCompletionTool;
230
- bindTools(tools: ChatOpenAIToolType[], kwargs?: Partial<CallOptions>): Runnable<BaseLanguageModelInput, AIMessageChunk, CallOptions>;
231
- stream(input: BaseLanguageModelInput, options?: CallOptions): Promise<IterableReadableStream<AIMessageChunk<_langchain_core_messages0.MessageStructure>>>;
232
- invoke(input: BaseLanguageModelInput, options?: CallOptions): Promise<AIMessageChunk<_langchain_core_messages0.MessageStructure>>;
233
- /** @ignore */
234
- _combineLLMOutput(...llmOutputs: OpenAILLMOutput[]): OpenAILLMOutput;
235
- getNumTokensFromMessages(messages: BaseMessage[]): Promise<{
236
- totalCount: number;
237
- countPerMessage: number[];
238
- }>;
239
- /** @internal */
240
- protected _getNumTokensFromGenerations(generations: ChatGeneration[]): Promise<number>;
241
- /** @internal */
242
- protected _getEstimatedTokenCountFromPrompt(messages: BaseMessage[], functions?: OpenAI$1.Chat.ChatCompletionCreateParams.Function[], function_call?: "none" | "auto" | OpenAI$1.Chat.ChatCompletionFunctionCallOption): Promise<number>;
243
- /** @internal */
244
- protected _getStructuredOutputMethod(config: StructuredOutputMethodOptions<boolean>): string | undefined;
245
- withStructuredOutput<
246
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
247
- RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
248
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
249
- | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;
250
- withStructuredOutput<
251
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
252
- RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
253
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
254
- | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {
255
- raw: BaseMessage;
256
- parsed: RunOutput;
257
- }>;
258
- withStructuredOutput<
259
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
260
- RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
261
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
262
- | Record<string, any>, config?: StructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {
263
- raw: BaseMessage;
264
- parsed: RunOutput;
265
- }>;
266
- }
267
- interface ChatOpenAIResponsesCallOptions extends BaseChatOpenAICallOptions {
268
- /**
269
- * Configuration options for a text response from the model. Can be plain text or
270
- * structured JSON data.
271
- */
272
- text?: OpenAI$1.Responses.ResponseCreateParams["text"];
273
- /**
274
- * The truncation strategy to use for the model response.
275
- */
276
- truncation?: OpenAI$1.Responses.ResponseCreateParams["truncation"];
277
- /**
278
- * Specify additional output data to include in the model response.
279
- */
280
- include?: OpenAI$1.Responses.ResponseCreateParams["include"];
281
- /**
282
- * The unique ID of the previous response to the model. Use this to create multi-turn
283
- * conversations.
284
- */
285
- previous_response_id?: OpenAI$1.Responses.ResponseCreateParams["previous_response_id"];
286
- /**
287
- * The verbosity of the model's response.
288
- */
289
- verbosity?: OpenAIVerbosityParam;
290
- }
291
- type ChatResponsesInvocationParams = Omit<OpenAI$1.Responses.ResponseCreateParams, "input">;
292
- type ExcludeController<T> = T extends {
293
- controller: unknown;
294
- } ? never : T;
295
- type ResponsesCreate = OpenAI$1.Responses["create"];
296
- type ResponsesParse = OpenAI$1.Responses["parse"];
297
- type ResponsesCreateInvoke = ExcludeController<Awaited<ReturnType<ResponsesCreate>>>;
298
- type ResponsesParseInvoke = ExcludeController<Awaited<ReturnType<ResponsesParse>>>;
299
- /**
300
- * OpenAI Responses API implementation.
301
- *
302
- * Will be exported in a later version of @langchain/openai.
303
- *
304
- * @internal
305
- */
306
- declare class ChatOpenAIResponses<CallOptions extends ChatOpenAIResponsesCallOptions = ChatOpenAIResponsesCallOptions> extends BaseChatOpenAI<CallOptions> {
307
- invocationParams(options?: this["ParsedCallOptions"]): ChatResponsesInvocationParams;
308
- _generate(messages: BaseMessage[], options: this["ParsedCallOptions"]): Promise<ChatResult>;
309
- _streamResponseChunks(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;
310
- /**
311
- * Calls the Responses API with retry logic in case of failures.
312
- * @param request The request to send to the OpenAI API.
313
- * @param options Optional configuration for the API call.
314
- * @returns The response from the OpenAI API.
315
- */
316
- completionWithRetry(request: OpenAI$1.Responses.ResponseCreateParamsStreaming, requestOptions?: OpenAI$1.RequestOptions): Promise<AsyncIterable<OpenAI$1.Responses.ResponseStreamEvent>>;
317
- completionWithRetry(request: OpenAI$1.Responses.ResponseCreateParamsNonStreaming, requestOptions?: OpenAI$1.RequestOptions): Promise<OpenAI$1.Responses.Response>;
318
- /** @internal */
319
- protected _convertResponsesMessageToBaseMessage(response: ResponsesCreateInvoke | ResponsesParseInvoke): BaseMessage;
320
- /** @internal */
321
- protected _convertResponsesDeltaToBaseMessageChunk(chunk: OpenAI$1.Responses.ResponseStreamEvent): ChatGenerationChunk | null;
322
- /** @internal */
323
- protected _convertMessagesToResponsesParams(messages: BaseMessage[]): any[];
324
- /** @internal */
325
- protected _convertReasoningSummary(reasoning: ChatOpenAIReasoningSummary): OpenAI$1.Responses.ResponseReasoningItem;
326
- /** @internal */
327
- protected _reduceChatOpenAITools(tools: ChatOpenAIToolType[], fields: {
328
- stream?: boolean;
329
- strict?: boolean;
330
- }): ResponsesTool[];
331
- }
332
- interface ChatOpenAICompletionsCallOptions extends BaseChatOpenAICallOptions {}
333
- type ChatCompletionsInvocationParams = Omit<OpenAI$1.Chat.Completions.ChatCompletionCreateParams, "messages">;
334
- /**
335
- * OpenAI Completions API implementation.
336
- * @internal
337
- */
338
- declare class ChatOpenAICompletions<CallOptions extends ChatOpenAICompletionsCallOptions = ChatOpenAICompletionsCallOptions> extends BaseChatOpenAI<CallOptions> {
339
- /** @internal */
340
- invocationParams(options?: this["ParsedCallOptions"], extra?: {
341
- streaming?: boolean;
342
- }): ChatCompletionsInvocationParams;
343
- _generate(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;
344
- _streamResponseChunks(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;
345
- completionWithRetry(request: OpenAI$1.Chat.ChatCompletionCreateParamsStreaming, requestOptions?: OpenAI$1.RequestOptions): Promise<AsyncIterable<OpenAI$1.Chat.Completions.ChatCompletionChunk>>;
346
- completionWithRetry(request: OpenAI$1.Chat.ChatCompletionCreateParamsNonStreaming, requestOptions?: OpenAI$1.RequestOptions): Promise<OpenAI$1.Chat.Completions.ChatCompletion>;
347
- /** @internal */
348
- protected _convertCompletionsMessageToBaseMessage(message: OpenAI$1.Chat.Completions.ChatCompletionMessage, rawResponse: OpenAI$1.Chat.Completions.ChatCompletion): BaseMessage;
349
- /** @internal */
350
- protected _convertCompletionsDeltaToBaseMessageChunk(
351
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
352
- delta: Record<string, any>, rawResponse: OpenAI$1.Chat.Completions.ChatCompletionChunk, defaultRole?: OpenAI$1.Chat.ChatCompletionRole): AIMessageChunk<_langchain_core_messages0.MessageStructure> | ChatMessageChunk<_langchain_core_messages0.MessageStructure> | FunctionMessageChunk<_langchain_core_messages0.MessageStructure> | HumanMessageChunk<_langchain_core_messages0.MessageStructure> | SystemMessageChunk<_langchain_core_messages0.MessageStructure> | ToolMessageChunk<_langchain_core_messages0.MessageStructure>;
353
- }
354
- type ChatOpenAICallOptions = ChatOpenAICompletionsCallOptions & ChatOpenAIResponsesCallOptions;
355
- interface ChatOpenAIFields extends BaseChatOpenAIFields {
356
- /**
357
- * Whether to use the responses API for all requests. If `false` the responses API will be used
358
- * only when required in order to fulfill the request.
359
- */
360
- useResponsesApi?: boolean;
361
- /**
362
- * The completions chat instance
363
- * @internal
364
- */
365
- completions?: ChatOpenAICompletions;
366
- /**
367
- * The responses chat instance
368
- * @internal
369
- */
370
- responses?: ChatOpenAIResponses;
371
- }
372
- /**
373
- * OpenAI chat model integration.
374
- *
375
- * To use with Azure, import the `AzureChatOpenAI` class.
376
- *
377
- * Setup:
378
- * Install `@langchain/openai` and set an environment variable named `OPENAI_API_KEY`.
379
- *
380
- * ```bash
381
- * npm install @langchain/openai
382
- * export OPENAI_API_KEY="your-api-key"
383
- * ```
384
- *
385
- * ## [Constructor args](https://api.js.langchain.com/classes/langchain_openai.ChatOpenAI.html#constructor)
386
- *
387
- * ## [Runtime args](https://api.js.langchain.com/interfaces/langchain_openai.ChatOpenAICallOptions.html)
388
- *
389
- * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
390
- * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:
391
- *
392
- * ```typescript
393
- * // When calling `.withConfig`, call options should be passed via the first argument
394
- * const llmWithArgsBound = llm.withConfig({
395
- * stop: ["\n"],
396
- * tools: [...],
397
- * });
398
- *
399
- * // When calling `.bindTools`, call options should be passed via the second argument
400
- * const llmWithTools = llm.bindTools(
401
- * [...],
402
- * {
403
- * tool_choice: "auto",
404
- * }
405
- * );
406
- * ```
407
- *
408
- * ## Examples
409
- *
410
- * <details open>
411
- * <summary><strong>Instantiate</strong></summary>
412
- *
413
- * ```typescript
414
- * import { ChatOpenAI } from '@langchain/openai';
415
- *
416
- * const llm = new ChatOpenAI({
417
- * model: "gpt-4o-mini",
418
- * temperature: 0,
419
- * maxTokens: undefined,
420
- * timeout: undefined,
421
- * maxRetries: 2,
422
- * // apiKey: "...",
423
- * // configuration: {
424
- * // baseURL: "...",
425
- * // }
426
- * // organization: "...",
427
- * // other params...
428
- * });
429
- * ```
430
- * </details>
431
- *
432
- * <br />
433
- *
434
- * <details>
435
- * <summary><strong>Invoking</strong></summary>
436
- *
437
- * ```typescript
438
- * const input = `Translate "I love programming" into French.`;
439
- *
440
- * // Models also accept a list of chat messages or a formatted prompt
441
- * const result = await llm.invoke(input);
442
- * console.log(result);
443
- * ```
444
- *
445
- * ```txt
446
- * AIMessage {
447
- * "id": "chatcmpl-9u4Mpu44CbPjwYFkTbeoZgvzB00Tz",
448
- * "content": "J'adore la programmation.",
449
- * "response_metadata": {
450
- * "tokenUsage": {
451
- * "completionTokens": 5,
452
- * "promptTokens": 28,
453
- * "totalTokens": 33
454
- * },
455
- * "finish_reason": "stop",
456
- * "system_fingerprint": "fp_3aa7262c27"
457
- * },
458
- * "usage_metadata": {
459
- * "input_tokens": 28,
460
- * "output_tokens": 5,
461
- * "total_tokens": 33
462
- * }
463
- * }
464
- * ```
465
- * </details>
466
- *
467
- * <br />
468
- *
469
- * <details>
470
- * <summary><strong>Streaming Chunks</strong></summary>
471
- *
472
- * ```typescript
473
- * for await (const chunk of await llm.stream(input)) {
474
- * console.log(chunk);
475
- * }
476
- * ```
477
- *
478
- * ```txt
479
- * AIMessageChunk {
480
- * "id": "chatcmpl-9u4NWB7yUeHCKdLr6jP3HpaOYHTqs",
481
- * "content": ""
482
- * }
483
- * AIMessageChunk {
484
- * "content": "J"
485
- * }
486
- * AIMessageChunk {
487
- * "content": "'adore"
488
- * }
489
- * AIMessageChunk {
490
- * "content": " la"
491
- * }
492
- * AIMessageChunk {
493
- * "content": " programmation",,
494
- * }
495
- * AIMessageChunk {
496
- * "content": ".",,
497
- * }
498
- * AIMessageChunk {
499
- * "content": "",
500
- * "response_metadata": {
501
- * "finish_reason": "stop",
502
- * "system_fingerprint": "fp_c9aa9c0491"
503
- * },
504
- * }
505
- * AIMessageChunk {
506
- * "content": "",
507
- * "usage_metadata": {
508
- * "input_tokens": 28,
509
- * "output_tokens": 5,
510
- * "total_tokens": 33
511
- * }
512
- * }
513
- * ```
514
- * </details>
515
- *
516
- * <br />
517
- *
518
- * <details>
519
- * <summary><strong>Aggregate Streamed Chunks</strong></summary>
520
- *
521
- * ```typescript
522
- * import { AIMessageChunk } from '@langchain/core/messages';
523
- * import { concat } from '@langchain/core/utils/stream';
524
- *
525
- * const stream = await llm.stream(input);
526
- * let full: AIMessageChunk | undefined;
527
- * for await (const chunk of stream) {
528
- * full = !full ? chunk : concat(full, chunk);
529
- * }
530
- * console.log(full);
531
- * ```
532
- *
533
- * ```txt
534
- * AIMessageChunk {
535
- * "id": "chatcmpl-9u4PnX6Fy7OmK46DASy0bH6cxn5Xu",
536
- * "content": "J'adore la programmation.",
537
- * "response_metadata": {
538
- * "prompt": 0,
539
- * "completion": 0,
540
- * "finish_reason": "stop",
541
- * },
542
- * "usage_metadata": {
543
- * "input_tokens": 28,
544
- * "output_tokens": 5,
545
- * "total_tokens": 33
546
- * }
547
- * }
548
- * ```
549
- * </details>
550
- *
551
- * <br />
552
- *
553
- * <details>
554
- * <summary><strong>Bind tools</strong></summary>
555
- *
556
- * ```typescript
557
- * import { z } from 'zod';
558
- *
559
- * const GetWeather = {
560
- * name: "GetWeather",
561
- * description: "Get the current weather in a given location",
562
- * schema: z.object({
563
- * location: z.string().describe("The city and state, e.g. San Francisco, CA")
564
- * }),
565
- * }
566
- *
567
- * const GetPopulation = {
568
- * name: "GetPopulation",
569
- * description: "Get the current population in a given location",
570
- * schema: z.object({
571
- * location: z.string().describe("The city and state, e.g. San Francisco, CA")
572
- * }),
573
- * }
574
- *
575
- * const llmWithTools = llm.bindTools(
576
- * [GetWeather, GetPopulation],
577
- * {
578
- * // strict: true // enforce tool args schema is respected
579
- * }
580
- * );
581
- * const aiMsg = await llmWithTools.invoke(
582
- * "Which city is hotter today and which is bigger: LA or NY?"
583
- * );
584
- * console.log(aiMsg.tool_calls);
585
- * ```
586
- *
587
- * ```txt
588
- * [
589
- * {
590
- * name: 'GetWeather',
591
- * args: { location: 'Los Angeles, CA' },
592
- * type: 'tool_call',
593
- * id: 'call_uPU4FiFzoKAtMxfmPnfQL6UK'
594
- * },
595
- * {
596
- * name: 'GetWeather',
597
- * args: { location: 'New York, NY' },
598
- * type: 'tool_call',
599
- * id: 'call_UNkEwuQsHrGYqgDQuH9nPAtX'
600
- * },
601
- * {
602
- * name: 'GetPopulation',
603
- * args: { location: 'Los Angeles, CA' },
604
- * type: 'tool_call',
605
- * id: 'call_kL3OXxaq9OjIKqRTpvjaCH14'
606
- * },
607
- * {
608
- * name: 'GetPopulation',
609
- * args: { location: 'New York, NY' },
610
- * type: 'tool_call',
611
- * id: 'call_s9KQB1UWj45LLGaEnjz0179q'
612
- * }
613
- * ]
614
- * ```
615
- * </details>
616
- *
617
- * <br />
618
- *
619
- * <details>
620
- * <summary><strong>Structured Output</strong></summary>
621
- *
622
- * ```typescript
623
- * import { z } from 'zod';
624
- *
625
- * const Joke = z.object({
626
- * setup: z.string().describe("The setup of the joke"),
627
- * punchline: z.string().describe("The punchline to the joke"),
628
- * rating: z.number().nullable().describe("How funny the joke is, from 1 to 10")
629
- * }).describe('Joke to tell user.');
630
- *
631
- * const structuredLlm = llm.withStructuredOutput(Joke, {
632
- * name: "Joke",
633
- * strict: true, // Optionally enable OpenAI structured outputs
634
- * });
635
- * const jokeResult = await structuredLlm.invoke("Tell me a joke about cats");
636
- * console.log(jokeResult);
637
- * ```
638
- *
639
- * ```txt
640
- * {
641
- * setup: 'Why was the cat sitting on the computer?',
642
- * punchline: 'Because it wanted to keep an eye on the mouse!',
643
- * rating: 7
644
- * }
645
- * ```
646
- * </details>
647
- *
648
- * <br />
649
- *
650
- * <details>
651
- * <summary><strong>JSON Object Response Format</strong></summary>
652
- *
653
- * ```typescript
654
- * const jsonLlm = llm.withConfig({ response_format: { type: "json_object" } });
655
- * const jsonLlmAiMsg = await jsonLlm.invoke(
656
- * "Return a JSON object with key 'randomInts' and a value of 10 random ints in [0-99]"
657
- * );
658
- * console.log(jsonLlmAiMsg.content);
659
- * ```
660
- *
661
- * ```txt
662
- * {
663
- * "randomInts": [23, 87, 45, 12, 78, 34, 56, 90, 11, 67]
664
- * }
665
- * ```
666
- * </details>
667
- *
668
- * <br />
669
- *
670
- * <details>
671
- * <summary><strong>Multimodal</strong></summary>
672
- *
673
- * ```typescript
674
- * import { HumanMessage } from '@langchain/core/messages';
675
- *
676
- * const imageUrl = "https://example.com/image.jpg";
677
- * const imageData = await fetch(imageUrl).then(res => res.arrayBuffer());
678
- * const base64Image = Buffer.from(imageData).toString('base64');
679
- *
680
- * const message = new HumanMessage({
681
- * content: [
682
- * { type: "text", text: "describe the weather in this image" },
683
- * {
684
- * type: "image_url",
685
- * image_url: { url: `data:image/jpeg;base64,${base64Image}` },
686
- * },
687
- * ]
688
- * });
689
- *
690
- * const imageDescriptionAiMsg = await llm.invoke([message]);
691
- * console.log(imageDescriptionAiMsg.content);
692
- * ```
693
- *
694
- * ```txt
695
- * 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.
696
- * ```
697
- * </details>
698
- *
699
- * <br />
700
- *
701
- * <details>
702
- * <summary><strong>Usage Metadata</strong></summary>
703
- *
704
- * ```typescript
705
- * const aiMsgForMetadata = await llm.invoke(input);
706
- * console.log(aiMsgForMetadata.usage_metadata);
707
- * ```
708
- *
709
- * ```txt
710
- * { input_tokens: 28, output_tokens: 5, total_tokens: 33 }
711
- * ```
712
- * </details>
713
- *
714
- * <br />
715
- *
716
- * <details>
717
- * <summary><strong>Logprobs</strong></summary>
718
- *
719
- * ```typescript
720
- * const logprobsLlm = new ChatOpenAI({ model: "gpt-4o-mini", logprobs: true });
721
- * const aiMsgForLogprobs = await logprobsLlm.invoke(input);
722
- * console.log(aiMsgForLogprobs.response_metadata.logprobs);
723
- * ```
724
- *
725
- * ```txt
726
- * {
727
- * content: [
728
- * {
729
- * token: 'J',
730
- * logprob: -0.000050616763,
731
- * bytes: [Array],
732
- * top_logprobs: []
733
- * },
734
- * {
735
- * token: "'",
736
- * logprob: -0.01868736,
737
- * bytes: [Array],
738
- * top_logprobs: []
739
- * },
740
- * {
741
- * token: 'ad',
742
- * logprob: -0.0000030545007,
743
- * bytes: [Array],
744
- * top_logprobs: []
745
- * },
746
- * { token: 'ore', logprob: 0, bytes: [Array], top_logprobs: [] },
747
- * {
748
- * token: ' la',
749
- * logprob: -0.515404,
750
- * bytes: [Array],
751
- * top_logprobs: []
752
- * },
753
- * {
754
- * token: ' programm',
755
- * logprob: -0.0000118755715,
756
- * bytes: [Array],
757
- * top_logprobs: []
758
- * },
759
- * { token: 'ation', logprob: 0, bytes: [Array], top_logprobs: [] },
760
- * {
761
- * token: '.',
762
- * logprob: -0.0000037697225,
763
- * bytes: [Array],
764
- * top_logprobs: []
765
- * }
766
- * ],
767
- * refusal: null
768
- * }
769
- * ```
770
- * </details>
771
- *
772
- * <br />
773
- *
774
- * <details>
775
- * <summary><strong>Response Metadata</strong></summary>
776
- *
777
- * ```typescript
778
- * const aiMsgForResponseMetadata = await llm.invoke(input);
779
- * console.log(aiMsgForResponseMetadata.response_metadata);
780
- * ```
781
- *
782
- * ```txt
783
- * {
784
- * tokenUsage: { completionTokens: 5, promptTokens: 28, totalTokens: 33 },
785
- * finish_reason: 'stop',
786
- * system_fingerprint: 'fp_3aa7262c27'
787
- * }
788
- * ```
789
- * </details>
790
- *
791
- * <br />
792
- *
793
- * <details>
794
- * <summary><strong>JSON Schema Structured Output</strong></summary>
795
- *
796
- * ```typescript
797
- * const llmForJsonSchema = new ChatOpenAI({
798
- * model: "gpt-4o-2024-08-06",
799
- * }).withStructuredOutput(
800
- * z.object({
801
- * command: z.string().describe("The command to execute"),
802
- * expectedOutput: z.string().describe("The expected output of the command"),
803
- * options: z
804
- * .array(z.string())
805
- * .describe("The options you can pass to the command"),
806
- * }),
807
- * {
808
- * method: "jsonSchema",
809
- * strict: true, // Optional when using the `jsonSchema` method
810
- * }
811
- * );
812
- *
813
- * const jsonSchemaRes = await llmForJsonSchema.invoke(
814
- * "What is the command to list files in a directory?"
815
- * );
816
- * console.log(jsonSchemaRes);
817
- * ```
818
- *
819
- * ```txt
820
- * {
821
- * command: 'ls',
822
- * expectedOutput: 'A list of files and subdirectories within the specified directory.',
823
- * options: [
824
- * '-a: include directory entries whose names begin with a dot (.).',
825
- * '-l: use a long listing format.',
826
- * '-h: with -l, print sizes in human readable format (e.g., 1K, 234M, 2G).',
827
- * '-t: sort by time, newest first.',
828
- * '-r: reverse order while sorting.',
829
- * '-S: sort by file size, largest first.',
830
- * '-R: list subdirectories recursively.'
831
- * ]
832
- * }
833
- * ```
834
- * </details>
835
- *
836
- * <br />
837
- *
838
- * <details>
839
- * <summary><strong>Audio Outputs</strong></summary>
840
- *
841
- * ```typescript
842
- * import { ChatOpenAI } from "@langchain/openai";
843
- *
844
- * const modelWithAudioOutput = new ChatOpenAI({
845
- * model: "gpt-4o-audio-preview",
846
- * // You may also pass these fields to `.withConfig` as a call argument.
847
- * modalities: ["text", "audio"], // Specifies that the model should output audio.
848
- * audio: {
849
- * voice: "alloy",
850
- * format: "wav",
851
- * },
852
- * });
853
- *
854
- * const audioOutputResult = await modelWithAudioOutput.invoke("Tell me a joke about cats.");
855
- * const castMessageContent = audioOutputResult.content[0] as Record<string, any>;
856
- *
857
- * console.log({
858
- * ...castMessageContent,
859
- * data: castMessageContent.data.slice(0, 100) // Sliced for brevity
860
- * })
861
- * ```
862
- *
863
- * ```txt
864
- * {
865
- * id: 'audio_67117718c6008190a3afad3e3054b9b6',
866
- * data: 'UklGRqYwBgBXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAATElTVBoAAABJTkZPSVNGVA4AAABMYXZmNTguMjkuMTAwAGRhdGFg',
867
- * expires_at: 1729201448,
868
- * transcript: 'Sure! Why did the cat sit on the computer? Because it wanted to keep an eye on the mouse!'
869
- * }
870
- * ```
871
- * </details>
872
- *
873
- * <br />
874
- *
875
- * <details>
876
- * <summary><strong>Audio Outputs</strong></summary>
877
- *
878
- * ```typescript
879
- * import { ChatOpenAI } from "@langchain/openai";
880
- *
881
- * const modelWithAudioOutput = new ChatOpenAI({
882
- * model: "gpt-4o-audio-preview",
883
- * // You may also pass these fields to `.withConfig` as a call argument.
884
- * modalities: ["text", "audio"], // Specifies that the model should output audio.
885
- * audio: {
886
- * voice: "alloy",
887
- * format: "wav",
888
- * },
889
- * });
890
- *
891
- * const audioOutputResult = await modelWithAudioOutput.invoke("Tell me a joke about cats.");
892
- * const castAudioContent = audioOutputResult.additional_kwargs.audio as Record<string, any>;
893
- *
894
- * console.log({
895
- * ...castAudioContent,
896
- * data: castAudioContent.data.slice(0, 100) // Sliced for brevity
897
- * })
898
- * ```
899
- *
900
- * ```txt
901
- * {
902
- * id: 'audio_67117718c6008190a3afad3e3054b9b6',
903
- * data: 'UklGRqYwBgBXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAATElTVBoAAABJTkZPSVNGVA4AAABMYXZmNTguMjkuMTAwAGRhdGFg',
904
- * expires_at: 1729201448,
905
- * transcript: 'Sure! Why did the cat sit on the computer? Because it wanted to keep an eye on the mouse!'
906
- * }
907
- * ```
908
- * </details>
909
- *
910
- * <br />
911
- */
912
- declare class ChatOpenAI<CallOptions extends ChatOpenAICallOptions = ChatOpenAICallOptions> extends BaseChatOpenAI<CallOptions> {
913
- protected fields?: ChatOpenAIFields | undefined;
914
- /**
915
- * Whether to use the responses API for all requests. If `false` the responses API will be used
916
- * only when required in order to fulfill the request.
917
- */
918
- useResponsesApi: boolean;
919
- protected responses: ChatOpenAIResponses;
920
- protected completions: ChatOpenAICompletions;
921
- get lc_serializable_keys(): string[];
922
- constructor(fields?: ChatOpenAIFields | undefined);
923
- protected _useResponsesApi(options: this["ParsedCallOptions"] | undefined): boolean | undefined;
924
- getLsParams(options: this["ParsedCallOptions"]): LangSmithParams;
925
- invocationParams(options?: this["ParsedCallOptions"]): ChatCompletionsInvocationParams | ChatResponsesInvocationParams;
926
- /** @ignore */
927
- _generate(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;
928
- _streamResponseChunks(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;
929
- withConfig(config: Partial<CallOptions>): Runnable<BaseLanguageModelInput, AIMessageChunk, CallOptions>;
930
- }
931
- //#endregion
932
- export { BaseChatOpenAI, BaseChatOpenAICallOptions, BaseChatOpenAIFields, ChatOpenAI, ChatOpenAICallOptions, ChatOpenAICompletions, ChatOpenAICompletionsCallOptions, ChatOpenAIFields, ChatOpenAIResponses, ChatOpenAIResponsesCallOptions };
933
- //# sourceMappingURL=chat_models.d.cts.map