@narrative.io/data-collaboration-sdk-ts 0.0.84 → 0.0.86

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/build/index.d.ts CHANGED
@@ -25,9 +25,9 @@ import { convertNqlObjectToForecastBody } from './nql/DataRulesConverter';
25
25
  import { AuthenticationApi, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse } from './authentication';
26
26
  import { AppsApi, type App } from './apps';
27
27
  import type { ForecastBody } from './nql/types';
28
- import { type ConversationMessageRole, isConversationMessageRole, type ConversationMessageName, isConversationMessageName, type ConversationUserMessage, isConversationUserMessage, type ConversationAssistantMessage, isConversationAssistantMessage, type ConversationSystemMessage, isConversationSystemMessage, type ConversationFunctionMessage, isConversationFunctionMessage, type ConversationMessage, isConversationMessage, type ConversationIOMessage, isConversationInputMessage, type ConversationMessages, isConversationMessages, isType, type RosettaMessageEvent, type RosettaResponseMessageEvent, type ConversationMessageFunctionCall, isConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithFunctionCall } from './rosetta/types';
28
+ import { type ConversationMessageRole, isConversationMessageRole, type ConversationMessageName, isConversationMessageName, type ConversationUserMessage, isConversationUserMessage, type ConversationAssistantMessage, isConversationAssistantMessage, type ConversationSystemMessage, isConversationSystemMessage, type ConversationFunctionMessage, isConversationFunctionMessage, type ConversationMessage, isConversationMessage, type ConversationIOMessage, isConversationInputMessage, type ConversationMessages, isConversationMessages, isType, type RosettaRequestMessage, isRosettaRequestMessage, type ConversationMessageFunctionCall, isConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithFunctionCall, type RosettaResponseMessage, type ConversationAssistantMessageWithoutFunctionCall, isConversationAssistantMessageWithoutFunctionCall } from './rosetta/types';
29
29
  declare class NarrativeApi extends BaseApi {
30
30
  }
31
31
  interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi {
32
32
  }
33
- export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, type App, type Resource, type UploadsResponse, type PingStatus, type Attribute, type RefAttribute, type SubAttribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type Nql, type NqlField, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlExpression, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type NqlFilterUnaryExpression, type DataStream, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse, type ForecastBody, type ConversationAssistantMessage, type ConversationFunctionMessage, type ConversationIOMessage, type ConversationMessage, type ConversationMessageName, type ConversationMessageRole, type ConversationMessages, type ConversationSystemMessage, type ConversationUserMessage, type RosettaMessageEvent, type RosettaResponseMessageEvent, type ConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall };
33
+ export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isRosettaRequestMessage, isConversationAssistantMessageWithoutFunctionCall, type App, type Resource, type UploadsResponse, type PingStatus, type Attribute, type RefAttribute, type SubAttribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type Nql, type NqlField, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlExpression, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type NqlFilterUnaryExpression, type DataStream, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse, type ForecastBody, type ConversationAssistantMessage, type ConversationFunctionMessage, type ConversationIOMessage, type ConversationMessage, type ConversationMessageName, type ConversationMessageRole, type ConversationMessages, type ConversationSystemMessage, type ConversationUserMessage, type RosettaRequestMessage, type ConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, type RosettaResponseMessage, type ConversationAssistantMessageWithoutFunctionCall };
package/build/index.js CHANGED
@@ -18,8 +18,8 @@ import { getNqlObject, buildNql } from './nql/NQLParser';
18
18
  import { convertNqlObjectToForecastBody } from './nql/DataRulesConverter';
19
19
  import { AuthenticationApi } from './authentication';
20
20
  import { AppsApi } from './apps';
21
- import { isConversationMessageRole, isConversationMessageName, isConversationUserMessage, isConversationAssistantMessage, isConversationSystemMessage, isConversationFunctionMessage, isConversationMessage, isConversationInputMessage, isConversationMessages, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall } from './rosetta/types';
21
+ import { isConversationMessageRole, isConversationMessageName, isConversationUserMessage, isConversationAssistantMessage, isConversationSystemMessage, isConversationFunctionMessage, isConversationMessage, isConversationInputMessage, isConversationMessages, isType, isRosettaRequestMessage, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithoutFunctionCall } from './rosetta/types';
22
22
  class NarrativeApi extends BaseApi {
23
23
  }
24
24
  applyMixins(NarrativeApi, [BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi]);
25
- export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall };
25
+ export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isRosettaRequestMessage, isConversationAssistantMessageWithoutFunctionCall };
@@ -10,16 +10,19 @@ declare const ChatCompletionRequestUserMessageSchema: z.ZodObject<{
10
10
  content: z.ZodString;
11
11
  name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
12
12
  timestamp: z.ZodOptional<z.ZodNumber>;
13
+ id: z.ZodOptional<z.ZodString>;
13
14
  }, "strip", z.ZodTypeAny, {
14
15
  role: "user";
15
16
  content: string;
16
17
  name?: string | undefined;
17
18
  timestamp?: number | undefined;
19
+ id?: string | undefined;
18
20
  }, {
19
21
  role: "user";
20
22
  content: string;
21
23
  name?: string | undefined;
22
24
  timestamp?: number | undefined;
25
+ id?: string | undefined;
23
26
  }>;
24
27
  type ConversationUserMessage = z.infer<typeof ChatCompletionRequestUserMessageSchema>;
25
28
  declare const isConversationUserMessage: (input: unknown) => input is {
@@ -27,6 +30,7 @@ declare const isConversationUserMessage: (input: unknown) => input is {
27
30
  content: string;
28
31
  name?: string | undefined;
29
32
  timestamp?: number | undefined;
33
+ id?: string | undefined;
30
34
  };
31
35
  declare const ChatCompletionRequestMessageFunctionCall: z.ZodObject<{
32
36
  name: z.ZodString;
@@ -57,6 +61,7 @@ declare const ChatCompletionRequestAssistantMessageWithFunctionCall: z.ZodObject
57
61
  arguments: string;
58
62
  }>;
59
63
  timestamp: z.ZodOptional<z.ZodNumber>;
64
+ id: z.ZodOptional<z.ZodString>;
60
65
  }, "strict", z.ZodTypeAny, {
61
66
  role: "assistant";
62
67
  content: string | null;
@@ -65,6 +70,7 @@ declare const ChatCompletionRequestAssistantMessageWithFunctionCall: z.ZodObject
65
70
  arguments: string;
66
71
  };
67
72
  timestamp?: number | undefined;
