objectiveai 1.1.0 → 1.1.1

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 (2) hide show
  1. package/dist/index.d.ts +85 -92
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -132,108 +132,85 @@ export declare namespace Chat {
132
132
  }
133
133
  }
134
134
  }
135
- type Message = Message.Developer | Message.System | Message.User | Message.Assistant | Message.Tool;
135
+ type Message = Message.Developer | Message.System | Message.User | Message.Assistant | Message.Tool | Message.ChatCompletion | Message.ScoreCompletion;
136
136
  namespace Message {
137
- interface Developer {
138
- role: "developer";
139
- content: Developer.Content;
140
- name?: string;
137
+ type SimpleContent = string | SimpleContentPart[];
138
+ interface SimpleContentPart {
139
+ text: string;
140
+ type: "text";
141
141
  }
142
- namespace Developer {
143
- type Content = string | Content.Part[];
144
- namespace Content {
145
- interface Part {
146
- text: string;
147
- type: "text";
142
+ type RichContent = string | RichContentPart[];
143
+ type RichContentPart = RichContentPart.Text | RichContentPart.ImageUrl | RichContentPart.InputAudio | RichContentPart.InputVideo | RichContentPart.File;
144
+ namespace RichContentPart {
145
+ interface Text {
146
+ text: string;
147
+ type: "text";
148
+ }
149
+ interface ImageUrl {
150
+ image_url: ImageUrl.Definition;
151
+ type: "image_url";
152
+ }
153
+ namespace ImageUrl {
154
+ interface Definition {
155
+ url: string;
156
+ detail?: ImageUrl.Detail | null;
157
+ }
158
+ type Detail = "auto" | "low" | "high";
159
+ }
160
+ interface InputAudio {
161
+ input_audio: InputAudio.Definition;
162
+ type: "input_audio";
163
+ }
164
+ namespace InputAudio {
165
+ interface Definition {
166
+ data: string;
167
+ format: Format;
168
+ }
169
+ type Format = "wav" | "mp3";
170
+ }
171
+ interface InputVideo {
172
+ video_url: InputVideo.Definition;
173
+ }
174
+ namespace InputVideo {
175
+ interface Definition {
176
+ url: string;
177
+ }
178
+ }
179
+ interface File {
180
+ file: File.Definition;
181
+ type: "file";
182
+ }
183
+ namespace File {
184
+ interface Definition {
185
+ file_data?: string | null;
186
+ file_id?: string | null;
187
+ filename?: string | null;
148
188
  }
149
189
  }
150
190
  }
191
+ interface Developer {
192
+ role: "developer";
193
+ content: SimpleContent;
194
+ name?: string;
195
+ }
151
196
  interface System {
152
197
  role: "system";
153
- content: System.Content;
198
+ content: SimpleContent;
154
199
  name?: string;
155
200
  }
156
- namespace System {
157
- type Content = string | Content.Part[];
158
- namespace Content {
159
- interface Part {
160
- text: string;
161
- type: "text";
162
- }
163
- }
164
- }
165
201
  interface User {
166
202
  role: "user";
167
- content: User.Content;
203
+ content: RichContent;
168
204
  name?: string;
169
205
  }
170
- namespace User {
171
- type Content = string | Content.Part[];
172
- namespace Content {
173
- type Part = Part.Text | Part.ImageUrl | Part.InputAudio | Part.File;
174
- namespace Part {
175
- interface Text {
176
- text: string;
177
- type: "text";
178
- }
179
- interface ImageUrl {
180
- image_url: ImageUrl.Definition;
181
- type: "image_url";
182
- }
183
- namespace ImageUrl {
184
- interface Definition {
185
- url: string;
186
- detail?: ImageUrl.Detail | null;
187
- }
188
- type Detail = "auto" | "low" | "high";
189
- }
190
- interface InputAudio {
191
- input_audio: InputAudio.Definition;
192
- type: "input_audio";
193
- }
194
- namespace InputAudio {
195
- interface Definition {
196
- data: string;
197
- format: Format;
198
- }
199
- type Format = "wav" | "mp3";
200
- }
201
- interface File {
202
- file: File.Definition;
203
- type: "file";
204
- }
205
- namespace File {
206
- interface Definition {
207
- file_data?: string | null;
208
- file_id?: string | null;
209
- filename?: string | null;
210
- }
211
- }
212
- }
213
- }
214
- }
215
206
  interface Assistant {
216
207
  role: "assistant";
217
- content?: Assistant.Content | null;
208
+ content?: RichContent | null;
218
209
  name?: string | null;
219
210
  refusal?: string | null;
220
211
  tool_calls?: Assistant.ToolCall[] | null;
221
212
  }
222
213
  namespace Assistant {
223
- type Content = string | Content.Part[];
224
- namespace Content {
225
- type Part = Part.Text | Part.Refusal;
226
- namespace Part {
227
- interface Text {
228
- text: string;
229
- type: "text";
230
- }
231
- interface Refusal {
232
- refusal: string;
233
- type: "refusal";
234
- }
235
- }
236
- }
237
214
  type ToolCall = ToolCall.Function;
238
215
  namespace ToolCall {
239
216
  interface Function {
@@ -251,17 +228,20 @@ export declare namespace Chat {
251
228
  }
252
229
  interface Tool {
253
230
  role: "tool";
254
- content?: Tool.Content | null;
231
+ content?: RichContent | null;
255
232
  tool_call_id: string;
256
233
  }
257
- namespace Tool {
258
- type Content = string | Content.Part[];
259
- namespace Content {
260
- interface Part {
261
- text: string;
262
- type: "text";
263
- }
264
- }
234
+ interface ChatCompletion {
235
+ role: "chat_completion";
236
+ id: string;
237
+ choice_index: number;
238
+ name?: string | null;
239
+ }
240
+ interface ScoreCompletion {
241
+ role: "score_completion";
242
+ id: string;
243
+ choice_index: number;
244
+ name?: string | null;
265
245
  }
266
246
  }
267
247
  interface ProviderPreferences {
@@ -514,7 +494,7 @@ export declare namespace Score {
514
494
  stream_options?: Chat.Completions.Request.StreamOptions | null;
515
495
  tools?: Chat.Completions.Request.Tool[] | null;
516
496
  usage?: Chat.Completions.Request.Usage | null;
517
- choices: string[];
497
+ choices: Choice[];
518
498
  }
519
499
  interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreateParamsBase {
520
500
  stream: true;
@@ -524,6 +504,19 @@ export declare namespace Score {
524
504
  }
525
505
  type ChatCompletionCreateParams = ChatCompletionCreateParamsStreaming | ChatCompletionCreateParamsNonStreaming;
526
506
  type Model = string | ScoreModelBase;
507
+ type Choice = string | Choice.ChatCompletion | Choice.ScoreCompletion;
508
+ namespace Choice {
509
+ interface ChatCompletion {
510
+ type: "chat_completion";
511
+ id: string;
512
+ choice_index: number;
513
+ }
514
+ interface ScoreCompletion {
515
+ type: "score_completion";
516
+ id: string;
517
+ choice_index: number;
518
+ }
519
+ }
527
520
  }
528
521
  namespace Response {
529
522
  namespace Streaming {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "objectiveai",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "SDK for the ObjectiveAI API.",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/ObjectiveAI/objectiveai-js.git"
8
+ "url": "git+https://github.com/ObjectiveAI/objectiveai-js.git"
9
9
  },
10
10
  "scripts": {
11
11
  "build": "rimraf dist && npm run build:cjs && npm run build:esm",