@langchain/openai 1.0.0-alpha.3 → 1.0.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 (103) hide show
  1. package/CHANGELOG.md +43 -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 +328 -0
  43. package/dist/chat_models/completions.cjs.map +1 -0
  44. package/dist/chat_models/completions.d.cts +33 -0
  45. package/dist/chat_models/completions.d.cts.map +1 -0
  46. package/dist/chat_models/completions.d.ts +33 -0
  47. package/dist/chat_models/completions.d.ts.map +1 -0
  48. package/dist/chat_models/completions.js +327 -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 +550 -0
  59. package/dist/chat_models/responses.cjs.map +1 -0
  60. package/dist/chat_models/responses.d.cts +77 -0
  61. package/dist/chat_models/responses.d.cts.map +1 -0
  62. package/dist/chat_models/responses.d.ts +77 -0
  63. package/dist/chat_models/responses.d.ts.map +1 -0
  64. package/dist/chat_models/responses.js +549 -0
  65. package/dist/chat_models/responses.js.map +1 -0
  66. package/dist/index.cjs +14 -7
  67. package/dist/index.d.cts +9 -3
  68. package/dist/index.d.ts +9 -3
  69. package/dist/index.js +8 -3
  70. package/dist/langchain-core/dist/callbacks/base.d.ts +1 -0
  71. package/dist/langchain-core/dist/callbacks/manager.d.ts +2 -0
  72. package/dist/langchain-core/dist/language_models/base.d.ts +5 -0
  73. package/dist/langchain-core/dist/language_models/chat_models.d.cts +13 -0
  74. package/dist/langchain-core/dist/language_models/chat_models.d.cts.map +1 -0
  75. package/dist/langchain-core/dist/language_models/chat_models.d.ts +20 -0
  76. package/dist/langchain-core/dist/language_models/chat_models.d.ts.map +1 -0
  77. package/dist/langchain-core/dist/runnables/base.d.ts +7 -0
  78. package/dist/langchain-core/dist/runnables/graph.d.ts +1 -0
  79. package/dist/langchain-core/dist/runnables/types.d.ts +2 -0
  80. package/dist/langchain-core/dist/tools/types.d.ts +5 -0
  81. package/dist/langchain-core/dist/tracers/base.d.ts +2 -0
  82. package/dist/langchain-core/dist/tracers/event_stream.d.ts +1 -0
  83. package/dist/langchain-core/dist/tracers/log_stream.d.ts +3 -0
  84. package/dist/langchain-core/dist/utils/types/index.d.ts +1 -0
  85. package/dist/langchain-core/dist/utils/types/zod.d.ts +1 -0
  86. package/dist/llms.cjs +1 -1
  87. package/dist/llms.d.cts +1 -1
  88. package/dist/llms.js +1 -1
  89. package/dist/utils/message_inputs.cjs +1 -1
  90. package/dist/utils/message_inputs.js +1 -1
  91. package/package.json +10 -7
  92. package/dist/azure/chat_models.cjs.map +0 -1
  93. package/dist/azure/chat_models.d.cts.map +0 -1
  94. package/dist/azure/chat_models.d.ts.map +0 -1
  95. package/dist/azure/chat_models.js.map +0 -1
  96. package/dist/chat_models.cjs +0 -1967
  97. package/dist/chat_models.cjs.map +0 -1
  98. package/dist/chat_models.d.cts +0 -933
  99. package/dist/chat_models.d.cts.map +0 -1
  100. package/dist/chat_models.d.ts +0 -933
  101. package/dist/chat_models.d.ts.map +0 -1
  102. package/dist/chat_models.js +0 -1963
  103. package/dist/chat_models.js.map +0 -1
