@langchain/openai 0.3.11 → 0.3.12

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.
@@ -1197,6 +1197,9 @@ class ChatOpenAI extends chat_models_1.BaseChatModel {
1197
1197
  : {}),
1198
1198
  ...this.modelKwargs,
1199
1199
  };
1200
+ if (options?.prediction !== undefined) {
1201
+ params.prediction = options.prediction;
1202
+ }
1200
1203
  return params;
1201
1204
  }
1202
1205
  /** @ignore */
@@ -95,6 +95,11 @@ export interface ChatOpenAICallOptions extends OpenAICallOptions, BaseFunctionCa
95
95
  * [Learn more](https://platform.openai.com/docs/guides/audio).
96
96
  */
97
97
  audio?: OpenAIClient.Chat.ChatCompletionAudioParam;
98
+ /**
99
+ * Static predicted output content, such as the content of a text file that is being regenerated.
100
+ * [Learn more](https://platform.openai.com/docs/guides/latency-optimization#use-predicted-outputs).
101
+ */
102
+ prediction?: OpenAIClient.ChatCompletionPredictionContent;
98
103
  }
99
104
  export interface ChatOpenAIFields extends Partial<OpenAIChatInput>, Partial<AzureOpenAIInput>, BaseChatModelParams {
100
105
  configuration?: ClientOptions & LegacyOpenAIInput;
@@ -1192,6 +1192,9 @@ export class ChatOpenAI extends BaseChatModel {
1192
1192
  : {}),
1193
1193
  ...this.modelKwargs,
1194
1194
  };
1195
+ if (options?.prediction !== undefined) {
1196
+ params.prediction = options.prediction;
1197
+ }
1195
1198
  return params;
1196
1199
  }
1197
1200
  /** @ignore */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/openai",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "OpenAI integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {
@@ -36,7 +36,7 @@
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
38
  "js-tiktoken": "^1.0.12",
39
- "openai": "^4.68.0",
39
+ "openai": "^4.71.0",
40
40
  "zod": "^3.22.4",
41
41
  "zod-to-json-schema": "^3.22.3"
42
42
  },