73
+ id?: string | undefined;
68
74
  }, {
69
75
  role: "assistant";
70
76
  content: string | null;
@@ -73,6 +79,7 @@ declare const ChatCompletionRequestAssistantMessageWithFunctionCall: z.ZodObject
73
79
  arguments: string;
74
80
  };
75
81
  timestamp?: number | undefined;
82
+ id?: string | undefined;
76
83
  }>;
77
84
  type ConversationAssistantMessageWithFunctionCall = z.infer<typeof ChatCompletionRequestAssistantMessageWithFunctionCall>;
78
85
  declare const isConversationAssistantMessageWithFunctionCall: (input: unknown) => input is {
@@ -83,19 +90,46 @@ declare const isConversationAssistantMessageWithFunctionCall: (input: unknown) =
83
90
  arguments: string;
84
91
  };
85
92
  timestamp?: number | undefined;
93
+ id?: string | undefined;
94
+ };
95
+ declare const ChatCompletionRequestAssistantMessageWihtoutFunctionCall: z.ZodObject<{
96
+ role: z.ZodEnum<["assistant"]>;
97
+ content: z.ZodString;
98
+ timestamp: z.ZodOptional<z.ZodNumber>;
99
+ id: z.ZodOptional<z.ZodString>;
100
+ }, "strict", z.ZodTypeAny, {
101
+ role: "assistant";
102
+ content: string;
103
+ timestamp?: number | undefined;
104
+ id?: string | undefined;
105
+ }, {
106
+ role: "assistant";
107
+ content: string;
108
+ timestamp?: number | undefined;
109
+ id?: string | undefined;
110
+ }>;
111
+ type ConversationAssistantMessageWithoutFunctionCall = z.infer<typeof ChatCompletionRequestAssistantMessageWihtoutFunctionCall>;
112
+ declare const isConversationAssistantMessageWithoutFunctionCall: (input: unknown) => input is {
113
+ role: "assistant";
114
+ content: string;
115
+ timestamp?: number | undefined;
116
+ id?: string | undefined;
86
117
  };
