@langchain/openai 0.5.1 → 0.5.3-dev.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.
@@ -1295,11 +1295,15 @@ class ChatOpenAI extends chat_models_1.BaseChatModel {
1295
1295
  this.reasoningEffort = fields?.reasoningEffort;
1296
1296
  this.maxTokens = fields?.maxCompletionTokens ?? fields?.maxTokens;
1297
1297
  this.useResponsesApi = fields?.useResponsesApi ?? this.useResponsesApi;
1298
- if (this.model === "o1") {
1298
+ this.disableStreaming = fields?.disableStreaming ?? this.disableStreaming;
1299
+ if (this.model === "o1")
1299
1300
  this.disableStreaming = true;
1300
- }
1301
1301
  this.streaming = fields?.streaming ?? false;
1302
+ if (this.disableStreaming)
1303
+ this.streaming = false;
1302
1304
  this.streamUsage = fields?.streamUsage ?? this.streamUsage;
1305
+ if (this.disableStreaming)
1306
+ this.streamUsage = false;
1303
1307
  this.clientConfig = {
1304
1308
  apiKey: this.apiKey,
1305
1309
  organization: this.organization,
@@ -1290,11 +1290,15 @@ export class ChatOpenAI extends BaseChatModel {
1290
1290
  this.reasoningEffort = fields?.reasoningEffort;
1291
1291
  this.maxTokens = fields?.maxCompletionTokens ?? fields?.maxTokens;
1292
1292
  this.useResponsesApi = fields?.useResponsesApi ?? this.useResponsesApi;
1293
- if (this.model === "o1") {
1293
+ this.disableStreaming = fields?.disableStreaming ?? this.disableStreaming;
1294
+ if (this.model === "o1")
1294
1295
  this.disableStreaming = true;
1295
- }
1296
1296
  this.streaming = fields?.streaming ?? false;
1297
+ if (this.disableStreaming)
1298
+ this.streaming = false;
1297
1299
  this.streamUsage = fields?.streamUsage ?? this.streamUsage;
1300
+ if (this.disableStreaming)
1301
+ this.streamUsage = false;
1298
1302
  this.clientConfig = {
1299
1303
  apiKey: this.apiKey,
1300
1304
  organization: this.organization,
@@ -89,7 +89,7 @@ class DallEAPIWrapper extends tools_1.Tool {
89
89
  apiKey: openAIApiKey,
90
90
  organization,
91
91
  dangerouslyAllowBrowser: true,
92
- baseUrl: fields?.baseUrl,
92
+ baseURL: fields?.baseUrl,
93
93
  };
94
94
  this.client = new openai_1.OpenAI(clientConfig);
95
95
  this.model = fields?.model ?? fields?.modelName ?? this.model;
@@ -86,7 +86,7 @@ export class DallEAPIWrapper extends Tool {
86
86
  apiKey: openAIApiKey,
87
87
  organization,
88
88
  dangerouslyAllowBrowser: true,
89
- baseUrl: fields?.baseUrl,
89
+ baseURL: fields?.baseUrl,
90
90
  };
91
91
  this.client = new OpenAIClient(clientConfig);
92
92
  this.model = fields?.model ?? fields?.modelName ?? this.model;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/openai",
3
- "version": "0.5.1",
3
+ "version": "0.5.3-dev.0",
4
4
  "description": "OpenAI integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {