@narrative.io/data-collaboration-sdk-ts 0.0.85 → 0.0.87
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 +2 -2
- package/build/index.js +2 -2
- package/build/rosetta/types.d.ts +250 -29
- package/build/rosetta/types.js +42 -7
- package/package.json +1 -1
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 RosettaRequestMessage, type ConversationMessageFunctionCall, isConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithFunctionCall, type RosettaResponseMessage } 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 RosettaRequestMessage, type ConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, type RosettaResponseMessage };
|
|
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 };
|
package/build/rosetta/types.d.ts
CHANGED
|
@@ -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,52 +804,153 @@ 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;
|
|
696
819
|
};
|
|
697
|
-
|
|
698
|
-
type:
|
|
699
|
-
data:
|
|
820
|
+
declare const RosettaRequestMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
821
|
+
type: z.ZodLiteral<"request">;
|
|
822
|
+
data: z.ZodObject<{
|
|
823
|
+
input: z.ZodString;
|
|
824
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
825
|
+
}, "strip", z.ZodTypeAny, {
|
|
826
|
+
input: string;
|
|
827
|
+
apiKey?: string | undefined;
|
|
828
|
+
}, {
|
|
829
|
+
input: string;
|
|
830
|
+
apiKey?: string | undefined;
|
|
831
|
+
}>;
|
|
832
|
+
}, "strip", z.ZodTypeAny, {
|
|
833
|
+
type: "request";
|
|
834
|
+
data: {
|
|
835
|
+
input: string;
|
|
836
|
+
apiKey?: string | undefined;
|
|
837
|
+
};
|
|
838
|
+
}, {
|
|
839
|
+
type: "request";
|
|
840
|
+
data: {
|
|
841
|
+
input: string;
|
|
842
|
+
apiKey?: string | undefined;
|
|
843
|
+
};
|
|
844
|
+
}>, z.ZodObject<{
|
|
845
|
+
type: z.ZodLiteral<"ping">;
|
|
846
|
+
}, "strip", z.ZodTypeAny, {
|
|
847
|
+
type: "ping";
|
|
848
|
+
}, {
|
|
849
|
+
type: "ping";
|
|
850
|
+
}>, z.ZodObject<{
|
|
851
|
+
type: z.ZodLiteral<"clearHistory">;
|
|
852
|
+
}, "strip", z.ZodTypeAny, {
|
|
853
|
+
type: "clearHistory";
|
|
854
|
+
}, {
|
|
855
|
+
type: "clearHistory";
|
|
856
|
+
}>, z.ZodObject<{
|
|
857
|
+
type: z.ZodLiteral<"history">;
|
|
858
|
+
}, "strip", z.ZodTypeAny, {
|
|
859
|
+
type: "history";
|
|
860
|
+
}, {
|
|
861
|
+
type: "history";
|
|
862
|
+
}>]>;
|
|
863
|
+
type RosettaRequestMessage = z.infer<typeof RosettaRequestMessageSchema>;
|
|
864
|
+
declare const isRosettaRequestMessage: (input: unknown) => input is {
|
|
865
|
+
type: "request";
|
|
866
|
+
data: {
|
|
867
|
+
input: string;
|
|
868
|
+
apiKey?: string | undefined;
|
|
869
|
+
};
|
|
870
|
+
} | {
|
|
871
|
+
type: "ping";
|
|
872
|
+
} | {
|
|
873
|
+
type: "clearHistory";
|
|
874
|
+
} | {
|
|
875
|
+
type: "history";
|
|
876
|
+
};
|
|
877
|
+
type InfoMessageType = 'info';
|
|
878
|
+
interface InfoMessageData {
|
|
879
|
+
message: string;
|
|
880
|
+
code?: string;
|
|
700
881
|
}
|
|
701
|
-
interface
|
|
702
|
-
type: '
|
|
882
|
+
interface ConverationHistoryObj {
|
|
883
|
+
type: 'human' | 'ai';
|
|
884
|
+
text: string;
|
|
885
|
+
timestamp: number;
|
|
886
|
+
reference?: string;
|
|
887
|
+
reference_type?: string;
|
|
703
888
|
}
|
|
704
|
-
|
|
705
|
-
|
|
889
|
+
type ConversationHistoryType = 'history';
|
|
890
|
+
type ConversationHistoryData = ConverationHistoryObj[];
|
|
891
|
+
type ConversationUpdatedType = 'conversationUpdated';
|
|
892
|
+
type ConversationDeletedType = 'conversationDeleted';
|
|
893
|
+
interface ConversationUpdatedData {
|
|
894
|
+
change: ConversationDeletedType;
|
|
895
|
+
message?: string;
|
|
896
|
+
conversationId: string;
|
|
706
897
|
}
|
|
707
|
-
interface
|
|
708
|
-
type:
|
|
898
|
+
interface InfoMessage {
|
|
899
|
+
type: InfoMessageType;
|
|
900
|
+
data: InfoMessageData;
|
|
709
901
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
data: ConversationIOMessage;
|
|
902
|
+
interface HistoryMessage {
|
|
903
|
+
type: ConversationHistoryType;
|
|
904
|
+
data: ConversationHistoryData;
|
|
714
905
|
}
|
|
715
|
-
interface
|
|
716
|
-
type:
|
|
717
|
-
data:
|
|
906
|
+
interface ConversationUpdatedMessage {
|
|
907
|
+
type: ConversationUpdatedType;
|
|
908
|
+
data: ConversationUpdatedData;
|
|
718
909
|
}
|
|
719
|
-
interface
|
|
720
|
-
|
|
910
|
+
interface ConversationSummary {
|
|
911
|
+
id: string;
|
|
912
|
+
description?: string;
|
|
913
|
+
timestamp?: string;
|
|
721
914
|
}
|
|
722
|
-
|
|
723
|
-
|
|
915
|
+
type ConversationsType = 'userConversations';
|
|
916
|
+
type ConversationsData = ConversationSummary[];
|
|
917
|
+
interface ConversationListMessage {
|
|
918
|
+
type: ConversationsType;
|
|
919
|
+
data: ConversationsData;
|
|
724
920
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
921
|
+
type PongType = 'pong';
|
|
922
|
+
interface PongMessage {
|
|
923
|
+
type: PongType;
|
|
924
|
+
}
|
|
925
|
+
type ErrorType = 'error';
|
|
926
|
+
interface ErrorData {
|
|
927
|
+
message: string;
|
|
928
|
+
code?: string;
|
|
929
|
+
}
|
|
930
|
+
interface ErrorMessage {
|
|
931
|
+
type: ErrorType;
|
|
932
|
+
data: ErrorData;
|
|
933
|
+
}
|
|
934
|
+
type ThoughtType = 'thought-start';
|
|
935
|
+
interface ThoughtData {
|
|
936
|
+
text: string;
|
|
937
|
+
timestamp?: string;
|
|
938
|
+
}
|
|
939
|
+
interface ThoughtMessage {
|
|
940
|
+
type: ThoughtType;
|
|
941
|
+
data: ThoughtData;
|
|
942
|
+
}
|
|
943
|
+
type ResponseType = 'response';
|
|
944
|
+
interface ReponseData {
|
|
945
|
+
response: string;
|
|
946
|
+
reference_type?: string;
|
|
947
|
+
reference?: string;
|
|
948
|
+
timestamp?: string;
|
|
949
|
+
}
|
|
950
|
+
interface RespomseMessage {
|
|
951
|
+
type: ResponseType;
|
|
952
|
+
data: ReponseData;
|
|
732
953
|
}
|
|
733
|
-
type RosettaResponseMessage =
|
|
954
|
+
type RosettaResponseMessage = InfoMessage | HistoryMessage | ConversationUpdatedMessage | PongMessage | ErrorMessage | ThoughtMessage | RespomseMessage | ConversationListMessage;
|
|
734
955
|
declare function isType<T>(input: unknown, schema: z.ZodType<T>): input is T;
|
|
735
|
-
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, type RosettaResponseMessage, type ConversationMessageFunctionCall, isConversationMessageFunctionCall, type ConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithFunctionCall };
|
|
956
|
+
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 };
|
package/build/rosetta/types.js
CHANGED
|
@@ -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
|
|
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
|
|
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,34 @@ 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 RequestMessageSchema = z.object({
|
|
166
|
+
type: z.literal('request'),
|
|
167
|
+
data: z.object({
|
|
168
|
+
input: z.string(),
|
|
169
|
+
apiKey: z.string().optional()
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
const PingEventSchema = z.object({
|
|
173
|
+
type: z.literal('ping')
|
|
174
|
+
});
|
|
175
|
+
const ClearHistoryEventSchema = z.object({
|
|
176
|
+
type: z.literal('clearHistory')
|
|
177
|
+
});
|
|
178
|
+
const HistoryEventSchema = z.object({
|
|
179
|
+
type: z.literal('history')
|
|
180
|
+
});
|
|
181
|
+
const RosettaRequestMessageSchema = z.union([
|
|
182
|
+
RequestMessageSchema,
|
|
183
|
+
PingEventSchema,
|
|
184
|
+
ClearHistoryEventSchema,
|
|
185
|
+
HistoryEventSchema
|
|
186
|
+
]);
|
|
187
|
+
const isRosettaRequestMessage = (input) => {
|
|
188
|
+
return RosettaRequestMessageSchema.safeParse(input).success;
|
|
189
|
+
};
|
|
155
190
|
/// ///////////////////
|
|
156
191
|
// Utilities
|
|
157
192
|
/// ///////////////////
|
|
@@ -161,4 +196,4 @@ function isType(input, schema) {
|
|
|
161
196
|
/// ///////////////////
|
|
162
197
|
// Exports
|
|
163
198
|
/// ///////////////////
|
|
164
|
-
export { isConversationMessageRole, isConversationMessageName, isConversationUserMessage, isConversationAssistantMessage, isConversationSystemMessage, isConversationFunctionMessage, isConversationMessage, isConversationInputMessage, isConversationMessages, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall };
|
|
199
|
+
export { isConversationMessageRole, isConversationMessageName, isConversationUserMessage, isConversationAssistantMessage, isConversationSystemMessage, isConversationFunctionMessage, isConversationMessage, isConversationInputMessage, isConversationMessages, isType, isRosettaRequestMessage, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithoutFunctionCall };
|