87
118
  declare const ChatCompletionAssistantMessage: z.ZodUnion<[z.ZodObject<{
88
119
  role: z.ZodEnum<["assistant"]>;
89
120
  content: z.ZodString;
90
121
  timestamp: z.ZodOptional<z.ZodNumber>;
122
+ id: z.ZodOptional<z.ZodString>;
91
123
  }, "strict", z.ZodTypeAny, {
92
124
  role: "assistant";
93
125
  content: string;
94
126
  timestamp?: number | undefined;
127
+ id?: string | undefined;
95
128
  }, {
96
129
  role: "assistant";
97
130
  content: string;
98
131
  timestamp?: number | undefined;
132
+ id?: string | undefined;
99
133
  }>, z.ZodObject<{
100
134
  role: z.ZodEnum<["assistant"]>;
101
135
  content: z.ZodUnion<[z.ZodNull, z.ZodString]>;
@@ -110,6 +144,7 @@ declare const ChatCompletionAssistantMessage: z.ZodUnion<[z.ZodObject<{
110
144
  arguments: string;
111
145
  }>;
112
146
  timestamp: z.ZodOptional<z.ZodNumber>;
147
+ id: z.ZodOptional<z.ZodString>;
113
148
  }, "strict", z.ZodTypeAny, {
114
149
  role: "assistant";
115
150
  content: string | null;
@@ -118,6 +153,7 @@ declare const ChatCompletionAssistantMessage: z.ZodUnion<[z.ZodObject<{
118
153
  arguments: string;
119
154
  };
120
155
  timestamp?: number | undefined;
156
+ id?: string | undefined;
121
157
  }, {
122
158
  role: "assistant";
123
159
  content: string | null;
@@ -126,6 +162,7 @@ declare const ChatCompletionAssistantMessage: z.ZodUnion<[z.ZodObject<{
126
162
  arguments: string;
127
163
  };
128
164
  timestamp?: number | undefined;
165
+ id?: string | undefined;
129
166
  }>]>;
130
167
  type ConversationAssistantMessage = z.infer<typeof ChatCompletionAssistantMessage>;
131
168
  declare const isConversationAssistantMessage: (input: unknown) => input is {
@@ -136,10 +173,12 @@ declare const isConversationAssistantMessage: (input: unknown) => input is {
136
173
  arguments: string;
137
174
  };
138
175
  timestamp?: number | undefined;
176
+ id?: string | undefined;
139
177
  } | {
140
178
  role: "assistant";
141
179
  content: string;
142
180
  timestamp?: number | undefined;
181
+ id?: string | undefined;
143
182
  };
144
183
  declare const ChatCompletionSystemMessageSchema: z.ZodObject<{
145
184
  role: z.ZodEnum<["system"]>;
@@ -161,16 +200,19 @@ declare const ChatCompletionFunctionMessageSchema: z.ZodObject<{
161
200
  content: z.ZodString;
162
201
  name: z.ZodString;
163
202
  timestamp: z.ZodOptional<z.ZodNumber>;
203
+ id: z.ZodOptional<z.ZodString>;
164
204
  }, "strip", z.ZodTypeAny, {
165
205
  name: string;
166
206
  role: "function";
167
207
  content: string;
168
208
  timestamp?: number | undefined;
209
+ id?: string | undefined;
169
210
  }, {
170
211
  name: string;
171
212
  role: "function";
172
213
  content: string;
173
214
  timestamp?: number | undefined;
215
+ id?: string | undefined;
174
216
  }>;
175
217
  type ConversationFunctionMessage = z.infer<typeof ChatCompletionFunctionMessageSchema>;
176
218
  declare const isConversationFunctionMessage: (input: unknown) => input is {
@@ -178,34 +220,41 @@ declare const isConversationFunctionMessage: (input: unknown) => input is {
178
220
  role: "function";
179
221
  content: string;
180
222
  timestamp?: number | undefined;
223
+ id?: string | undefined;
181
224
  };
182
225
  declare const ChatCompletionRequestMessageSchema: z.ZodUnion<[z.ZodObject<{
183
226
  role: z.ZodEnum<["user"]>;
184
227
  content: z.ZodString;
185
228
  name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
186
229
  timestamp: z.ZodOptional<z.ZodNumber>;
230
+ id: z.ZodOptional<z.ZodString>;
187
231
  }, "strip", z.ZodTypeAny, {
188
232
  role: "user";
189
233
  content: string;
190
234
  name?: string | undefined;
191
235
  timestamp?: number | undefined;
236
+ id?: string | undefined;
192
237
  }, {
193
238
  role: "user";
194
239
  content: string;
195
240
  name?: string | undefined;
196
241
  timestamp?: number | undefined;
242
+ id?: string | undefined;
197
243
  }>, z.ZodUnion<[z.ZodObject<{
198
244
  role: z.ZodEnum<["assistant"]>;
199
245
  content: z.ZodString;
200
246
  timestamp: z.ZodOptional<z.ZodNumber>;
247
+ id: z.ZodOptional<z.ZodString>;
201
248
  }, "strict", z.ZodTypeAny, {
202
249
  role: "assistant";
203
250
  content: string;
204
251
  timestamp?: number | undefined;
252
+ id?: string | undefined;
205
253
  }, {
206
254
  role: "assistant";
207
255
  content: string;
208
256
  timestamp?: number | undefined;
257
+ id?: string | undefined;
209
258
  }>, z.ZodObject<{
210
259
  role: z.ZodEnum<["assistant"]>;
211
260
  content: z.ZodUnion<[z.ZodNull, z.ZodString]>;
@@ -220,6 +269,7 @@ declare const ChatCompletionRequestMessageSchema: z.ZodUnion<[z.ZodObject<{
220
269
  arguments: string;
221
270
  }>;
222
271
  timestamp: z.ZodOptional<z.ZodNumber>;
272
+ id: z.ZodOptional<z.ZodString>;
223
273
  }, "strict", z.ZodTypeAny, {
224
274
  role: "assistant";
225
275
  content: string | null;
@@ -228,6 +278,7 @@ declare const ChatCompletionRequestMessageSchema: z.ZodUnion<[z.ZodObject<{
228
278
  arguments: string;
229
279
  };
230
280
  timestamp?: number | undefined;
281
+ id?: string | undefined;
231
282
  }, {
232
283
  role: "assistant";
233
284
  content: string | null;
@@ -236,6 +287,7 @@ declare const ChatCompletionRequestMessageSchema: z.ZodUnion<[z.ZodObject<{
236
287
  arguments: string;
237
288
  };
238
289
  timestamp?: number | undefined;
290
+ id?: string | undefined;
239
291
  }>]>, z.ZodObject<{
240
292
  role: z.ZodEnum<["system"]>;
241
293
  content: z.ZodString;
@@ -250,16 +302,19 @@ declare const ChatCompletionRequestMessageSchema: z.ZodUnion<[z.ZodObject<{
250
302
  content: z.ZodString;
251
303
  name: z.ZodString;
252
304
  timestamp: z.ZodOptional<z.ZodNumber>;
305
+ id: z.ZodOptional<z.ZodString>;
253
306
  }, "strip", z.ZodTypeAny, {
254
307
  name: string;
255
308
  role: "function";
256
309
  content: string;
257
310
  timestamp?: number | undefined;
311
+ id?: string | undefined;
258
312
  }, {
259
313
  name: string;
260
314
  role: "function";
261
315
  content: string;
262
316
  timestamp?: number | undefined;
317
+ id?: string | undefined;
263
318
  }>]>;
264
319
  type ConversationMessage = z.infer<typeof ChatCompletionRequestMessageSchema>;
265
320
  declare const isConversationMessage: (input: unknown) => input is {
@@ -267,6 +322,7 @@ declare const isConversationMessage: (input: unknown) => input is {
267
322
  content: string;
268
323
  name?: string | undefined;
269
324
  timestamp?: number | undefined;
325
+ id?: string | undefined;
270
326
  } | {
271
327
  role: "assistant";
272
328
  content: string | null;
@@ -275,10 +331,12 @@ declare const isConversationMessage: (input: unknown) => input is {
275
331
  arguments: string;
276
332
  };
277
333
  timestamp?: number | undefined;
334
+ id?: string | undefined;
278
335
  } | {
279
336
  role: "assistant";
280
337
  content: string;
281
338
  timestamp?: number | undefined;
339
+ id?: string | undefined;
282
340
  } | {
283
341
  role: "system";
284
342
  content: string;
@@ -287,34 +345,41 @@ declare const isConversationMessage: (input: unknown) => input is {
287
345
  role: "function";
288
346
  content: string;
289
347
  timestamp?: number | undefined;
348
+ id?: string | undefined;
290
349
  };
291
350
  declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodObject<{
292
351
  role: z.ZodEnum<["user"]>;
293
352
  content: z.ZodString;
294
353
  name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
295
354
  timestamp: z.ZodOptional<z.ZodNumber>;
355
+ id: z.ZodOptional<z.ZodString>;
296
356
  }, "strip", z.ZodTypeAny, {
297
357
  role: "user";
298
358
  content: string;
299
359
  name?: string | undefined;
300
360
  timestamp?: number | undefined;
361
+ id?: string | undefined;
301
362
  }, {
302
363
  role: "user";
303
364
  content: string;
304
365
  name?: string | undefined;
305
366
  timestamp?: number | undefined;
367
+ id?: string | undefined;
306
368
  }>, z.ZodUnion<[z.ZodObject<{
307
369
  role: z.ZodEnum<["assistant"]>;
308
370
  content: z.ZodString;
309
371
  timestamp: z.ZodOptional<z.ZodNumber>;
372
+ id: z.ZodOptional<z.ZodString>;
310
373
  }, "strict", z.ZodTypeAny, {
311
374
  role: "assistant";
312
375
  content: string;
313
376
  timestamp?: number | undefined;
377
+ id?: string | undefined;
314
378
  }, {
315
379
  role: "assistant";
316
380
  content: string;
317
381
  timestamp?: number | undefined;
382
+ id?: string | undefined;
318
383
  }>, z.ZodObject<{
319
384
  role: z.ZodEnum<["assistant"]>;
320
385
  content: z.ZodUnion<[z.ZodNull, z.ZodString]>;
@@ -329,6 +394,7 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
329
394
  arguments: string;
330
395
  }>;
331
396
  timestamp: z.ZodOptional<z.ZodNumber>;
397
+ id: z.ZodOptional<z.ZodString>;
332
398
  }, "strict", z.ZodTypeAny, {
333
399
  role: "assistant";
334
400
  content: string | null;
@@ -337,6 +403,7 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
337
403
  arguments: string;
338
404
  };
339
405
  timestamp?: number | undefined;
406
+ id?: string | undefined;
340
407
  }, {
341
408
  role: "assistant";
342
409
  content: string | null;
@@ -345,6 +412,7 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
345
412
  arguments: string;
346
413
  };
347
414
  timestamp?: number | undefined;
415
+ id?: string | undefined;
348
416
  }>]>, z.ZodObject<{
349
417
  role: z.ZodEnum<["system"]>;
350
418
  content: z.ZodString;
@@ -359,21 +427,25 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
359
427
  content: z.ZodString;
360
428
  name: z.ZodString;
361
429
  timestamp: z.ZodOptional<z.ZodNumber>;
430
+ id: z.ZodOptional<z.ZodString>;
362
431
  }, "strip", z.ZodTypeAny, {
363
432
  name: string;
364
433
  role: "function";
365
434
  content: string;
366
435
  timestamp?: number | undefined;
436
+ id?: string | undefined;
367
437
  }, {
368
438
  name: string;
369
439
  role: "function";
370
440
  content: string;
371
441
  timestamp?: number | undefined;
442
+ id?: string | undefined;
372
443
  }>]>, "many">, ({
373
444
  role: "user";
374
445
  content: string;
375
446
  name?: string | undefined;
376
447
  timestamp?: number | undefined;
448
+ id?: string | undefined;
377
449
  } | {
378
450
  role: "assistant";
379
451
  content: string | null;
@@ -382,10 +454,12 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
382
454
  arguments: string;
383
455
  };
384
456
  timestamp?: number | undefined;
457
+ id?: string | undefined;
385
458
  } | {
386
459
  role: "assistant";
387
460
  content: string;
388
461
  timestamp?: number | undefined;
462
+ id?: string | undefined;
389
463
  } | {
390
464
  role: "system";
391
465
  content: string;
@@ -394,11 +468,13 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
394
468
  role: "function";
395
469
  content: string;
396
470
  timestamp?: number | undefined;
471
+ id?: string | undefined;
397
472
  })[], ({
398
473
  role: "user";
399
474
  content: string;
400
475
  name?: string | undefined;
401
476
  timestamp?: number | undefined;
477
+ id?: string | undefined;
402
478
  } | {
403
479
  role: "assistant";
404
480
  content: string | null;
@@ -407,10 +483,12 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
407
483
  arguments: string;
408
484
  };
409
485
  timestamp?: number | undefined;
486
+ id?: string | undefined;
410
487
  } | {
411
488
  role: "assistant";
412
489
  content: string;
413
490
  timestamp?: number | undefined;
491
+ id?: string | undefined;
414
492
  } | {
415
493
  role: "system";
416
494
  content: string;
@@ -419,11 +497,13 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
419
497
  role: "function";
420
498
  content: string;
421
499
  timestamp?: number | undefined;
500
+ id?: string | undefined;
422
501
  })[]>, ({
423
502
  role: "user";
424
503
  content: string;
425
504
  name?: string | undefined;
426
505
  timestamp?: number | undefined;
506
+ id?: string | undefined;
427
507
  } | {
428
508
  role: "assistant";
429
509
  content: string | null;
@@ -432,10 +512,12 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
432
512
  arguments: string;
433
513
  };
434
514
  timestamp?: number | undefined;
515
+ id?: string | undefined;
435
516
  } | {
436
517
  role: "assistant";
437
518
  content: string;
438
519
  timestamp?: number | undefined;
520
+ id?: string | undefined;
439
521
  } | {
440
522
  role: "system";
441
523
  content: string;
@@ -444,11 +526,13 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
444
526
  role: "function";
445
527
  content: string;
446
528
  timestamp?: number | undefined;
529
+ id?: string | undefined;
447
530
  })[], ({
448
531
  role: "user";
449
532
  content: string;
450
533
  name?: string | undefined;
451
534
  timestamp?: number | undefined;
535
+ id?: string | undefined;
452
536
  } | {
453
537
  role: "assistant";
454
538
  content: string | null;
@@ -457,10 +541,12 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
457
541
  arguments: string;
458
542
  };
459
543
  timestamp?: number | undefined;
544
+ id?: string | undefined;
460
545
  } | {
461
546
  role: "assistant";
462
547
  content: string;
463
548
  timestamp?: number | undefined;
549
+ id?: string | undefined;
464
550
  } | {
465
551
  role: "system";
466
552
  content: string;
@@ -469,11 +555,13 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
469
555
  role: "function";
470
556
  content: string;
471
557
  timestamp?: number | undefined;
558
+ id?: string | undefined;
472
559
  })[]>, ({
473
560
  role: "user";
474
561
  content: string;
475
562
  name?: string | undefined;
476
563
  timestamp?: number | undefined;
564
+ id?: string | undefined;
477
565
  } | {
478
566
  role: "assistant";
479
567
  content: string | null;
@@ -482,10 +570,12 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
482
570
  arguments: string;
483
571
  };
484
572
  timestamp?: number | undefined;
573
+ id?: string | undefined;
485
574
  } | {
486
575
  role: "assistant";
487
576
  content: string;
488
577
  timestamp?: number | undefined;
578
+ id?: string | undefined;
489
579
  } | {
490
580
  role: "system";
491
581
  content: string;
@@ -494,11 +584,13 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
494
584
  role: "function";
495
585
  content: string;
496
586
  timestamp?: number | undefined;
587
+ id?: string | undefined;
497
588
  })[], ({
498
589
  role: "user";
499
590
  content: string;
500
591
  name?: string | undefined;
501
592
  timestamp?: number | undefined;
593
+ id?: string | undefined;
502
594
  } | {
503
595
  role: "assistant";
504
596
  content: string | null;
@@ -507,10 +599,12 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
507
599
  arguments: string;
508
600
  };
509
601
  timestamp?: number | undefined;
602
+ id?: string | undefined;
510
603
  } | {
511
604
  role: "assistant";
512
605
  content: string;
513
606
  timestamp?: number | undefined;
607
+ id?: string | undefined;
514
608
  } | {
515
609
  role: "system";
516
610
  content: string;
@@ -519,11 +613,13 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
519
613
  role: "function";
520
614
  content: string;
521
615
  timestamp?: number | undefined;
616
+ id?: string | undefined;
522
617
  })[]>, ({
523
618
  role: "user";
524
619
  content: string;
525
620
  name?: string | undefined;
526
621
  timestamp?: number | undefined;
622
+ id?: string | undefined;
527
623
  } | {
528
624
  role: "assistant";
529
625
  content: string | null;
@@ -532,10 +628,12 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
532
628
  arguments: string;
533
629
  };
534
630
  timestamp?: number | undefined;
631
+ id?: string | undefined;
535
632
  } | {
536
633
  role: "assistant";
537
634
  content: string;
538
635
  timestamp?: number | undefined;
636
+ id?: string | undefined;
539
637
  } | {
540
638
  role: "system";
541
639
  content: string;
@@ -544,11 +642,13 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
544
642
  role: "function";
545
643
  content: string;
546
644
  timestamp?: number | undefined;
645
+ id?: string | undefined;
547
646
  })[], ({
548
647
  role: "user";
549
648
  content: string;
550
649
  name?: string | undefined;
551
650
  timestamp?: number | undefined;
651
+ id?: string | undefined;
552
652
  } | {
553
653
  role: "assistant";
554
654
  content: string | null;
@@ -557,10 +657,12 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
557
657
  arguments: string;
558
658
  };
559
659
  timestamp?: number | undefined;
660
+ id?: string | undefined;
560
661
  } | {
561
662
  role: "assistant";
562
663
  content: string;
563
664
  timestamp?: number | undefined;
665
+ id?: string | undefined;
564
666
  } | {
565
667
  role: "system";
566
668
  content: string;
@@ -569,6 +671,7 @@ declare const ChatCompletionRequestMessagesSchema: z.ZodEffects<z.ZodEffects<z.Z
569
671
  role: "function";
570
672
  content: string;
571
673
  timestamp?: number | undefined;
674
+ id?: string | undefined;
572
675
  })[]>;
