@baseai/core
Advanced tools
Comparing version 0.9.42-snapshot.0 to 0.9.42
# `baseai` SDK | ||
## 0.9.42 | ||
### Patch Changes | ||
- 📦 NEW: LB-LLM-Key header support | ||
## 0.9.41 | ||
@@ -4,0 +10,0 @@ |
@@ -122,2 +122,3 @@ import { ChatCompletionStream } from 'openai/lib/ChatCompletionStream'; | ||
apiKey?: string; | ||
llmKey?: string; | ||
} | ||
@@ -171,2 +172,3 @@ interface RunOptionsStream extends RunOptions { | ||
private baseUrl; | ||
private entityApiKey?; | ||
constructor(options: PipeOptions); | ||
@@ -173,0 +175,0 @@ private getToolsFromPipe; |
@@ -236,5 +236,7 @@ "use strict"; | ||
}) { | ||
var _a; | ||
return { | ||
"Content-Type": "application/json", | ||
Authorization: `Bearer ${this.config.apiKey}`, | ||
"LB-LLM-Key": (_a = this.config.llmKey) != null ? _a : "", | ||
...headers | ||
@@ -847,2 +849,3 @@ }; | ||
this.pipe = options; | ||
this.entityApiKey = options.apiKey; | ||
delete this.pipe.prod; | ||
@@ -963,5 +966,13 @@ delete this.pipe.apiKey; | ||
apiKey: options.apiKey, | ||
baseUrl: this.baseUrl | ||
baseUrl: this.baseUrl, | ||
...options.llmKey && { llmKey: options.llmKey } || {} | ||
}); | ||
} | ||
if (options.llmKey && !options.apiKey) { | ||
this.request = new Request({ | ||
apiKey: this.entityApiKey, | ||
baseUrl: this.baseUrl, | ||
llmKey: options.llmKey | ||
}); | ||
} | ||
let stream = this.isStreamRequested(options); | ||
@@ -968,0 +979,0 @@ if (isAnthropic && hasTools && stream) { |
{ | ||
"name": "@baseai/core", | ||
"description": "The Web AI Framework's core - BaseAI.dev", | ||
"version": "0.9.42-snapshot.0", | ||
"version": "0.9.42", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "sideEffects": false, |
@@ -91,2 +91,3 @@ import { ChatCompletionStream } from 'openai/lib/ChatCompletionStream'; | ||
apiKey?: string; | ||
llmKey?: string; | ||
} | ||
@@ -140,2 +141,3 @@ interface RunOptionsStream extends RunOptions { | ||
private baseUrl; | ||
private entityApiKey?; | ||
constructor(options: PipeOptions); | ||
@@ -142,0 +144,0 @@ private getToolsFromPipe; |
@@ -227,5 +227,7 @@ "use strict"; | ||
}) { | ||
var _a; | ||
return { | ||
"Content-Type": "application/json", | ||
Authorization: `Bearer ${this.config.apiKey}`, | ||
"LB-LLM-Key": (_a = this.config.llmKey) != null ? _a : "", | ||
...headers | ||
@@ -838,2 +840,3 @@ }; | ||
this.pipe = options; | ||
this.entityApiKey = options.apiKey; | ||
delete this.pipe.prod; | ||
@@ -954,5 +957,13 @@ delete this.pipe.apiKey; | ||
apiKey: options.apiKey, | ||
baseUrl: this.baseUrl | ||
baseUrl: this.baseUrl, | ||
...options.llmKey && { llmKey: options.llmKey } || {} | ||
}); | ||
} | ||
if (options.llmKey && !options.apiKey) { | ||
this.request = new Request({ | ||
apiKey: this.entityApiKey, | ||
baseUrl: this.baseUrl, | ||
llmKey: options.llmKey | ||
}); | ||
} | ||
let stream = this.isStreamRequested(options); | ||
@@ -959,0 +970,0 @@ if (isAnthropic && hasTools && stream) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
484918
5715