@celljs/ai-openai 3.6.4 → 3.6.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ai-openai",
3
- "version": "3.6.4",
3
+ "version": "3.6.5",
4
4
  "description": "OpenAI models support",
5
5
  "keywords": [
6
6
  "cell-component"
@@ -29,18 +29,18 @@
29
29
  "watch": "cell-component watch"
30
30
  },
31
31
  "dependencies": {
32
- "@celljs/ai-core": "3.6.4",
33
- "@celljs/core": "3.6.4",
34
- "@celljs/http": "3.6.4",
32
+ "@celljs/ai-core": "3.6.5",
33
+ "@celljs/core": "3.6.5",
34
+ "@celljs/http": "3.6.5",
35
35
  "class-transformer": "^0.5.1",
36
36
  "rxjs": "^6.6.0",
37
37
  "tslib": "^2.8.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@celljs/component": "3.6.4"
40
+ "@celljs/component": "3.6.5"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "136649727fd8ca2c3c982dce6c5066805c88ac56"
45
+ "gitHead": "98e408d4578e5a0cade51e487e3d6b6a1876b5d8"
46
46
  }
@@ -258,7 +258,8 @@ export class OpenAIChatModel implements ChatModel {
258
258
 
259
259
  protected async internalCall(prompt: Prompt, previousChatResponse?: ChatResponse): Promise<ChatResponse> {
260
260
  const request = this.createRequest(prompt, false);
261
- const completionEntity = await this.chatApi.chat(request);
261
+ const httpHeaders = prompt.options?.httpHeaders;
262
+ const completionEntity = await this.chatApi.chat(request, httpHeaders);
262
263
  const chatCompletion = completionEntity.body;
263
264
  if (!chatCompletion) {
264
265
  this.logger.warn(`No chat completion returned for prompt: ${prompt}`);
@@ -322,8 +323,8 @@ export class OpenAIChatModel implements ChatModel {
322
323
  this.logger.warn('Audio parameters are not supported for streaming requests. Removing audio parameters.');
323
324
  throw new IllegalArgumentError('Audio parameters are not supported for streaming requests.');
324
325
  }
325
-
326
- const response = await this.chatApi.streamingChat(request);
326
+ const httpHeaders = prompt.options?.httpHeaders;
327
+ const response = await this.chatApi.streamingChat(request, httpHeaders);
327
328
 
328
329
  // For chunked responses, only the first chunk contains the choice role.
329
330
  // Subsequent chunks contain the choices.
@@ -83,6 +83,7 @@ export class OpenAIChatOptions implements FunctionCallingOptions {
83
83
  * Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities
84
84
  * of each output token returned in the 'content' of 'message'.
85
85
  */
86
+ @Expose()
86
87
  logprobs?: boolean;
87
88
 
88
89
  /**