573
676
  type ConversationMessages = z.infer<typeof ChatCompletionRequestMessagesSchema>;
574
677
  declare const isConversationMessages: (input: unknown) => input is ({
@@ -576,6 +679,7 @@ declare const isConversationMessages: (input: unknown) => input is ({
576
679
  content: string;
577
680
  name?: string | undefined;
578
681
  timestamp?: number | undefined;
682
+ id?: string | undefined;
579
683
  } | {
580
684
  role: "assistant";
581
685
  content: string | null;
@@ -584,10 +688,12 @@ declare const isConversationMessages: (input: unknown) => input is ({
584
688
  arguments: string;
585
689
  };
586
690
  timestamp?: number | undefined;
691
+ id?: string | undefined;
587
692
  } | {
588
693
  role: "assistant";
589
694
  content: string;
590
695
  timestamp?: number | undefined;
696
+ id?: string | undefined;
591
697
  } | {
592
698
  role: "system";
593
699
  content: string;
@@ -596,34 +702,41 @@ declare const isConversationMessages: (input: unknown) => input is ({
596
702
  role: "function";
597
703
  content: string;
598
704
  timestamp?: number | undefined;
705
+ id?: string | undefined;
599
706
  })[];
600
707
  declare const ChatCompletionRequestInputMessageSchema: z.ZodUnion<[z.ZodObject<{
601
708
  role: z.ZodEnum<["user"]>;
602
709
  content: z.ZodString;
603
710
  name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
604
711
  timestamp: z.ZodOptional<z.ZodNumber>;
712
+ id: z.ZodOptional<z.ZodString>;
605
713
  }, "strip", z.ZodTypeAny, {
606
714
  role: "user";
607
715
  content: string;
608
716
  name?: string | undefined;
609
717
  timestamp?: number | undefined;
718
+ id?: string | undefined;
610
719
  }, {
611
720
  role: "user";
612
721
  content: string;
613
722
  name?: string | undefined;
614
723
  timestamp?: number | undefined;
724
+ id?: string | undefined;
615
725
  }>, z.ZodUnion<[z.ZodObject<{
616
726
  role: z.ZodEnum<["assistant"]>;
617
727
  content: z.ZodString;
618
728
  timestamp: z.ZodOptional<z.ZodNumber>;
729
+ id: z.ZodOptional<z.ZodString>;
619
730
  }, "strict", z.ZodTypeAny, {
620
731
  role: "assistant";
621
732
  content: string;
622
733
  timestamp?: number | undefined;
734
+ id?: string | undefined;
623
735
  }, {
624
736
  role: "assistant";
625
737
  content: string;
626
738
  timestamp?: number | undefined;
739
+ id?: string | undefined;
627
740
  }>, z.ZodObject<{
628
741
  role: z.ZodEnum<["assistant"]>;
629
742
  content: z.ZodUnion<[z.ZodNull, z.ZodString]>;
@@ -638,6 +751,7 @@ declare const ChatCompletionRequestInputMessageSchema: z.ZodUnion<[z.ZodObject<{
638
751
  arguments: string;
639
752
  }>;
640
753
  timestamp: z.ZodOptional<z.ZodNumber>;
754
+ id: z.ZodOptional<z.ZodString>;
641
755
  }, "strict", z.ZodTypeAny, {
642
756
  role: "assistant";
643
757
  content: string | null;
@@ -646,6 +760,7 @@ declare const ChatCompletionRequestInputMessageSchema: z.ZodUnion<[z.ZodObject<{
646
760
  arguments: string;
647
761
  };
648
762
  timestamp?: number | undefined;
763
+ id?: string | undefined;
649
764
  }, {
650
765
  role: "assistant";
651
766
  content: string | null;
@@ -654,21 +769,25 @@ declare const ChatCompletionRequestInputMessageSchema: z.ZodUnion<[z.ZodObject<{
654
769
  arguments: string;
655
770
  };
656
771
  timestamp?: number | undefined;
772
+ id?: string | undefined;
657
773
  }>]>, z.ZodObject<{
658
774
  role: z.ZodEnum<["function"]>;
659
775
  content: z.ZodString;
660
776
  name: z.ZodString;
661
777
  timestamp: z.ZodOptional<z.ZodNumber>;
778
+ id: z.ZodOptional<z.ZodString>;
662
779
  }, "strip", z.ZodTypeAny, {
663
780
  name: string;
664
781
  role: "function";
665
782
  content: string;
666
783
  timestamp?: number | undefined;
784
+ id?: string | undefined;
667
785
  }, {
668
786
  name: string;
669
787
  role: "function";
670
788
  content: string;
671
789
  timestamp?: number | undefined;
790
+ id?: string | undefined;
672
791
  }>]>;
673
792
  type ConversationIOMessage = z.infer<typeof ChatCompletionRequestInputMessageSchema>;
674
793
  declare const isConversationInputMessage: (input: unknown) => input is {
@@ -676,6 +795,7 @@ declare const isConversationInputMessage: (input: unknown) => input is {
676
795
  content: string;
677
796
  name?: string | undefined;
678
797
  timestamp?: number | undefined;
798
+ id?: string | undefined;
679
799
  } | {
680
800
  role: "assistant";
681
801
  content: string | null;
@@ -684,50 +804,350 @@ declare const isConversationInputMessage: (input: unknown) => input is {
684
804
  arguments: string;
685
805
  };
686
806
  timestamp?: number | undefined;
807
+ id?: string | undefined;
687
808
  } | {
688
809
  role: "assistant";
689
810
  content: string;
690
811
  timestamp?: number | undefined;
812
+ id?: string | undefined;
691
813
  } | {
692
814
  name: string;
693
815
  role: "function";
694
816
  content: string;
695
817
  timestamp?: number | undefined;
818
+ id?: string | undefined;
819
+ };
820
+ declare const RosettaRequestMessageSchema: z.ZodUnion<[z.ZodObject<{
821
+ type: z.ZodLiteral<"addMessage">;
822
+ data: z.ZodUnion<[z.ZodObject<{
823
+ role: z.ZodEnum<["user"]>;
824
+ content: z.ZodString;
825
+ name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
826
+ timestamp: z.ZodOptional<z.ZodNumber>;
827
+ id: z.ZodOptional<z.ZodString>;
828
+ }, "strip", z.ZodTypeAny, {
829
+ role: "user";
830
+ content: string;
831
+ name?: string | undefined;
832
+ timestamp?: number | undefined;
833
+ id?: string | undefined;
834
+ }, {
835
+ role: "user";
836
+ content: string;
837
+ name?: string | undefined;
838
+ timestamp?: number | undefined;
839
+ id?: string | undefined;
840
+ }>, z.ZodUnion<[z.ZodObject<{
841
+ role: z.ZodEnum<["assistant"]>;
842
+ content: z.ZodString;
843
+ timestamp: z.ZodOptional<z.ZodNumber>;
844
+ id: z.ZodOptional<z.ZodString>;
845
+ }, "strict", z.ZodTypeAny, {
846
+ role: "assistant";
847
+ content: string;
848
+ timestamp?: number | undefined;
849
+ id?: string | undefined;
850
+ }, {
851
+ role: "assistant";
852
+ content: string;
853
+ timestamp?: number | undefined;
854
+ id?: string | undefined;
855
+ }>, z.ZodObject<{
856
+ role: z.ZodEnum<["assistant"]>;
857
+ content: z.ZodUnion<[z.ZodNull, z.ZodString]>;
858
+ function_call: z.ZodObject<{
859
+ name: z.ZodString;
860
+ arguments: z.ZodString;
861
+ }, "strip", z.ZodTypeAny, {
862
+ name: string;
863
+ arguments: string;
864
+ }, {
865
+ name: string;
866
+ arguments: string;
867
+ }>;
868
+ timestamp: z.ZodOptional<z.ZodNumber>;
869
+ id: z.ZodOptional<z.ZodString>;
870
+ }, "strict", z.ZodTypeAny, {
871
+ role: "assistant";
872
+ content: string | null;
873
+ function_call: {
874
+ name: string;
875
+ arguments: string;
876
+ };
877
+ timestamp?: number | undefined;
878
+ id?: string | undefined;
879
+ }, {
880
+ role: "assistant";
881
+ content: string | null;
882
+ function_call: {
883
+ name: string;
884
+ arguments: string;
885
+ };
886
+ timestamp?: number | undefined;
887
+ id?: string | undefined;
888
+ }>]>, z.ZodObject<{
889
+ role: z.ZodEnum<["function"]>;
890
+ content: z.ZodString;
891
+ name: z.ZodString;
892
+ timestamp: z.ZodOptional<z.ZodNumber>;
893
+ id: z.ZodOptional<z.ZodString>;
894
+ }, "strip", z.ZodTypeAny, {
895
+ name: string;
896
+ role: "function";
897
+ content: string;
898
+ timestamp?: number | undefined;
899
+ id?: string | undefined;
900
+ }, {
901
+ name: string;
902
+ role: "function";
903
+ content: string;
904
+ timestamp?: number | undefined;
905
+ id?: string | undefined;
906
+ }>]>;
907
+ }, "strip", z.ZodTypeAny, {
908
+ type: "addMessage";
909
+ data: {
910
+ role: "user";
911
+ content: string;
912
+ name?: string | undefined;
913
+ timestamp?: number | undefined;
914
+ id?: string | undefined;
915
+ } | {
916
+ role: "assistant";
917
+ content: string | null;
918
+ function_call: {
919
+ name: string;
920
+ arguments: string;
921
+ };
922
+ timestamp?: number | undefined;
923
+ id?: string | undefined;
924
+ } | {
925
+ role: "assistant";
926
+ content: string;
927
+ timestamp?: number | undefined;
928
+ id?: string | undefined;
929
+ } | {
930
+ name: string;
931
+ role: "function";
932
+ content: string;
933
+ timestamp?: number | undefined;
934
+ id?: string | undefined;
935
+ } | ({
936
+ role: "assistant";
937
+ content: string | null;
938
+ function_call: {
939
+ name: string;
940
+ arguments: string;
941
+ };
942
+ timestamp?: number | undefined;
943
+ id?: string | undefined;
944
+ } & {
945
+ role: "assistant";
946
+ content: string;
947
+ timestamp?: number | undefined;
948
+ id?: string | undefined;
949
+ }) | ({
950
+ role: "assistant";
951
+ content: string;
952
+ timestamp?: number | undefined;
953
+ id?: string | undefined;
954
+ } & {
955
+ role: "assistant";
956
+ content: string | null;
957
+ function_call: {
958
+ name: string;
959
+ arguments: string;
960
+ };
961
+ timestamp?: number | undefined;
962
+ id?: string | undefined;
963
+ });
964
+ }, {
965
+ type: "addMessage";
966
+ data: {
967
+ role: "user";
968
+ content: string;
969
+ name?: string | undefined;
970
+ timestamp?: number | undefined;
971
+ id?: string | undefined;
972
+ } | {
973
+ role: "assistant";
974
+ content: string | null;
975
+ function_call: {
976
+ name: string;
977
+ arguments: string;
978
+ };
979
+ timestamp?: number | undefined;
980
+ id?: string | undefined;
981
+ } | {
982
+ role: "assistant";
983
+ content: string;
984
+ timestamp?: number | undefined;
985
+ id?: string | undefined;
986
+ } | {
987
+ name: string;
988
+ role: "function";
989
+ content: string;
990
+ timestamp?: number | undefined;
991
+ id?: string | undefined;
992
+ } | ({
993
+ role: "assistant";
994
+ content: string | null;
995
+ function_call: {
996
+ name: string;
997
+ arguments: string;
998
+ };
999
+ timestamp?: number | undefined;
1000
+ id?: string | undefined;
1001
+ } & {
1002
+ role: "assistant";
1003
+ content: string;
1004
+ timestamp?: number | undefined;
1005
+ id?: string | undefined;
1006
+ }) | ({
1007
+ role: "assistant";
1008
+ content: string;
1009
+ timestamp?: number | undefined;
1010
+ id?: string | undefined;
1011
+ } & {
1012
+ role: "assistant";
1013
+ content: string | null;
1014
+ function_call: {
1015
+ name: string;
1016
+ arguments: string;
1017
+ };
1018
+ timestamp?: number | undefined;
1019
+ id?: string | undefined;
1020
+ });
1021
+ }>, z.ZodObject<{
1022
+ type: z.ZodLiteral<"ping">;
1023
+ }, "strip", z.ZodTypeAny, {
1024
+ type: "ping";
1025
+ }, {
1026
+ type: "ping";
1027
+ }>, z.ZodObject<{
1028
+ type: z.ZodLiteral<"clearHistory">;
1029
+ }, "strip", z.ZodTypeAny, {
1030
+ type: "clearHistory";
1031
+ }, {
1032
+ type: "clearHistory";
1033
+ }>, z.ZodObject<{
1034
+ type: z.ZodLiteral<"history">;
1035
+ }, "strip", z.ZodTypeAny, {
1036
+ type: "history";
1037
+ }, {
1038
+ type: "history";
1039
+ }>]>;
1040
+ type RosettaRequestMessage = z.infer<typeof RosettaRequestMessageSchema>;
1041
+ declare const isRosettaRequestMessage: (input: unknown) => input is {
1042
+ type: "addMessage";
1043
+ data: {
1044
+ role: "user";
1045
+ content: string;
1046
+ name?: string | undefined;
1047
+ timestamp?: number | undefined;
1048
+ id?: string | undefined;
1049
+ } | {
1050
+ role: "assistant";
1051
+ content: string | null;
1052
+ function_call: {
1053
+ name: string;
1054
+ arguments: string;
1055
+ };
1056
+ timestamp?: number | undefined;
1057
+ id?: string | undefined;
1058
+ } | {
1059
+ role: "assistant";
1060
+ content: string;
1061
+ timestamp?: number | undefined;
1062
+ id?: string | undefined;
1063
+ } | {
1064
+ name: string;
1065
+ role: "function";
1066
+ content: string;
1067
+ timestamp?: number | undefined;
1068
+ id?: string | undefined;
1069
+ } | ({
1070
+ role: "assistant";
1071
+ content: string | null;
1072
+ function_call: {
1073
+ name: string;
1074
+ arguments: string;
1075
+ };
1076
+ timestamp?: number | undefined;
1077
+ id?: string | undefined;
1078
+ } & {
1079
+ role: "assistant";
1080
+ content: string;
1081
+ timestamp?: number | undefined;
1082
+ id?: string | undefined;
1083
+ }) | ({
1084
+ role: "assistant";
1085
+ content: string;
1086
+ timestamp?: number | undefined;
1087
+ id?: string | undefined;
1088
+ } & {
1089
+ role: "assistant";
1090
+ content: string | null;
1091
+ function_call: {
1092
+ name: string;
1093
+ arguments: string;
1094
+ };
1095
+ timestamp?: number | undefined;
1096
+ id?: string | undefined;
1097
+ });
1098
+ } | {
1099
+ type: "ping";
1100
+ } | {
1101
+ type: "clearHistory";
1102
+ } | {
1103
+ type: "history";
696
1104
  };
697
- interface AddMessageEvent {
698
- type: 'addMessage';
699
- data: ConversationIOMessage;
1105
+ type InfoMessageType = 'info';
1106
+ interface InfoMessageData {
1107
+ message: string;
1108
+ code?: string;
700
1109
  }
701
- interface PingEvent {
702
- type: 'ping';
1110
+ type ConversationHistoryType = 'conversationHistory';
1111
+ type ConversationHistoryData = ConversationIOMessage[];
1112
+ type ConversationUpdatedType = 'conversationUpdated';
1113
+ type ConversationDeletedType = 'conversationDeleted';
1114
+ interface ConversationUpdatedData {
1115
+ change: ConversationDeletedType;
1116
+ message?: string;
703
1117
  }
704
- interface ClearHistoryEvent {
705
- type: 'clearHistory';
1118
+ interface InfoMessage {
1119
+ type: InfoMessageType;
1120
+ data: InfoMessageData;
706
1121
  }
707
- interface HistoryEvent {
708
- type: 'history';
1122
+ interface HistoryMessage {
1123
+ type: ConversationHistoryType;
1124
+ data: ConversationHistoryData;
709
1125
  }
710
- type RosettaRequestMessage = AddMessageEvent | PingEvent | ClearHistoryEvent | HistoryEvent;
711
- interface RosettaMessageEvent extends MessageEvent {
712
- data: RosettaRequestMessage;
1126
+ interface ConversationUpdatedMessage {
1127
+ type: ConversationUpdatedType;
1128
+ data: ConversationUpdatedData;
713
1129
  }
714
- interface AddMessageResponse {
715
- type: 'newMessage';
716
- data: ConversationIOMessage;
1130
+ type PongType = 'pong';
1131
+ interface PongMessage {
1132
+ type: PongType;
717
1133
  }
718
- interface HistoryResponse {
719
- type: 'history';
720
- data: ConversationIOMessage[];
1134
+ type ErrorType = 'error';
1135
+ interface ErrorData {
1136
+ message: string;
1137
+ code?: string;
721
1138
  }
722
- interface ClearHistoryResponse {
723
- type: 'historyCleared';
1139
+ interface ErrorMessage {
1140
+ type: ErrorType;
1141
+ data: ErrorData;
724
1142
  }
725
- interface PingResponse {
726
- type: 'pong';
1143
+ type ThoughtType = 'thought';
1144
+ interface ThoughtData {
1145
+ message: string;
727
1146
  }
728
- type RosettaResponseMessage = AddMessageResponse | HistoryResponse | ClearHistoryResponse | PingResponse;
729
- interface RosettaResponseMessageEvent extends MessageEvent {
730
- data: RosettaResponseMessage;
1147
+ interface ThoughtMessage {
1148
+ type: ThoughtType;
1149
+ data: ThoughtData;
731
1150
  }
1151
+ type RosettaResponseMessage = InfoMessage | HistoryMessage | ConversationUpdatedMessage | PongMessage | ErrorMessage | ThoughtMessage;
732
1152
  declare function isType<T>(input: unknown, schema: z.ZodType<T>): input is T;
733
- export { type ConversationMessageRole, isConversationMessageRole, type ConversationMessageName, isConversationMessageName, type ConversationUserMessage, isConversationUserMessage, type ConversationAssistantMessage, isConversationAssistantMessage, type ConversationSystemMessage, isConversationSystemMessage, type ConversationFunctionMessage, isConversationFunctionMessage, type ConversationMessage, isConversationMessage, type ConversationIOMessage, isConversationInputMessage, type ConversationMessages, isConversationMessages, isType, type RosettaMessageEvent, type RosettaResponseMessageEvent, type ConversationMessageFunctionCall, isConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithFunctionCall };
1153
+ export { type ConversationMessageRole, isConversationMessageRole, type ConversationMessageName, isConversationMessageName, type ConversationUserMessage, isConversationUserMessage, type ConversationAssistantMessage, isConversationAssistantMessage, type ConversationSystemMessage, isConversationSystemMessage, type ConversationFunctionMessage, isConversationFunctionMessage, type ConversationMessage, isConversationMessage, type ConversationIOMessage, isConversationInputMessage, type ConversationMessages, isConversationMessages, isType, type RosettaRequestMessage, isRosettaRequestMessage, type RosettaResponseMessage, type ConversationMessageFunctionCall, isConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithFunctionCall, type ConversationAssistantMessageWithoutFunctionCall, isConversationAssistantMessageWithoutFunctionCall };
@@ -24,7 +24,8 @@ const ChatCompletionRequestUserMessageSchema = z.object({
24
24
  role: z.enum(['user']),
25
25
  content: z.string().min(1),
26
26
  name: ChatCompletionRequestMessageName.optional(),
27
- timestamp: ChatCompletionRequestMessageTimestamp.optional()
27
+ timestamp: ChatCompletionRequestMessageTimestamp.optional(),
28
+ id: z.string().uuid().optional()
28
29
  });
29
30
  const isConversationUserMessage = (input) => {
30
31
  return ChatCompletionRequestUserMessageSchema.safeParse(input).success;
@@ -46,17 +47,22 @@ const ChatCompletionRequestAssistantMessageWithFunctionCall = z.object({
46
47
  role: z.enum(['assistant']),
47
48
  content: z.null().or(z.string()),
48
49
  function_call: ChatCompletionRequestMessageFunctionCall,
49
- timestamp: ChatCompletionRequestMessageTimestamp.optional()
50
+ timestamp: ChatCompletionRequestMessageTimestamp.optional(),
51
+ id: z.string().uuid().optional()
50
52
  }).strict();
51
53
  const isConversationAssistantMessageWithFunctionCall = (input) => {
52
54
  return ChatCompletionRequestAssistantMessageWithFunctionCall.safeParse(input).success;
53
55
  };
54
- const ChatCompletionRequestAssistantMessage = z.object({
56
+ const ChatCompletionRequestAssistantMessageWihtoutFunctionCall = z.object({
55
57
  role: z.enum(['assistant']),
56
58
  content: z.string(),
57
- timestamp: ChatCompletionRequestMessageTimestamp.optional()
59
+ timestamp: ChatCompletionRequestMessageTimestamp.optional(),
60
+ id: z.string().uuid().optional()
58
61
  }).strict();
59
- const ChatCompletionAssistantMessage = ChatCompletionRequestAssistantMessage.or(ChatCompletionRequestAssistantMessageWithFunctionCall);
62
+ const isConversationAssistantMessageWithoutFunctionCall = (input) => {
63
+ return ChatCompletionRequestAssistantMessageWihtoutFunctionCall.safeParse(input).success;
64
+ };
65
+ const ChatCompletionAssistantMessage = ChatCompletionRequestAssistantMessageWihtoutFunctionCall.or(ChatCompletionRequestAssistantMessageWithFunctionCall);
60
66
  const isConversationAssistantMessage = (input) => {
61
67
  return ChatCompletionAssistantMessage.safeParse(input).success;
62
68
  };
@@ -77,7 +83,8 @@ const ChatCompletionFunctionMessageSchema = z.object({
77
83
  role: z.enum(['function']),
78
84
  content: z.string(),
79
85
  name: z.string(),
80
- timestamp: ChatCompletionRequestMessageTimestamp.optional()
86
+ timestamp: ChatCompletionRequestMessageTimestamp.optional(),
87
+ id: z.string().uuid().optional()
81
88
  });
82
89
  const isConversationFunctionMessage = (input) => {
83
90
  return ChatCompletionFunctionMessageSchema.safeParse(input).success;
@@ -152,6 +159,31 @@ const ChatCompletionRequestInputMessageSchema = z.union([
152
159
  const isConversationInputMessage = (input) => {
153
160
  return ChatCompletionRequestInputMessageSchema.safeParse(input).success;
154
161
  };
162
+ /// ///////////////////////////
163
+ // WebSocket Client -> Server
164
+ /// ///////////////////////////
165
+ const AddMessageEventSchema = z.object({
166
+ type: z.literal('addMessage'),
167
+ data: ChatCompletionRequestInputMessageSchema
168
+ });
169
+ const PingEventSchema = z.object({
170
+ type: z.literal('ping')
171
+ });
172
+ const ClearHistoryEventSchema = z.object({
173
+ type: z.literal('clearHistory')
174
+ });
175
+ const HistoryEventSchema = z.object({
176
+ type: z.literal('history')
177
+ });
178
+ const RosettaRequestMessageSchema = z.union([
179
+ AddMessageEventSchema,
180
+ PingEventSchema,
181
+ ClearHistoryEventSchema,
182
+ HistoryEventSchema
183
+ ]);
184
+ const isRosettaRequestMessage = (input) => {
185
+ return RosettaRequestMessageSchema.safeParse(input).success;
186
+ };
155
187
  /// ///////////////////
156
188
  // Utilities
157
189
  /// ///////////////////
@@ -161,4 +193,4 @@ function isType(input, schema) {
161
193
  /// ///////////////////
162
194
  // Exports
163
195
  /// ///////////////////
164
- export { isConversationMessageRole, isConversationMessageName, isConversationUserMessage, isConversationAssistantMessage, isConversationSystemMessage, isConversationFunctionMessage, isConversationMessage, isConversationInputMessage, isConversationMessages, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall };
196
+ export { isConversationMessageRole, isConversationMessageName, isConversationUserMessage, isConversationAssistantMessage, isConversationSystemMessage, isConversationFunctionMessage, isConversationMessage, isConversationInputMessage, isConversationMessages, isType, isRosettaRequestMessage, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithoutFunctionCall };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "0.0.84",
3
+ "version": "0.0.86",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",