@meistrari/tela-sdk-js 0.0.1 → 0.0.2

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.
@@ -56,8 +56,8 @@ export declare class ChatCompletions extends Resource {
56
56
  */
57
57
  create<Variables = ChatCompletionVariables, CompletionContent = string>(body: ChatCompletionCreateWebhookParams<Variables>, opts?: RequestOptions<ChatCompletionCreateParams<Variables>>): Promise<ChatCompletionWebhookResponse<CompletionContent>>;
58
58
  create<Variables = ChatCompletionVariables, CompletionContent = string>(body: CompletionCreateParamsNonStreaming<Variables>, opts?: RequestOptions<ChatCompletionCreateParams<Variables>>): Promise<ChatCompletionCreateResponse<CompletionContent>>;
59
- create<Variables = ChatCompletionVariables, CompletionContent = string>(body: CompletionCreateParamsStreaming<Variables>, opts?: RequestOptions<ChatCompletionCreateParams<Variables>>): Promise<Stream<ChatCompletionCreateResponse<CompletionContent>>>;
60
- create<Variables = ChatCompletionVariables, CompletionContent = string>(body: ChatCompletionCreateParamsBase<Variables>, opts?: RequestOptions<ChatCompletionCreateParams<Variables>>): Promise<Stream<ChatCompletionCreateResponse<CompletionContent>> | ChatCompletionCreateResponse<CompletionContent> | ChatCompletionWebhookResponse<CompletionContent>>;
59
+ create<Variables = ChatCompletionVariables, CompletionContent = string>(body: CompletionCreateParamsStreaming<Variables>, opts?: RequestOptions<ChatCompletionCreateParams<Variables>>): Promise<Stream<ChatCompletionCreateStreamingResponse<CompletionContent>>>;
60
+ create<Variables = ChatCompletionVariables, CompletionContent = string>(body: ChatCompletionCreateParamsBase<Variables>, opts?: RequestOptions<ChatCompletionCreateParams<Variables>>): Promise<Stream<ChatCompletionCreateStreamingResponse<CompletionContent>> | ChatCompletionCreateResponse<CompletionContent> | ChatCompletionWebhookResponse<CompletionContent>>;
61
61
  /**
62
62
  * Uploads a file and returns its URL and options.
63
63
  *
@@ -242,6 +242,59 @@ export type ChatCompletionCreateResponse<T> = {
242
242
  };
243
243
  }>;
244
244
  };
245
+ /**
246
+ * Response structure for a chat completion streaming response.
247
+ */
248
+ export type ChatCompletionCreateStreamingResponse<T> = {
249
+ /**
250
+ * The ID of the completion.
251
+ */
252
+ id: string;
253
+ /**
254
+ * The object of the completion.
255
+ */
256
+ object: string;
257
+ /**
258
+ * The created time of the completion.
259
+ */
260
+ created: number;
261
+ /**
262
+ * The model of the completion.
263
+ */
264
+ model: string;
265
+ /**
266
+ * The choices of the completion.
267
+ */
268
+ choices: Array<{
269
+ delta: {
270
+ role: string | null;
271
+ content: string | null;
272
+ functionCall: {
273
+ name: string | null;
274
+ arguments: string | null;
275
+ } | null;
276
+ };
277
+ finishReason: string | null;
278
+ index: number;
279
+ logprobs: number | null;
280
+ }>;
281
+ /**
282
+ * The message of the completion.
283
+ */
284
+ message: {
285
+ role: string;
286
+ content: string | null;
287
+ functionCall: {
288
+ name: string | null;
289
+ arguments: string | null;
290
+ } | null;
291
+ toolCalls: Array<{
292
+ name: string;
293
+ arguments: string;
294
+ }>;
295
+ structuredContent: T;
296
+ };
297
+ };
245
298
  /**
246
299
  * Response structure for a chat completion webhook.
247
300
  * This interface represents the data sent to the webhook URL when a chat completion is finished.
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@meistrari/tela-sdk-js",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/meistrari/tela-sdk-js.git"
8
+ },
5
9
  "exports": {
6
10
  ".": "./dist/index.js"
7
11
  },