@@ -0,0 +1,593 @@
1
+ import { OpenAICallOptions, OpenAIChatInput } from "../types.js";
2
+ import { BaseChatOpenAI, BaseChatOpenAIFields } from "./base.js";
3
+ import { ChatOpenAIResponses, ChatOpenAIResponsesCallOptions } from "./responses.js";
4
+ import { ChatOpenAICompletions, ChatOpenAICompletionsCallOptions } from "./completions.js";
5
+ import { LangSmithParams } from "../langchain-core/dist/language_models/chat_models.js";
6
+ import { BaseLanguageModelInput } from "@langchain/core/language_models/base";
7
+ import { Runnable } from "@langchain/core/runnables";
8
+ import { AIMessageChunk, BaseMessage } from "@langchain/core/messages";
9
+ import { ChatGenerationChunk, ChatResult } from "@langchain/core/outputs";
10
+ import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
11
+
12
+ //#region src/chat_models/index.d.ts
13
+ type ChatOpenAICallOptions = ChatOpenAICompletionsCallOptions & ChatOpenAIResponsesCallOptions;
14
+ interface ChatOpenAIFields extends BaseChatOpenAIFields {
15
+ /**
16
+ * Whether to use the responses API for all requests. If `false` the responses API will be used
17
+ * only when required in order to fulfill the request.
18
+ */
19
+ useResponsesApi?: boolean;
20
+ /**
21
+ * The completions chat instance
22
+ * @internal
23
+ */
24
+ completions?: ChatOpenAICompletions;
25
+ /**
26
+ * The responses chat instance
27
+ * @internal
28
+ */
29
+ responses?: ChatOpenAIResponses;
30
+ }
31
+ /**
32
+ * OpenAI chat model integration.
33
+ *
34
+ * To use with Azure, import the `AzureChatOpenAI` class.
35
+ *
36
+ * Setup:
37
+ * Install `@langchain/openai` and set an environment variable named `OPENAI_API_KEY`.
38
+ *
39
+ * ```bash
40
+ * npm install @langchain/openai
41
+ * export OPENAI_API_KEY="your-api-key"
42
+ * ```
43
+ *
44
+ * ## [Constructor args](https://api.js.langchain.com/classes/langchain_openai.ChatOpenAI.html#constructor)
45
+ *
46
+ * ## [Runtime args](https://api.js.langchain.com/interfaces/langchain_openai.ChatOpenAICallOptions.html)
47
+ *
48
+ * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
49
+ * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:
50
+ *
51
+ * ```typescript
52
+ * // When calling `.withConfig`, call options should be passed via the first argument
53
+ * const llmWithArgsBound = llm.withConfig({
54
+ * stop: ["\n"],
55
+ * tools: [...],
56
+ * });
57
+ *
58
+ * // When calling `.bindTools`, call options should be passed via the second argument
59
+ * const llmWithTools = llm.bindTools(
60
+ * [...],
61
+ * {
62
+ * tool_choice: "auto",
63
+ * }
64
+ * );
65
+ * ```
66
+ *
67
+ * ## Examples
68
+ *
69
+ * <details open>
70
+ * <summary><strong>Instantiate</strong></summary>
71
+ *
72
+ * ```typescript
73
+ * import { ChatOpenAI } from '@langchain/openai';
74
+ *
75
+ * const llm = new ChatOpenAI({
76
+ * model: "gpt-4o-mini",
77
+ * temperature: 0,
78
+ * maxTokens: undefined,
79
+ * timeout: undefined,
80
+ * maxRetries: 2,
81
+ * // apiKey: "...",
82
+ * // configuration: {
83
+ * // baseURL: "...",
84
+ * // }
85
+ * // organization: "...",
86
+ * // other params...
87
+ * });
88
+ * ```
89
+ * </details>
90
+ *
91
+ * <br />
92
+ *
93
+ * <details>
94
+ * <summary><strong>Invoking</strong></summary>
95
+ *
96
+ * ```typescript
97
+ * const input = `Translate "I love programming" into French.`;
98
+ *
99
+ * // Models also accept a list of chat messages or a formatted prompt
100
+ * const result = await llm.invoke(input);
101
+ * console.log(result);
102
+ * ```
103
+ *
104
+ * ```txt
105
+ * AIMessage {
106
+ * "id": "chatcmpl-9u4Mpu44CbPjwYFkTbeoZgvzB00Tz",
107
+ * "content": "J'adore la programmation.",
108
+ * "response_metadata": {
109
+ * "tokenUsage": {
110
+ * "completionTokens": 5,
111
+ * "promptTokens": 28,
112
+ * "totalTokens": 33
113
+ * },
114
+ * "finish_reason": "stop",
115
+ * "system_fingerprint": "fp_3aa7262c27"
116
+ * },
117
+ * "usage_metadata": {
118
+ * "input_tokens": 28,
119
+ * "output_tokens": 5,
120
+ * "total_tokens": 33
121
+ * }
122
+ * }
123
+ * ```
124
+ * </details>
125
+ *
126
+ * <br />
127
+ *
128
+ * <details>
129
+ * <summary><strong>Streaming Chunks</strong></summary>
130
+ *
131
+ * ```typescript
132
+ * for await (const chunk of await llm.stream(input)) {
133
+ * console.log(chunk);
134
+ * }
135
+ * ```
136
+ *
137
+ * ```txt
138
+ * AIMessageChunk {
139
+ * "id": "chatcmpl-9u4NWB7yUeHCKdLr6jP3HpaOYHTqs",
140
+ * "content": ""
141
+ * }
142
+ * AIMessageChunk {
143
+ * "content": "J"
144
+ * }
145
+ * AIMessageChunk {
146
+ * "content": "'adore"
147
+ * }
148
+ * AIMessageChunk {
149
+ * "content": " la"
150
+ * }
151
+ * AIMessageChunk {
152
+ * "content": " programmation",,
153
+ * }
154
+ * AIMessageChunk {
155
+ * "content": ".",,
156
+ * }
157
+ * AIMessageChunk {
158
+ * "content": "",
159
+ * "response_metadata": {
160
+ * "finish_reason": "stop",
161
+ * "system_fingerprint": "fp_c9aa9c0491"
162
+ * },
163
+ * }
164
+ * AIMessageChunk {
165
+ * "content": "",
166
+ * "usage_metadata": {
167
+ * "input_tokens": 28,
168
+ * "output_tokens": 5,
169
+ * "total_tokens": 33
170
+ * }
171
+ * }
172
+ * ```
173
+ * </details>
174
+ *
175
+ * <br />
176
+ *
177
+ * <details>
178
+ * <summary><strong>Aggregate Streamed Chunks</strong></summary>
179
+ *
180
+ * ```typescript
181
+ * import { AIMessageChunk } from '@langchain/core/messages';
182
+ * import { concat } from '@langchain/core/utils/stream';
183
+ *
184
+ * const stream = await llm.stream(input);
185
+ * let full: AIMessageChunk | undefined;
186
+ * for await (const chunk of stream) {
187
+ * full = !full ? chunk : concat(full, chunk);
188
+ * }
189
+ * console.log(full);
190
+ * ```
191
+ *
192
+ * ```txt
193
+ * AIMessageChunk {
194
+ * "id": "chatcmpl-9u4PnX6Fy7OmK46DASy0bH6cxn5Xu",
195
+ * "content": "J'adore la programmation.",
196
+ * "response_metadata": {
197
+ * "prompt": 0,
198
+ * "completion": 0,
199
+ * "finish_reason": "stop",
200
+ * },
201
+ * "usage_metadata": {
202
+ * "input_tokens": 28,
203
+ * "output_tokens": 5,
204
+ * "total_tokens": 33
205
+ * }
206
+ * }
207
+ * ```
208
+ * </details>
209
+ *
210
+ * <br />
211
+ *
212
+ * <details>
213
+ * <summary><strong>Bind tools</strong></summary>
214
+ *
215
+ * ```typescript
216
+ * import { z } from 'zod';
217
+ *
218
+ * const GetWeather = {
219
+ * name: "GetWeather",
220
+ * description: "Get the current weather in a given location",
221
+ * schema: z.object({
222
+ * location: z.string().describe("The city and state, e.g. San Francisco, CA")
223
+ * }),
224
+ * }
225
+ *
226
+ * const GetPopulation = {
227
+ * name: "GetPopulation",
228
+ * description: "Get the current population in a given location",
229
+ * schema: z.object({
230
+ * location: z.string().describe("The city and state, e.g. San Francisco, CA")
231
+ * }),
232
+ * }
233
+ *
234
+ * const llmWithTools = llm.bindTools(
235
+ * [GetWeather, GetPopulation],
236
+ * {
237
+ * // strict: true // enforce tool args schema is respected
238
+ * }
239
+ * );
240
+ * const aiMsg = await llmWithTools.invoke(
241
+ * "Which city is hotter today and which is bigger: LA or NY?"
242
+ * );
243
+ * console.log(aiMsg.tool_calls);
244
+ * ```
245
+ *
246
+ * ```txt
247
+ * [
248
+ * {
249
+ * name: 'GetWeather',
250
+ * args: { location: 'Los Angeles, CA' },
251
+ * type: 'tool_call',
252
+ * id: 'call_uPU4FiFzoKAtMxfmPnfQL6UK'
253
+ * },
254
+ * {
255
+ * name: 'GetWeather',
256
+ * args: { location: 'New York, NY' },
257
+ * type: 'tool_call',
258
+ * id: 'call_UNkEwuQsHrGYqgDQuH9nPAtX'
259
+ * },
260
+ * {
261
+ * name: 'GetPopulation',
262
+ * args: { location: 'Los Angeles, CA' },
263
+ * type: 'tool_call',
264
+ * id: 'call_kL3OXxaq9OjIKqRTpvjaCH14'
265
+ * },
266
+ * {
267
+ * name: 'GetPopulation',
268
+ * args: { location: 'New York, NY' },
269
+ * type: 'tool_call',
270
+ * id: 'call_s9KQB1UWj45LLGaEnjz0179q'
271
+ * }
272
+ * ]
273
+ * ```
274
+ * </details>
275
+ *
276
+ * <br />
277
+ *
278
+ * <details>
279
+ * <summary><strong>Structured Output</strong></summary>
280
+ *
281
+ * ```typescript
282
+ * import { z } from 'zod';
283
+ *
284
+ * const Joke = z.object({
285
+ * setup: z.string().describe("The setup of the joke"),
286
+ * punchline: z.string().describe("The punchline to the joke"),
287
+ * rating: z.number().nullable().describe("How funny the joke is, from 1 to 10")
288
+ * }).describe('Joke to tell user.');
289
+ *
290
+ * const structuredLlm = llm.withStructuredOutput(Joke, {
291
+ * name: "Joke",
292
+ * strict: true, // Optionally enable OpenAI structured outputs
293
+ * });
294
+ * const jokeResult = await structuredLlm.invoke("Tell me a joke about cats");
295
+ * console.log(jokeResult);
296
+ * ```
297
+ *
298
+ * ```txt
299
+ * {
300
+ * setup: 'Why was the cat sitting on the computer?',
301
+ * punchline: 'Because it wanted to keep an eye on the mouse!',
302
+ * rating: 7
303
+ * }
304
+ * ```
305
+ * </details>
306
+ *
307
+ * <br />
308
+ *
309
+ * <details>
310
+ * <summary><strong>JSON Object Response Format</strong></summary>
311
+ *
312
+ * ```typescript
313
+ * const jsonLlm = llm.withConfig({ response_format: { type: "json_object" } });
314
+ * const jsonLlmAiMsg = await jsonLlm.invoke(
315
+ * "Return a JSON object with key 'randomInts' and a value of 10 random ints in [0-99]"
316
+ * );
317
+ * console.log(jsonLlmAiMsg.content);
318
+ * ```
319
+ *
320
+ * ```txt
321
+ * {
322
+ * "randomInts": [23, 87, 45, 12, 78, 34, 56, 90, 11, 67]
323
+ * }
324
+ * ```
325
+ * </details>
326
+ *
327
+ * <br />
328
+ *
329
+ * <details>
330
+ * <summary><strong>Multimodal</strong></summary>
331
+ *
332
+ * ```typescript
333
+ * import { HumanMessage } from '@langchain/core/messages';
334
+ *
335
+ * const imageUrl = "https://example.com/image.jpg";
336
+ * const imageData = await fetch(imageUrl).then(res => res.arrayBuffer());
337
+ * const base64Image = Buffer.from(imageData).toString('base64');
338
+ *
339
+ * const message = new HumanMessage({
340
+ * content: [
341
+ * { type: "text", text: "describe the weather in this image" },
342
+ * {
343
+ * type: "image_url",
344
+ * image_url: { url: `data:image/jpeg;base64,${base64Image}` },
345
+ * },
346
+ * ]
347
+ * });
348
+ *
349
+ * const imageDescriptionAiMsg = await llm.invoke([message]);
350
+ * console.log(imageDescriptionAiMsg.content);
351
+ * ```
352
+ *
353
+ * ```txt
354
+ * 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.
355
+ * ```
356
+ * </details>
357
+ *
358
+ * <br />
359
+ *
360
+ * <details>
361
+ * <summary><strong>Usage Metadata</strong></summary>
362
+ *
363
+ * ```typescript
364
+ * const aiMsgForMetadata = await llm.invoke(input);
365
+ * console.log(aiMsgForMetadata.usage_metadata);
366
+ * ```
367
+ *
368
+ * ```txt
369
+ * { input_tokens: 28, output_tokens: 5, total_tokens: 33 }
370
+ * ```
371
+ * </details>
372
+ *
373
+ * <br />
374
+ *
375
+ * <details>
376
+ * <summary><strong>Logprobs</strong></summary>
377
+ *
378
+ * ```typescript
379
+ * const logprobsLlm = new ChatOpenAI({ model: "gpt-4o-mini", logprobs: true });
380
+ * const aiMsgForLogprobs = await logprobsLlm.invoke(input);
381
+ * console.log(aiMsgForLogprobs.response_metadata.logprobs);
382
+ * ```
383
+ *
384
+ * ```txt
385
+ * {
386
+ * content: [
387
+ * {
388
+ * token: 'J',
389
+ * logprob: -0.000050616763,
390
+ * bytes: [Array],
391
+ * top_logprobs: []
392
+ * },
393
+ * {
394
+ * token: "'",
395
+ * logprob: -0.01868736,
396
+ * bytes: [Array],
397
+ * top_logprobs: []
398
+ * },
399
+ * {
400
+ * token: 'ad',
401
+ * logprob: -0.0000030545007,
402
+ * bytes: [Array],
403
+ * top_logprobs: []
404
+ * },
405
+ * { token: 'ore', logprob: 0, bytes: [Array], top_logprobs: [] },
406
+ * {
407
+ * token: ' la',
408
+ * logprob: -0.515404,
409
+ * bytes: [Array],
410
+ * top_logprobs: []
411
+ * },
412
+ * {
413
+ * token: ' programm',
414
+ * logprob: -0.0000118755715,
415
+ * bytes: [Array],
416
+ * top_logprobs: []
417
+ * },
418
+ * { token: 'ation', logprob: 0, bytes: [Array], top_logprobs: [] },
419
+ * {
420
+ * token: '.',
421
+ * logprob: -0.0000037697225,
422
+ * bytes: [Array],
423
+ * top_logprobs: []
424
+ * }
425
+ * ],
426
+ * refusal: null
427
+ * }
428
+ * ```
429
+ * </details>
430
+ *
431
+ * <br />
432
+ *
433
+ * <details>
434
+ * <summary><strong>Response Metadata</strong></summary>
435
+ *
436
+ * ```typescript
437
+ * const aiMsgForResponseMetadata = await llm.invoke(input);
438
+ * console.log(aiMsgForResponseMetadata.response_metadata);
439
+ * ```
440
+ *
441
+ * ```txt
442
+ * {
443
+ * tokenUsage: { completionTokens: 5, promptTokens: 28, totalTokens: 33 },
444
+ * finish_reason: 'stop',
445
+ * system_fingerprint: 'fp_3aa7262c27'
446
+ * }
447
+ * ```
448
+ * </details>
449
+ *
450
+ * <br />
451
+ *
452
+ * <details>
453
+ * <summary><strong>JSON Schema Structured Output</strong></summary>
454
+ *
455
+ * ```typescript
456
+ * const llmForJsonSchema = new ChatOpenAI({
457
+ * model: "gpt-4o-2024-08-06",
458
+ * }).withStructuredOutput(
459
+ * z.object({
460
+ * command: z.string().describe("The command to execute"),
461
+ * expectedOutput: z.string().describe("The expected output of the command"),
462
+ * options: z
463
+ * .array(z.string())
464
+ * .describe("The options you can pass to the command"),
465
+ * }),
466
+ * {
467
+ * method: "jsonSchema",
468
+ * strict: true, // Optional when using the `jsonSchema` method
469
+ * }
470
+ * );
471
+ *
472
+ * const jsonSchemaRes = await llmForJsonSchema.invoke(
473
+ * "What is the command to list files in a directory?"
474
+ * );
475
+ * console.log(jsonSchemaRes);
476
+ * ```
477
+ *
478
+ * ```txt
479
+ * {
480
+ * command: 'ls',
481
+ * expectedOutput: 'A list of files and subdirectories within the specified directory.',
482
+ * options: [
483
+ * '-a: include directory entries whose names begin with a dot (.).',
484
+ * '-l: use a long listing format.',
485
+ * '-h: with -l, print sizes in human readable format (e.g., 1K, 234M, 2G).',
486
+ * '-t: sort by time, newest first.',
487
+ * '-r: reverse order while sorting.',
488
+ * '-S: sort by file size, largest first.',
489
+ * '-R: list subdirectories recursively.'
490
+ * ]
491
+ * }
492
+ * ```
493
+ * </details>
494
+ *
495
+ * <br />
496
+ *
497
+ * <details>
498
+ * <summary><strong>Audio Outputs</strong></summary>
499
+ *
500
+ * ```typescript
501
+ * import { ChatOpenAI } from "@langchain/openai";
502
+ *
503
+ * const modelWithAudioOutput = new ChatOpenAI({
504
+ * model: "gpt-4o-audio-preview",
505
+ * // You may also pass these fields to `.withConfig` as a call argument.
506
+ * modalities: ["text", "audio"], // Specifies that the model should output audio.
507
+ * audio: {
508
+ * voice: "alloy",
509
+ * format: "wav",
510
+ * },
511
+ * });
512
+ *
513
+ * const audioOutputResult = await modelWithAudioOutput.invoke("Tell me a joke about cats.");
514
+ * const castMessageContent = audioOutputResult.content[0] as Record<string, any>;
515
+ *
516
+ * console.log({
517
+ * ...castMessageContent,
518
+ * data: castMessageContent.data.slice(0, 100) // Sliced for brevity
519
+ * })
520
+ * ```
521
+ *
522
+ * ```txt
523
+ * {
524
+ * id: 'audio_67117718c6008190a3afad3e3054b9b6',
525
+ * data: 'UklGRqYwBgBXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAATElTVBoAAABJTkZPSVNGVA4AAABMYXZmNTguMjkuMTAwAGRhdGFg',
526
+ * expires_at: 1729201448,
527
+ * transcript: 'Sure! Why did the cat sit on the computer? Because it wanted to keep an eye on the mouse!'
528
+ * }
529
+ * ```
530
+ * </details>
531
+ *
532
+ * <br />
533
+ *
534
+ * <details>
535
+ * <summary><strong>Audio Outputs</strong></summary>
536
+ *
537
+ * ```typescript
538
+ * import { ChatOpenAI } from "@langchain/openai";
539
+ *
540
+ * const modelWithAudioOutput = new ChatOpenAI({
541
+ * model: "gpt-4o-audio-preview",
542
+ * // You may also pass these fields to `.withConfig` as a call argument.
543
+ * modalities: ["text", "audio"], // Specifies that the model should output audio.
544
+ * audio: {
545
+ * voice: "alloy",
546
+ * format: "wav",
547
+ * },
548
+ * });
549
+ *
550
+ * const audioOutputResult = await modelWithAudioOutput.invoke("Tell me a joke about cats.");
551
+ * const castAudioContent = audioOutputResult.additional_kwargs.audio as Record<string, any>;
552
+ *
553
+ * console.log({
554
+ * ...castAudioContent,
555
+ * data: castAudioContent.data.slice(0, 100) // Sliced for brevity
556
+ * })
557
+ * ```
558
+ *
559
+ * ```txt
560
+ * {
561
+ * id: 'audio_67117718c6008190a3afad3e3054b9b6',
562
+ * data: 'UklGRqYwBgBXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAATElTVBoAAABJTkZPSVNGVA4AAABMYXZmNTguMjkuMTAwAGRhdGFg',
563
+ * expires_at: 1729201448,
564
+ * transcript: 'Sure! Why did the cat sit on the computer? Because it wanted to keep an eye on the mouse!'
565
+ * }
566
+ * ```
567
+ * </details>
568
+ *
569
+ * <br />
570
+ */
571
+ declare class ChatOpenAI<CallOptions extends ChatOpenAICallOptions = ChatOpenAICallOptions> extends BaseChatOpenAI<CallOptions> {
572
+ protected fields?: ChatOpenAIFields | undefined;
573
+ /**
574
+ * Whether to use the responses API for all requests. If `false` the responses API will be used
575
+ * only when required in order to fulfill the request.
576
+ */
577
+ useResponsesApi: boolean;
578
+ protected responses: ChatOpenAIResponses;
579
+ protected completions: ChatOpenAICompletions;
580
+ get lc_serializable_keys(): string[];
581
+ get callKeys(): string[];
582
+ constructor(fields?: ChatOpenAIFields | undefined);
583
+ protected _useResponsesApi(options: this["ParsedCallOptions"] | undefined): boolean | undefined;
584
+ getLsParams(options: this["ParsedCallOptions"]): LangSmithParams;
585
+ invocationParams(options?: this["ParsedCallOptions"]): any;
586
+ /** @ignore */
587
+ _generate(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;
588
+ _streamResponseChunks(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;
589
+ withConfig(config: Partial<CallOptions>): Runnable<BaseLanguageModelInput, AIMessageChunk, CallOptions>;
590
+ }
591
+ //#endregion
592
+ export { ChatOpenAI, ChatOpenAICallOptions, ChatOpenAIFields };
593
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":["CallbackManagerForLLMRun","AIMessageChunk","BaseMessage","ChatGenerationChunk","ChatResult","BaseLanguageModelInput","Runnable","OpenAICallOptions","OpenAIChatInput","ChatOpenAICompletions","ChatOpenAICompletionsCallOptions","ChatOpenAIResponses","ChatOpenAIResponsesCallOptions","BaseChatOpenAI","BaseChatOpenAIFields","ChatOpenAICallOptions","ChatOpenAIFields","ChatOpenAI","CallOptions","____________langchain_core_dist_language_models_chat_models_js0","LangSmithParams","Promise","AsyncGenerator","Partial"],"sources":["../../src/chat_models/index.d.ts"],"sourcesContent":["import { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport { AIMessageChunk, type BaseMessage } from \"@langchain/core/messages\";\nimport { ChatGenerationChunk, type ChatResult } from \"@langchain/core/outputs\";\nimport { type BaseLanguageModelInput } from \"@langchain/core/language_models/base\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { type OpenAICallOptions, type OpenAIChatInput } from \"../types.js\";\nimport { ChatOpenAICompletions, ChatOpenAICompletionsCallOptions } from \"./completions.js\";\nimport { ChatOpenAIResponses, ChatOpenAIResponsesCallOptions } from \"./responses.js\";\nimport { BaseChatOpenAI, BaseChatOpenAIFields } from \"./base.js\";\nexport type { OpenAICallOptions, OpenAIChatInput };\nexport type ChatOpenAICallOptions = ChatOpenAICompletionsCallOptions & ChatOpenAIResponsesCallOptions;\nexport interface ChatOpenAIFields extends BaseChatOpenAIFields {\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 /**\n * The completions chat instance\n * @internal\n */\n completions?: ChatOpenAICompletions;\n /**\n * The responses chat instance\n * @internal\n */\n responses?: ChatOpenAIResponses;\n}\n/**\n * OpenAI chat model integration.\n *\n * To use with Azure, import the `AzureChatOpenAI` class.\n *\n * Setup:\n * Install `@langchain/openai` and set an environment variable named `OPENAI_API_KEY`.\n *\n * ```bash\n * npm install @langchain/openai\n * export OPENAI_API_KEY=\"your-api-key\"\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/langchain_openai.ChatOpenAI.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 { ChatOpenAI } from '@langchain/openai';\n *\n * const llm = new ChatOpenAI({\n * model: \"gpt-4o-mini\",\n * temperature: 0,\n * maxTokens: undefined,\n * timeout: undefined,\n * maxRetries: 2,\n * // apiKey: \"...\",\n * // configuration: {\n * // baseURL: \"...\",\n * // }\n * // organization: \"...\",\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(\n * [GetWeather, GetPopulation],\n * {\n * // strict: true // enforce tool args schema is respected\n * }\n * );\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, {\n * name: \"Joke\",\n * strict: true, // Optionally enable OpenAI structured outputs\n * });\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 *\n * <br />\n *\n * <details>\n * <summary><strong>JSON Schema Structured Output</strong></summary>\n *\n * ```typescript\n * const llmForJsonSchema = new ChatOpenAI({\n * model: \"gpt-4o-2024-08-06\",\n * }).withStructuredOutput(\n * z.object({\n * command: z.string().describe(\"The command to execute\"),\n * expectedOutput: z.string().describe(\"The expected output of the command\"),\n * options: z\n * .array(z.string())\n * .describe(\"The options you can pass to the command\"),\n * }),\n * {\n * method: \"jsonSchema\",\n * strict: true, // Optional when using the `jsonSchema` method\n * }\n * );\n *\n * const jsonSchemaRes = await llmForJsonSchema.invoke(\n * \"What is the command to list files in a directory?\"\n * );\n * console.log(jsonSchemaRes);\n * ```\n *\n * ```txt\n * {\n * command: 'ls',\n * expectedOutput: 'A list of files and subdirectories within the specified directory.',\n * options: [\n * '-a: include directory entries whose names begin with a dot (.).',\n * '-l: use a long listing format.',\n * '-h: with -l, print sizes in human readable format (e.g., 1K, 234M, 2G).',\n * '-t: sort by time, newest first.',\n * '-r: reverse order while sorting.',\n * '-S: sort by file size, largest first.',\n * '-R: list subdirectories recursively.'\n * ]\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Audio Outputs</strong></summary>\n *\n * ```typescript\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * const modelWithAudioOutput = new ChatOpenAI({\n * model: \"gpt-4o-audio-preview\",\n * // You may also pass these fields to `.withConfig` as a call argument.\n * modalities: [\"text\", \"audio\"], // Specifies that the model should output audio.\n * audio: {\n * voice: \"alloy\",\n * format: \"wav\",\n * },\n * });\n *\n * const audioOutputResult = await modelWithAudioOutput.invoke(\"Tell me a joke about cats.\");\n * const castMessageContent = audioOutputResult.content[0] as Record<string, any>;\n *\n * console.log({\n * ...castMessageContent,\n * data: castMessageContent.data.slice(0, 100) // Sliced for brevity\n * })\n * ```\n *\n * ```txt\n * {\n * id: 'audio_67117718c6008190a3afad3e3054b9b6',\n * data: 'UklGRqYwBgBXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAATElTVBoAAABJTkZPSVNGVA4AAABMYXZmNTguMjkuMTAwAGRhdGFg',\n * expires_at: 1729201448,\n * transcript: 'Sure! Why did the cat sit on the computer? Because it wanted to keep an eye on the mouse!'\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Audio Outputs</strong></summary>\n *\n * ```typescript\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * const modelWithAudioOutput = new ChatOpenAI({\n * model: \"gpt-4o-audio-preview\",\n * // You may also pass these fields to `.withConfig` as a call argument.\n * modalities: [\"text\", \"audio\"], // Specifies that the model should output audio.\n * audio: {\n * voice: \"alloy\",\n * format: \"wav\",\n * },\n * });\n *\n * const audioOutputResult = await modelWithAudioOutput.invoke(\"Tell me a joke about cats.\");\n * const castAudioContent = audioOutputResult.additional_kwargs.audio as Record<string, any>;\n *\n * console.log({\n * ...castAudioContent,\n * data: castAudioContent.data.slice(0, 100) // Sliced for brevity\n * })\n * ```\n *\n * ```txt\n * {\n * id: 'audio_67117718c6008190a3afad3e3054b9b6',\n * data: 'UklGRqYwBgBXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAATElTVBoAAABJTkZPSVNGVA4AAABMYXZmNTguMjkuMTAwAGRhdGFg',\n * expires_at: 1729201448,\n * transcript: 'Sure! Why did the cat sit on the computer? Because it wanted to keep an eye on the mouse!'\n * }\n * ```\n * </details>\n *\n * <br />\n */\nexport declare class ChatOpenAI<CallOptions extends ChatOpenAICallOptions = ChatOpenAICallOptions> extends BaseChatOpenAI<CallOptions> {\n protected fields?: ChatOpenAIFields | undefined;\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 protected responses: ChatOpenAIResponses;\n protected completions: ChatOpenAICompletions;\n get lc_serializable_keys(): string[];\n get callKeys(): string[];\n constructor(fields?: ChatOpenAIFields | undefined);\n protected _useResponsesApi(options: this[\"ParsedCallOptions\"] | undefined): boolean | undefined;\n getLsParams(options: this[\"ParsedCallOptions\"]): import(\"../../../../langchain-core/dist/language_models/chat_models.js\").LangSmithParams;\n invocationParams(options?: this[\"ParsedCallOptions\"]): any;\n /** @ignore */\n _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n _streamResponseChunks(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;\n withConfig(config: Partial<CallOptions>): Runnable<BaseLanguageModelInput, AIMessageChunk, CallOptions>;\n}\n"],"mappings":";;;;;;;;;;;;KAUYe,qBAAAA,GAAwBL,mCAAmCE;UACtDI,gBAAAA,SAAyBF;EAD9BC;;;;EAAyF,eAAA,CAAA,EAAA,OAAA;EACpFC;;;;EAekB,WAfOF,CAAAA,EAUxBL,qBAVwBK;EAAoB;AA6iB9D;;;EAAyE,SAAGC,CAAAA,EA9hB5DJ,mBA8hB4DI;;;;;;;;;;;;;;;;;;;;;;AAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAApGE,+BAA+BF,wBAAwBA,+BAA+BF,eAAeK;qBACnGF;;;;;;uBAMEL;yBACEF;;;uBAGFO;;mDAAgB;;;sBAKjBd,gEAAgEF,2BAA2BqB,QAAQjB;kCACvFF,gEAAgEF,2BAA2BsB,eAAenB;qBACvHoB,QAAQL,eAAeZ,SAASD,wBAAwBJ,gBAAgBiB"}