@celljs/ai-openai 3.6.3 → 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.
Files changed (43) hide show
  1. package/lib/common/api/chat-request.d.ts +2 -10
  2. package/lib/common/api/chat-request.d.ts.map +1 -1
  3. package/lib/common/api/chat-request.js +88 -9
  4. package/lib/common/api/chat-request.js.map +1 -1
  5. package/lib/common/api/chat-response.d.ts.map +1 -1
  6. package/lib/common/api/chat-response.js +69 -0
  7. package/lib/common/api/chat-response.js.map +1 -1
  8. package/lib/common/api/embeddings-request.d.ts.map +1 -1
  9. package/lib/common/api/embeddings-request.js +28 -0
  10. package/lib/common/api/embeddings-request.js.map +1 -1
  11. package/lib/common/api/embeddings-response.d.ts.map +1 -1
  12. package/lib/common/api/embeddings-response.js +10 -0
  13. package/lib/common/api/embeddings-response.js.map +1 -1
  14. package/lib/common/api/message.d.ts.map +1 -1
  15. package/lib/common/api/message.js +73 -0
  16. package/lib/common/api/message.js.map +1 -1
  17. package/lib/common/api/openai-api.js +3 -3
  18. package/lib/common/api/openai-api.js.map +1 -1
  19. package/lib/common/api/response-format.d.ts.map +1 -1
  20. package/lib/common/api/response-format.js +35 -0
  21. package/lib/common/api/response-format.js.map +1 -1
  22. package/lib/common/api/usage.d.ts.map +1 -1
  23. package/lib/common/api/usage.js +10 -0
  24. package/lib/common/api/usage.js.map +1 -1
  25. package/lib/common/model/openai-chat-model.js.map +1 -1
  26. package/lib/common/model/openai-chat-options.d.ts.map +1 -1
  27. package/lib/common/model/openai-chat-options.js +19 -0
  28. package/lib/common/model/openai-chat-options.js.map +1 -1
  29. package/lib/common/model/openai-embedding-options.d.ts.map +1 -1
  30. package/lib/common/model/openai-embedding-options.js +12 -0
  31. package/lib/common/model/openai-embedding-options.js.map +1 -1
  32. package/package.json +6 -6
  33. package/src/common/api/chat-request.ts +34 -10
  34. package/src/common/api/chat-response.ts +24 -0
  35. package/src/common/api/embeddings-request.ts +7 -0
  36. package/src/common/api/embeddings-response.ts +5 -1
  37. package/src/common/api/message.ts +19 -0
  38. package/src/common/api/openai-api.ts +3 -3
  39. package/src/common/api/response-format.ts +9 -0
  40. package/src/common/api/usage.ts +5 -1
  41. package/src/common/model/openai-chat-model.ts +5 -4
  42. package/src/common/model/openai-chat-options.ts +9 -1
  43. package/src/common/model/openai-embedding-options.ts +3 -0
@@ -1,5 +1,5 @@
1
1
  import { FunctionCallback, FunctionCallingOptions } from '@celljs/ai-core';
2
- import { Expose, Exclude } from 'class-transformer';
2
+ import { Expose, Exclude, Type } from 'class-transformer';
3
3
  import { OpenAIModel } from '../api/openai-model';
4
4
  import { Constant } from '@celljs/core';
5
5
  import { AudioParameters, FunctionTool, ResponseFormat, StreamOptions } from '../api';
@@ -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
  /**
@@ -96,12 +97,14 @@ export class OpenAIChatOptions implements FunctionCallingOptions {
96
97
  * An object specifying the format that the model must output. Setting to { "type":
97
98
  * "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON.
98
99
  */
100
+ @Type(() => ResponseFormat)
99
101
  @Expose({ name: 'response_format' })
100
102
  responseFormat?: ResponseFormat;
101
103
 
102
104
  /**
103
105
  * Options for streaming response. Included in the API only if streaming-mode completion is requested.
104
106
  */
107
+ @Type(() => StreamOptions)
105
108
  @Expose({ name: 'stream_options' })
106
109
  streamOptions?: StreamOptions;
107
110
 
@@ -109,17 +112,21 @@ export class OpenAIChatOptions implements FunctionCallingOptions {
109
112
  * This feature is in Beta. If specified, our system will make a best effort to sample
110
113
  * deterministically, such that repeated requests with the same seed and parameters should return the same result.
111
114
  */
115
+ @Expose()
112
116
  seed?: number;
113
117
 
114
118
  /**
115
119
  * Up to 4 sequences where the API will stop generating further tokens.
116
120
  */
121
+ @Expose()
117
122
  stop?: string[];
118
123
 
119
124
  /**
120
125
  * A list of tools the model may call. Currently, only functions are supported as a tool. Use this to
121
126
  * provide a list of functions the model may generate JSON inputs for.
122
127
  */
128
+ @Type(() => FunctionTool)
129
+ @Expose()
123
130
  tools?: FunctionTool[];
124
131
 
125
132
  /**
@@ -131,6 +138,7 @@ export class OpenAIChatOptions implements FunctionCallingOptions {
131
138
  /**
132
139
  * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
133
140
  */
141
+ @Expose()
134
142
  user?: string;
135
143
 
136
144
  /**
@@ -10,6 +10,7 @@ export class OpenAIEmbeddingOptions implements EmbeddingOptions {
10
10
  /**
11
11
  * ID of the model to use.
12
12
  */
13
+ @Expose()
13
14
  model?: string;
14
15
 
15
16
  /**
@@ -22,11 +23,13 @@ export class OpenAIEmbeddingOptions implements EmbeddingOptions {
22
23
  * The number of dimensions the resulting output embeddings should have.
23
24
  * Only supported in text-embedding-3 and later models.
24
25
  */
26
+ @Expose()
25
27
  dimensions?: number;
26
28
 
27
29
  /**
28
30
  * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
29
31
  */
32
+ @Expose()
30
33
  user?: string;
31
34
 
32
35
  copy(): OpenAIEmbeddingOptions {