langchain 0.0.142 → 0.0.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat_models/openai.cjs +1 -0
- package/dist/chat_models/openai.js +1 -0
- package/dist/embeddings/openai.cjs +2 -1
- package/dist/embeddings/openai.js +2 -1
- package/dist/llms/openai-chat.cjs +1 -0
- package/dist/llms/openai-chat.js +1 -0
- package/dist/llms/openai.cjs +1 -0
- package/dist/llms/openai.js +1 -0
- package/package.json +1 -1
|
@@ -325,6 +325,7 @@ class ChatOpenAI extends base_js_1.BaseChatModel {
|
|
|
325
325
|
if (!this.azureOpenAIApiVersion) {
|
|
326
326
|
throw new Error("Azure OpenAI API version not found");
|
|
327
327
|
}
|
|
328
|
+
this.openAIApiKey = this.openAIApiKey ?? "";
|
|
328
329
|
}
|
|
329
330
|
this.clientConfig = {
|
|
330
331
|
apiKey: this.openAIApiKey,
|
|
@@ -322,6 +322,7 @@ export class ChatOpenAI extends BaseChatModel {
|
|
|
322
322
|
if (!this.azureOpenAIApiVersion) {
|
|
323
323
|
throw new Error("Azure OpenAI API version not found");
|
|
324
324
|
}
|
|
325
|
+
this.openAIApiKey = this.openAIApiKey ?? "";
|
|
325
326
|
}
|
|
326
327
|
this.clientConfig = {
|
|
327
328
|
apiKey: this.openAIApiKey,
|
|
@@ -82,7 +82,7 @@ class OpenAIEmbeddings extends base_js_1.Embeddings {
|
|
|
82
82
|
writable: true,
|
|
83
83
|
value: void 0
|
|
84
84
|
});
|
|
85
|
-
|
|
85
|
+
let apiKey = fieldsWithDefaults?.openAIApiKey ??
|
|
86
86
|
(0, env_js_1.getEnvironmentVariable)("OPENAI_API_KEY");
|
|
87
87
|
const azureApiKey = fieldsWithDefaults?.azureOpenAIApiKey ??
|
|
88
88
|
(0, env_js_1.getEnvironmentVariable)("AZURE_OPENAI_API_KEY");
|
|
@@ -120,6 +120,7 @@ class OpenAIEmbeddings extends base_js_1.Embeddings {
|
|
|
120
120
|
if (!this.azureOpenAIApiVersion) {
|
|
121
121
|
throw new Error("Azure OpenAI API version not found");
|
|
122
122
|
}
|
|
123
|
+
apiKey = apiKey ?? "";
|
|
123
124
|
}
|
|
124
125
|
this.clientConfig = {
|
|
125
126
|
apiKey,
|
|
@@ -79,7 +79,7 @@ export class OpenAIEmbeddings extends Embeddings {
|
|
|
79
79
|
writable: true,
|
|
80
80
|
value: void 0
|
|
81
81
|
});
|
|
82
|
-
|
|
82
|
+
let apiKey = fieldsWithDefaults?.openAIApiKey ??
|
|
83
83
|
getEnvironmentVariable("OPENAI_API_KEY");
|
|
84
84
|
const azureApiKey = fieldsWithDefaults?.azureOpenAIApiKey ??
|
|
85
85
|
getEnvironmentVariable("AZURE_OPENAI_API_KEY");
|
|
@@ -117,6 +117,7 @@ export class OpenAIEmbeddings extends Embeddings {
|
|
|
117
117
|
if (!this.azureOpenAIApiVersion) {
|
|
118
118
|
throw new Error("Azure OpenAI API version not found");
|
|
119
119
|
}
|
|
120
|
+
apiKey = apiKey ?? "";
|
|
120
121
|
}
|
|
121
122
|
this.clientConfig = {
|
|
122
123
|
apiKey,
|
|
@@ -258,6 +258,7 @@ class OpenAIChat extends base_js_1.LLM {
|
|
|
258
258
|
if (!this.azureOpenAIApiVersion) {
|
|
259
259
|
throw new Error("Azure OpenAI API version not found");
|
|
260
260
|
}
|
|
261
|
+
this.openAIApiKey = this.openAIApiKey ?? "";
|
|
261
262
|
}
|
|
262
263
|
this.clientConfig = {
|
|
263
264
|
apiKey: this.openAIApiKey,
|
package/dist/llms/openai-chat.js
CHANGED
package/dist/llms/openai.cjs
CHANGED
|
@@ -266,6 +266,7 @@ class OpenAI extends base_js_1.BaseLLM {
|
|
|
266
266
|
if (!this.azureOpenAIApiVersion) {
|
|
267
267
|
throw new Error("Azure OpenAI API version not found");
|
|
268
268
|
}
|
|
269
|
+
this.openAIApiKey = this.openAIApiKey ?? "";
|
|
269
270
|
}
|
|
270
271
|
this.clientConfig = {
|
|
271
272
|
apiKey: this.openAIApiKey,
|
package/dist/llms/openai.js
CHANGED