@taskyon/tyclient 0.5.0 → 0.5.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.
- package/dist/tyclient.d.mts +479 -372
- package/dist/tyclient.d.ts +479 -372
- package/dist/tyclient.js +75 -62
- package/dist/tyclient.js.map +1 -1
- package/dist/tyclient.mjs +75 -62
- package/dist/tyclient.mjs.map +1 -1
- package/package.json +1 -1
package/dist/tyclient.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as json_schema from 'json-schema';
|
|
2
2
|
import { JSONSchema7 } from 'json-schema';
|
|
3
|
+
import { streamText } from 'ai';
|
|
3
4
|
import { JSONSchema, FromSchema } from 'json-schema-to-ts';
|
|
5
|
+
import { PartialDeep, ReadonlyDeep } from 'type-fest';
|
|
4
6
|
import z, { z as z$1 } from 'zod';
|
|
5
|
-
import { PartialDeep } from 'type-fest';
|
|
6
7
|
import { PGliteWorker } from '@electric-sql/pglite/worker';
|
|
7
8
|
import { LiveNamespace } from '@electric-sql/pglite/live';
|
|
8
9
|
|
|
@@ -45,6 +46,61 @@ type WithRequired<T, K extends keyof T> = Omit<T, K> & {
|
|
|
45
46
|
*/
|
|
46
47
|
type Thunk<T> = () => T;
|
|
47
48
|
|
|
49
|
+
declare const TaskContent: z.ZodUnion<readonly [z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"message">;
|
|
51
|
+
data: z.ZodString;
|
|
52
|
+
ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
53
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
|
|
54
|
+
id: z.ZodOptional<z.ZodString>;
|
|
55
|
+
end_index: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
start_index: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
title: z.ZodOptional<z.ZodString>;
|
|
58
|
+
url: z.ZodOptional<z.ZodString>;
|
|
59
|
+
content: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
|
|
62
|
+
text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
63
|
+
content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
64
|
+
}, z.core.$strip>]>>>;
|
|
65
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
66
|
+
type: z.ZodLiteral<"toolresult">;
|
|
67
|
+
data: z.ZodUnknown;
|
|
68
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
69
|
+
type: z.ZodLiteral<"tooldefinition">;
|
|
70
|
+
data: z.ZodObject<{
|
|
71
|
+
description: z.ZodString;
|
|
72
|
+
longDescription: z.ZodOptional<z.ZodString>;
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
parameters: z.ZodReadonly<z.ZodType<json_schema.JSONSchema7, unknown, z.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
79
|
+
code: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
82
|
+
type: z.ZodLiteral<"error">;
|
|
83
|
+
data: z.ZodUnknown;
|
|
84
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
+
type: z.ZodLiteral<"structured">;
|
|
86
|
+
data: z.ZodUnknown;
|
|
87
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
88
|
+
type: z.ZodLiteral<"functioncall">;
|
|
89
|
+
data: z.ZodObject<{
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown>, z.ZodNull, z.ZodUndefined]>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
94
|
+
type: z.ZodLiteral<"files">;
|
|
95
|
+
data: z.ZodArray<z.ZodString>;
|
|
96
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
97
|
+
type: z.ZodLiteral<"return">;
|
|
98
|
+
data: z.ZodString;
|
|
99
|
+
}, z.core.$strict>]>;
|
|
100
|
+
type TaskContent = z.infer<typeof TaskContent>;
|
|
101
|
+
type TaskContentType = TaskContent extends {
|
|
102
|
+
type: infer T;
|
|
103
|
+
} ? T : never;
|
|
48
104
|
declare const TaskNode: z.ZodObject<{
|
|
49
105
|
role: z.ZodEnum<{
|
|
50
106
|
function: "function";
|
|
@@ -57,20 +113,17 @@ declare const TaskNode: z.ZodObject<{
|
|
|
57
113
|
type: z.ZodLiteral<"message">;
|
|
58
114
|
data: z.ZodString;
|
|
59
115
|
ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
60
|
-
type: z.ZodLiteral<"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, z.core.$strip>>;
|
|
116
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
|
|
117
|
+
id: z.ZodOptional<z.ZodString>;
|
|
118
|
+
end_index: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
start_index: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
title: z.ZodOptional<z.ZodString>;
|
|
121
|
+
url: z.ZodOptional<z.ZodString>;
|
|
122
|
+
content: z.ZodOptional<z.ZodString>;
|
|
68
123
|
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
-
type: z.ZodLiteral<"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
type: z.ZodString;
|
|
73
|
-
}, z.core.$strip>>>;
|
|
124
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
|
|
125
|
+
text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
126
|
+
content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
74
127
|
}, z.core.$strip>]>>>;
|
|
75
128
|
}, z.core.$strict>, z.ZodObject<{
|
|
76
129
|
type: z.ZodLiteral<"toolresult">;
|
|
@@ -129,20 +182,17 @@ declare const partialTaskDraft: z.ZodObject<{
|
|
|
129
182
|
type: z.ZodLiteral<"message">;
|
|
130
183
|
data: z.ZodString;
|
|
131
184
|
ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
132
|
-
type: z.ZodLiteral<"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}, z.core.$strip>>;
|
|
185
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
|
|
186
|
+
id: z.ZodOptional<z.ZodString>;
|
|
187
|
+
end_index: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
start_index: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
title: z.ZodOptional<z.ZodString>;
|
|
190
|
+
url: z.ZodOptional<z.ZodString>;
|
|
191
|
+
content: z.ZodOptional<z.ZodString>;
|
|
140
192
|
}, z.core.$strip>, z.ZodObject<{
|
|
141
|
-
type: z.ZodLiteral<"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
type: z.ZodString;
|
|
145
|
-
}, z.core.$strip>>>;
|
|
193
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
|
|
194
|
+
text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
195
|
+
content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
146
196
|
}, z.core.$strip>]>>>;
|
|
147
197
|
}, z.core.$strict>, z.ZodObject<{
|
|
148
198
|
type: z.ZodLiteral<"toolresult">;
|
|
@@ -267,7 +317,9 @@ declare const InternalTool: z.ZodObject<{
|
|
|
267
317
|
}, z.core.$strip>;
|
|
268
318
|
type InternalTool = z.infer<typeof InternalTool>;
|
|
269
319
|
type ClientTool = WithRequired<InternalTool, 'function'>;
|
|
270
|
-
declare function createTool<T, SCHEMA extends Readonly<JSONSchema>, PARAMS = FromSchema<SCHEMA
|
|
320
|
+
declare function createTool<T, SCHEMA extends Readonly<JSONSchema>, PARAMS = FromSchema<SCHEMA, {
|
|
321
|
+
keepDefaultedPropertiesOptional: true;
|
|
322
|
+
}>>(tool: T & {
|
|
271
323
|
parameters: SCHEMA;
|
|
272
324
|
function?: (params: PARAMS, context: toolContext) => unknown;
|
|
273
325
|
} & Omit<InternalTool, 'function' | 'parameters'>): T;
|
|
@@ -293,20 +345,17 @@ declare const taskResult: z.ZodObject<{
|
|
|
293
345
|
type: z.ZodLiteral<"message">;
|
|
294
346
|
data: z.ZodString;
|
|
295
347
|
ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
296
|
-
type: z.ZodLiteral<"
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}, z.core.$strip>>;
|
|
348
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
|
|
349
|
+
id: z.ZodOptional<z.ZodString>;
|
|
350
|
+
end_index: z.ZodOptional<z.ZodNumber>;
|
|
351
|
+
start_index: z.ZodOptional<z.ZodNumber>;
|
|
352
|
+
title: z.ZodOptional<z.ZodString>;
|
|
353
|
+
url: z.ZodOptional<z.ZodString>;
|
|
354
|
+
content: z.ZodOptional<z.ZodString>;
|
|
304
355
|
}, z.core.$strip>, z.ZodObject<{
|
|
305
|
-
type: z.ZodLiteral<"
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
type: z.ZodString;
|
|
309
|
-
}, z.core.$strip>>>;
|
|
356
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
|
|
357
|
+
text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
358
|
+
content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
310
359
|
}, z.core.$strip>]>>>;
|
|
311
360
|
}, z.core.$strict>, z.ZodObject<{
|
|
312
361
|
type: z.ZodLiteral<"toolresult">;
|
|
@@ -371,20 +420,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
371
420
|
type: "message";
|
|
372
421
|
data: string;
|
|
373
422
|
ann?: ({
|
|
374
|
-
type: "
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
} | undefined;
|
|
423
|
+
type: "url";
|
|
424
|
+
id?: string | undefined;
|
|
425
|
+
end_index?: number | undefined;
|
|
426
|
+
start_index?: number | undefined;
|
|
427
|
+
title?: string | undefined;
|
|
428
|
+
url?: string | undefined;
|
|
429
|
+
content?: string | undefined;
|
|
382
430
|
} | {
|
|
383
|
-
type: "
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
type: string;
|
|
387
|
-
}[] | undefined;
|
|
431
|
+
type: "document";
|
|
432
|
+
text?: string | undefined;
|
|
433
|
+
content?: string | undefined;
|
|
388
434
|
})[] | undefined;
|
|
389
435
|
} | {
|
|
390
436
|
type: "toolresult";
|
|
@@ -439,20 +485,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
439
485
|
type: "message";
|
|
440
486
|
data: string;
|
|
441
487
|
ann?: ({
|
|
442
|
-
type: "
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
} | undefined;
|
|
488
|
+
type: "url";
|
|
489
|
+
id?: string | undefined;
|
|
490
|
+
end_index?: number | undefined;
|
|
491
|
+
start_index?: number | undefined;
|
|
492
|
+
title?: string | undefined;
|
|
493
|
+
url?: string | undefined;
|
|
494
|
+
content?: string | undefined;
|
|
450
495
|
} | {
|
|
451
|
-
type: "
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
type: string;
|
|
455
|
-
}[] | undefined;
|
|
496
|
+
type: "document";
|
|
497
|
+
text?: string | undefined;
|
|
498
|
+
content?: string | undefined;
|
|
456
499
|
})[] | undefined;
|
|
457
500
|
} | {
|
|
458
501
|
type: "toolresult";
|
|
@@ -505,20 +548,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
505
548
|
type: "message";
|
|
506
549
|
data: string;
|
|
507
550
|
ann?: ({
|
|
508
|
-
type: "
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
} | undefined;
|
|
551
|
+
type: "url";
|
|
552
|
+
id?: string | undefined;
|
|
553
|
+
end_index?: number | undefined;
|
|
554
|
+
start_index?: number | undefined;
|
|
555
|
+
title?: string | undefined;
|
|
556
|
+
url?: string | undefined;
|
|
557
|
+
content?: string | undefined;
|
|
516
558
|
} | {
|
|
517
|
-
type: "
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
type: string;
|
|
521
|
-
}[] | undefined;
|
|
559
|
+
type: "document";
|
|
560
|
+
text?: string | undefined;
|
|
561
|
+
content?: string | undefined;
|
|
522
562
|
})[] | undefined;
|
|
523
563
|
} | {
|
|
524
564
|
type: "toolresult";
|
|
@@ -573,6 +613,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
573
613
|
taskTokens?: number | undefined;
|
|
574
614
|
name?: string | undefined;
|
|
575
615
|
summary?: string | undefined;
|
|
616
|
+
reasoning?: string | undefined;
|
|
576
617
|
estimatedTokens?: {
|
|
577
618
|
resultTokens?: number | undefined;
|
|
578
619
|
taskCosts?: number | undefined;
|
|
@@ -585,7 +626,8 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
585
626
|
taskCosts?: number | undefined;
|
|
586
627
|
rawOutput?: unknown;
|
|
587
628
|
error?: unknown;
|
|
588
|
-
taskPrompt?: Record<string, unknown> | undefined;
|
|
629
|
+
taskPrompt?: Record<string, unknown>[] | undefined;
|
|
630
|
+
tools?: unknown[] | undefined;
|
|
589
631
|
} | null>;
|
|
590
632
|
metaLiveRead: (id: string | number) => Stream<{
|
|
591
633
|
id: string | number;
|
|
@@ -596,6 +638,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
596
638
|
taskTokens?: number | undefined;
|
|
597
639
|
name?: string | undefined;
|
|
598
640
|
summary?: string | undefined;
|
|
641
|
+
reasoning?: string | undefined;
|
|
599
642
|
estimatedTokens?: {
|
|
600
643
|
resultTokens?: number | undefined;
|
|
601
644
|
taskCosts?: number | undefined;
|
|
@@ -608,7 +651,8 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
608
651
|
taskCosts?: number | undefined;
|
|
609
652
|
rawOutput?: unknown;
|
|
610
653
|
error?: unknown;
|
|
611
|
-
taskPrompt?: Record<string, unknown> | undefined;
|
|
654
|
+
taskPrompt?: Record<string, unknown>[] | undefined;
|
|
655
|
+
tools?: unknown[] | undefined;
|
|
612
656
|
} | null;
|
|
613
657
|
}>;
|
|
614
658
|
metaUpsert: (id: string | number, data: {
|
|
@@ -618,6 +662,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
618
662
|
taskTokens?: number | undefined;
|
|
619
663
|
name?: string | undefined;
|
|
620
664
|
summary?: string | undefined;
|
|
665
|
+
reasoning?: string | undefined;
|
|
621
666
|
estimatedTokens?: {
|
|
622
667
|
resultTokens?: number | undefined;
|
|
623
668
|
taskCosts?: number | undefined;
|
|
@@ -630,7 +675,8 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
630
675
|
taskCosts?: number | undefined;
|
|
631
676
|
rawOutput?: unknown;
|
|
632
677
|
error?: unknown;
|
|
633
|
-
taskPrompt?: Record<string, unknown> | undefined;
|
|
678
|
+
taskPrompt?: Record<string, unknown>[] | undefined;
|
|
679
|
+
tools?: unknown[] | undefined;
|
|
634
680
|
}, strategy?: "shallow_merge" | "replace" | "deepmerge" | "native_shallow") => Promise<{
|
|
635
681
|
threadMessage?: any;
|
|
636
682
|
promptTokens?: number | undefined;
|
|
@@ -638,6 +684,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
638
684
|
taskTokens?: number | undefined;
|
|
639
685
|
name?: string | undefined;
|
|
640
686
|
summary?: string | undefined;
|
|
687
|
+
reasoning?: string | undefined;
|
|
641
688
|
estimatedTokens?: {
|
|
642
689
|
resultTokens?: number | undefined;
|
|
643
690
|
taskCosts?: number | undefined;
|
|
@@ -650,7 +697,8 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
650
697
|
taskCosts?: number | undefined;
|
|
651
698
|
rawOutput?: unknown;
|
|
652
699
|
error?: unknown;
|
|
653
|
-
taskPrompt?: Record<string, unknown> | undefined;
|
|
700
|
+
taskPrompt?: Record<string, unknown>[] | undefined;
|
|
701
|
+
tools?: unknown[] | undefined;
|
|
654
702
|
}>;
|
|
655
703
|
addFiles: (newFiles: File[], storage: "memory" | "opfs") => Promise<string[]>;
|
|
656
704
|
searchFiles: (where: {
|
|
@@ -687,20 +735,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
687
735
|
type: "message";
|
|
688
736
|
data: string;
|
|
689
737
|
ann?: ({
|
|
690
|
-
type: "
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
} | undefined;
|
|
738
|
+
type: "url";
|
|
739
|
+
id?: string | undefined;
|
|
740
|
+
end_index?: number | undefined;
|
|
741
|
+
start_index?: number | undefined;
|
|
742
|
+
title?: string | undefined;
|
|
743
|
+
url?: string | undefined;
|
|
744
|
+
content?: string | undefined;
|
|
698
745
|
} | {
|
|
699
|
-
type: "
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
type: string;
|
|
703
|
-
}[] | undefined;
|
|
746
|
+
type: "document";
|
|
747
|
+
text?: string | undefined;
|
|
748
|
+
content?: string | undefined;
|
|
704
749
|
})[] | undefined;
|
|
705
750
|
} | {
|
|
706
751
|
type: "toolresult";
|
|
@@ -757,20 +802,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
757
802
|
type: "message";
|
|
758
803
|
data: string;
|
|
759
804
|
ann?: ({
|
|
760
|
-
type: "
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
} | undefined;
|
|
805
|
+
type: "url";
|
|
806
|
+
id?: string | undefined;
|
|
807
|
+
end_index?: number | undefined;
|
|
808
|
+
start_index?: number | undefined;
|
|
809
|
+
title?: string | undefined;
|
|
810
|
+
url?: string | undefined;
|
|
811
|
+
content?: string | undefined;
|
|
768
812
|
} | {
|
|
769
|
-
type: "
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
type: string;
|
|
773
|
-
}[] | undefined;
|
|
813
|
+
type: "document";
|
|
814
|
+
text?: string | undefined;
|
|
815
|
+
content?: string | undefined;
|
|
774
816
|
})[] | undefined;
|
|
775
817
|
} | {
|
|
776
818
|
type: "toolresult";
|
|
@@ -847,58 +889,10 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
|
|
|
847
889
|
}>;
|
|
848
890
|
type TyTaskManager = Awaited<ReturnType<typeof useTyTaskManager>>;
|
|
849
891
|
|
|
850
|
-
type ChatCompletionChunk = {
|
|
851
|
-
id: string;
|
|
852
|
-
object: 'chat.completion.chunk';
|
|
853
|
-
created: number;
|
|
854
|
-
model: string;
|
|
855
|
-
system_fingerprint?: string;
|
|
856
|
-
provider?: string;
|
|
857
|
-
choices: Array<{
|
|
858
|
-
index: number;
|
|
859
|
-
delta: {
|
|
860
|
-
role?: 'system' | 'user' | 'assistant' | 'tool' | 'developer';
|
|
861
|
-
content?: string | null;
|
|
862
|
-
refusal?: string | null;
|
|
863
|
-
tool_calls?: Array<{
|
|
864
|
-
index: number;
|
|
865
|
-
id?: string;
|
|
866
|
-
type?: 'function';
|
|
867
|
-
function?: {
|
|
868
|
-
name?: string;
|
|
869
|
-
arguments?: string;
|
|
870
|
-
};
|
|
871
|
-
}>;
|
|
872
|
-
reasoning?: string;
|
|
873
|
-
reasoning_details?: Array<{
|
|
874
|
-
type: string;
|
|
875
|
-
text: string;
|
|
876
|
-
format?: string;
|
|
877
|
-
index?: number;
|
|
878
|
-
}>;
|
|
879
|
-
annotations?: Array<{
|
|
880
|
-
type: 'url_citation';
|
|
881
|
-
url_citation: {
|
|
882
|
-
end_index?: number;
|
|
883
|
-
start_index?: number;
|
|
884
|
-
title: string;
|
|
885
|
-
url: string;
|
|
886
|
-
content: string;
|
|
887
|
-
};
|
|
888
|
-
}>;
|
|
889
|
-
};
|
|
890
|
-
finish_reason?: 'stop' | 'length' | 'content_filter' | 'tool_calls' | 'function_call' | null;
|
|
891
|
-
native_finish_reason?: string | null;
|
|
892
|
-
logprobs?: unknown;
|
|
893
|
-
}>;
|
|
894
|
-
};
|
|
895
|
-
|
|
896
892
|
declare const llmSettings: z.ZodObject<{
|
|
897
893
|
userId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
898
|
-
allowWebSearch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
899
894
|
secretPublicKey: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
900
895
|
selectedTaskId: z.ZodOptional<z.ZodString>;
|
|
901
|
-
enableOpenAiTools: z.ZodDefault<z.ZodBoolean>;
|
|
902
896
|
selectedApi: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
903
897
|
llmApis: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
904
898
|
name: z.ZodString;
|
|
@@ -933,20 +927,17 @@ declare const llmSettings: z.ZodObject<{
|
|
|
933
927
|
type: z.ZodLiteral<"message">;
|
|
934
928
|
data: z.ZodString;
|
|
935
929
|
ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
936
|
-
type: z.ZodLiteral<"
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
}, z.core.$strip>>;
|
|
930
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
|
|
931
|
+
id: z.ZodOptional<z.ZodString>;
|
|
932
|
+
end_index: z.ZodOptional<z.ZodNumber>;
|
|
933
|
+
start_index: z.ZodOptional<z.ZodNumber>;
|
|
934
|
+
title: z.ZodOptional<z.ZodString>;
|
|
935
|
+
url: z.ZodOptional<z.ZodString>;
|
|
936
|
+
content: z.ZodOptional<z.ZodString>;
|
|
944
937
|
}, z.core.$strip>, z.ZodObject<{
|
|
945
|
-
type: z.ZodLiteral<"
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
type: z.ZodString;
|
|
949
|
-
}, z.core.$strip>>>;
|
|
938
|
+
type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
|
|
939
|
+
text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
940
|
+
content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
950
941
|
}, z.core.$strip>]>>>;
|
|
951
942
|
}, z.core.$strict>, z.ZodObject<{
|
|
952
943
|
type: z.ZodLiteral<"toolresult">;
|
|
@@ -993,21 +984,16 @@ declare const llmSettings: z.ZodObject<{
|
|
|
993
984
|
sig: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
994
985
|
}, z.core.$strip>>;
|
|
995
986
|
enableToolChooser: z.ZodDefault<z.ZodBoolean>;
|
|
996
|
-
useBasePrompt: z.ZodDefault<z.ZodBoolean>;
|
|
997
|
-
tryUsingVisionModels: z.ZodDefault<z.ZodBoolean>;
|
|
998
|
-
taskChatTemplates: z.ZodObject<{
|
|
999
|
-
basePrompt: z.ZodString;
|
|
1000
|
-
instruction: z.ZodString;
|
|
1001
|
-
toolResult: z.ZodString;
|
|
1002
|
-
task: z.ZodString;
|
|
1003
|
-
evaluate: z.ZodString;
|
|
1004
|
-
schemaReminder: z.ZodString;
|
|
1005
|
-
tools: z.ZodString;
|
|
1006
|
-
}, z.core.$strip>;
|
|
1007
987
|
}, z.core.$strip>;
|
|
1008
988
|
type llmSettings = z.infer<typeof llmSettings>;
|
|
1009
989
|
|
|
1010
|
-
|
|
990
|
+
type streamOptsType = Parameters<typeof streamText>[0];
|
|
991
|
+
type streamChunk = Parameters<Required<streamOptsType>['onChunk']>[0]['chunk'];
|
|
992
|
+
type chunkStreamType = {
|
|
993
|
+
taskId: string;
|
|
994
|
+
chunk: streamChunk;
|
|
995
|
+
};
|
|
996
|
+
declare function createChatCompletionTool(llmSettings: Thunk<ReadonlyDeep<llmSettings>>, taskManager: TyTaskManager): {
|
|
1011
997
|
chatCompletion: {
|
|
1012
998
|
description: string;
|
|
1013
999
|
longDescription: string;
|
|
@@ -1030,7 +1016,9 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
|
|
|
1030
1016
|
};
|
|
1031
1017
|
readonly llmTools: {
|
|
1032
1018
|
readonly type: "boolean";
|
|
1033
|
-
readonly
|
|
1019
|
+
readonly title: "Use LLM Native Tools";
|
|
1020
|
+
readonly description: "Optional Parameter. If set to true, we will use native tool apis offered by llm providers to generate tool calls in json format. If undefined, it will be treated as false.";
|
|
1021
|
+
readonly default: false;
|
|
1034
1022
|
};
|
|
1035
1023
|
readonly allowedTools: {
|
|
1036
1024
|
readonly type: "array";
|
|
@@ -1051,17 +1039,119 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
|
|
|
1051
1039
|
readonly description: "A json schema object which we can use to generate a specific response and parse it.";
|
|
1052
1040
|
readonly additionalProperties: true;
|
|
1053
1041
|
};
|
|
1042
|
+
readonly reasoning_effort: {
|
|
1043
|
+
readonly enum: ["low", "high", "medium", "none"];
|
|
1044
|
+
readonly description: "How many reasoning tokens should models with reasoning capability use?";
|
|
1045
|
+
readonly title: "Reasoning Effort";
|
|
1046
|
+
};
|
|
1047
|
+
readonly max_results: {
|
|
1048
|
+
readonly type: "integer";
|
|
1049
|
+
readonly description: "[Optional] In case of a WebSearch, how many results should be retrieved at max?";
|
|
1050
|
+
readonly title: "Max Results";
|
|
1051
|
+
readonly default: 5;
|
|
1052
|
+
};
|
|
1053
|
+
readonly verbosity: {
|
|
1054
|
+
readonly type: "string";
|
|
1055
|
+
readonly enum: ["low", "high", "medium"];
|
|
1056
|
+
readonly description: "how verbose should the reponse be?";
|
|
1057
|
+
};
|
|
1058
|
+
readonly use_multimodal: {
|
|
1059
|
+
readonly type: "boolean";
|
|
1060
|
+
readonly title: "Use Vision";
|
|
1061
|
+
readonly description: "Allow models to use their vision/audio & document undestanding capabilities if their are any files in the prompt.";
|
|
1062
|
+
};
|
|
1063
|
+
readonly use_baseprompt: {
|
|
1064
|
+
readonly type: "boolean";
|
|
1065
|
+
readonly title: "Fancy Output";
|
|
1066
|
+
readonly description: "Enable or disable the base prompt chat completion which makes output more fancy or enables customized behaviour.";
|
|
1067
|
+
};
|
|
1068
|
+
readonly context_size: {
|
|
1069
|
+
readonly type: "integer";
|
|
1070
|
+
readonly description: "[Optional] How many of the peceding tasks are going to be used for the chatCompletion?";
|
|
1071
|
+
};
|
|
1072
|
+
readonly prompt_templates: {
|
|
1073
|
+
readonly required: ["basePrompt", "instruction", "toolResult", "task", "evaluate", "schemaReminder", "tools"];
|
|
1074
|
+
readonly type: "object";
|
|
1075
|
+
readonly description: "These are the definitions of the prompts which are used in chats for different purposes.";
|
|
1076
|
+
readonly properties: {
|
|
1077
|
+
readonly basePrompt: {
|
|
1078
|
+
readonly type: "string";
|
|
1079
|
+
readonly description: "The base prompt. This should be used e.g. to set the behaviour of the AI. used as a \"system\" prompt.";
|
|
1080
|
+
};
|
|
1081
|
+
readonly instruction: {
|
|
1082
|
+
readonly type: "string";
|
|
1083
|
+
readonly description: "This prompt is used to make the AI follow instructions";
|
|
1084
|
+
};
|
|
1085
|
+
readonly toolResult: {
|
|
1086
|
+
readonly type: "string";
|
|
1087
|
+
readonly description: "This prompt is used to make the AI display tool results in a certain structured way.";
|
|
1088
|
+
};
|
|
1089
|
+
readonly task: {
|
|
1090
|
+
readonly type: "string";
|
|
1091
|
+
readonly description: "This prompt is used to explain to the AI what to do with a specific task.";
|
|
1092
|
+
};
|
|
1093
|
+
readonly evaluate: {
|
|
1094
|
+
readonly type: "string";
|
|
1095
|
+
readonly description: "This prompt is used to evaluate errors";
|
|
1096
|
+
};
|
|
1097
|
+
readonly schemaReminder: {
|
|
1098
|
+
readonly type: "string";
|
|
1099
|
+
readonly description: "This prompt is used to enforce a specific schema as a response...";
|
|
1100
|
+
};
|
|
1101
|
+
readonly tools: {
|
|
1102
|
+
readonly type: "string";
|
|
1103
|
+
readonly description: "This prompt is used to give the AI a list of tools.";
|
|
1104
|
+
};
|
|
1105
|
+
};
|
|
1106
|
+
};
|
|
1107
|
+
readonly timeouts: {
|
|
1108
|
+
readonly type: "object";
|
|
1109
|
+
readonly description: "[Optional] We can specify different timeouts for the chat completion.";
|
|
1110
|
+
readonly properties: {
|
|
1111
|
+
readonly totalMs: {
|
|
1112
|
+
readonly type: "integer";
|
|
1113
|
+
readonly description: "Total timeout in milliseconds for the entire chat completion process.";
|
|
1114
|
+
readonly default: number;
|
|
1115
|
+
};
|
|
1116
|
+
readonly stepMs: {
|
|
1117
|
+
readonly type: "integer";
|
|
1118
|
+
readonly description: "Timeout in milliseconds for each individual step when interacting with agents.";
|
|
1119
|
+
readonly default: number;
|
|
1120
|
+
};
|
|
1121
|
+
};
|
|
1122
|
+
};
|
|
1054
1123
|
};
|
|
1055
1124
|
};
|
|
1056
|
-
function: (
|
|
1125
|
+
function: (opts: {
|
|
1057
1126
|
model?: string;
|
|
1058
1127
|
schema?: {
|
|
1059
1128
|
[x: string]: unknown;
|
|
1060
1129
|
};
|
|
1130
|
+
verbosity?: "high" | "medium" | "low";
|
|
1131
|
+
max_results?: number;
|
|
1061
1132
|
goal?: "SimpleCompletion" | "AnalyzeError" | "ChooseTool" | "AnalyzeToolResult" | "WebSearch";
|
|
1062
1133
|
llmTools?: boolean;
|
|
1063
1134
|
allowedTools?: string[];
|
|
1064
1135
|
prompts?: string[];
|
|
1136
|
+
reasoning_effort?: "none" | "high" | "medium" | "low";
|
|
1137
|
+
use_multimodal?: boolean;
|
|
1138
|
+
use_baseprompt?: boolean;
|
|
1139
|
+
context_size?: number;
|
|
1140
|
+
prompt_templates?: {
|
|
1141
|
+
[x: string]: unknown;
|
|
1142
|
+
task: string;
|
|
1143
|
+
instruction: string;
|
|
1144
|
+
tools: string;
|
|
1145
|
+
basePrompt: string;
|
|
1146
|
+
toolResult: string;
|
|
1147
|
+
evaluate: string;
|
|
1148
|
+
schemaReminder: string;
|
|
1149
|
+
};
|
|
1150
|
+
timeouts?: {
|
|
1151
|
+
[x: string]: unknown;
|
|
1152
|
+
totalMs?: number;
|
|
1153
|
+
stepMs?: number;
|
|
1154
|
+
};
|
|
1065
1155
|
}, context: toolContext) => Promise<{
|
|
1066
1156
|
taskResultMarker: "*TY_TASKRESULT*";
|
|
1067
1157
|
taskChainList: {
|
|
@@ -1070,20 +1160,17 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
|
|
|
1070
1160
|
type: "message";
|
|
1071
1161
|
data: string;
|
|
1072
1162
|
ann?: ({
|
|
1073
|
-
type: "
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
} | undefined;
|
|
1163
|
+
type: "url";
|
|
1164
|
+
id?: string | undefined;
|
|
1165
|
+
end_index?: number | undefined;
|
|
1166
|
+
start_index?: number | undefined;
|
|
1167
|
+
title?: string | undefined;
|
|
1168
|
+
url?: string | undefined;
|
|
1169
|
+
content?: string | undefined;
|
|
1081
1170
|
} | {
|
|
1082
|
-
type: "
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
type: string;
|
|
1086
|
-
}[] | undefined;
|
|
1171
|
+
type: "document";
|
|
1172
|
+
text?: string | undefined;
|
|
1173
|
+
content?: string | undefined;
|
|
1087
1174
|
})[] | undefined;
|
|
1088
1175
|
} | {
|
|
1089
1176
|
type: "toolresult";
|
|
@@ -1132,12 +1219,12 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
|
|
|
1132
1219
|
}[][];
|
|
1133
1220
|
}>;
|
|
1134
1221
|
};
|
|
1135
|
-
stream: Stream<
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1222
|
+
stream: Stream<chunkStreamType>;
|
|
1223
|
+
};
|
|
1224
|
+
type ChatCompletionTool = Awaited<ReturnType<typeof createChatCompletionTool>>['chatCompletion'];
|
|
1225
|
+
type chatCompletionParams = FromSchema<ChatCompletionTool['parameters'], {
|
|
1226
|
+
keepDefaultedPropertiesOptional: true;
|
|
1139
1227
|
}>;
|
|
1140
|
-
type chatCompletionParams = FromSchema<Awaited<ReturnType<typeof createChatCompletionTool>>['chatCompletion']['parameters']>;
|
|
1141
1228
|
|
|
1142
1229
|
declare const TaskyonMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
1143
1230
|
type: z$1.ZodLiteral<"addTasks">;
|
|
@@ -1161,20 +1248,17 @@ declare const TaskyonMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
1161
1248
|
type: z$1.ZodLiteral<"message">;
|
|
1162
1249
|
data: z$1.ZodString;
|
|
1163
1250
|
ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1164
|
-
type: z$1.ZodLiteral<"
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
}, z$1.core.$strip>>;
|
|
1251
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
|
|
1252
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1253
|
+
end_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1254
|
+
start_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1255
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
1256
|
+
url: z$1.ZodOptional<z$1.ZodString>;
|
|
1257
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
1172
1258
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1173
|
-
type: z$1.ZodLiteral<"
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
type: z$1.ZodString;
|
|
1177
|
-
}, z$1.core.$strip>>>;
|
|
1259
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
|
|
1260
|
+
text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1261
|
+
content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1178
1262
|
}, z$1.core.$strip>]>>>;
|
|
1179
1263
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1180
1264
|
type: z$1.ZodLiteral<"toolresult">;
|
|
@@ -1257,20 +1341,17 @@ declare const TaskyonMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
1257
1341
|
type: z$1.ZodLiteral<"message">;
|
|
1258
1342
|
data: z$1.ZodString;
|
|
1259
1343
|
ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1260
|
-
type: z$1.ZodLiteral<"
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
}, z$1.core.$strip>>;
|
|
1344
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
|
|
1345
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1346
|
+
end_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1347
|
+
start_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1348
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
1349
|
+
url: z$1.ZodOptional<z$1.ZodString>;
|
|
1350
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
1268
1351
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1269
|
-
type: z$1.ZodLiteral<"
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
type: z$1.ZodString;
|
|
1273
|
-
}, z$1.core.$strip>>>;
|
|
1352
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
|
|
1353
|
+
text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1354
|
+
content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1274
1355
|
}, z$1.core.$strip>]>>>;
|
|
1275
1356
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1276
1357
|
type: z$1.ZodLiteral<"toolresult">;
|
|
@@ -1335,20 +1416,17 @@ declare const TaskyonMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
1335
1416
|
type: z$1.ZodLiteral<"message">;
|
|
1336
1417
|
data: z$1.ZodString;
|
|
1337
1418
|
ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1338
|
-
type: z$1.ZodLiteral<"
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
}, z$1.core.$strip>>;
|
|
1419
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
|
|
1420
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1421
|
+
end_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1422
|
+
start_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1423
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
1424
|
+
url: z$1.ZodOptional<z$1.ZodString>;
|
|
1425
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
1346
1426
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1347
|
-
type: z$1.ZodLiteral<"
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
type: z$1.ZodString;
|
|
1351
|
-
}, z$1.core.$strip>>>;
|
|
1427
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
|
|
1428
|
+
text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1429
|
+
content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1352
1430
|
}, z$1.core.$strip>]>>>;
|
|
1353
1431
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1354
1432
|
type: z$1.ZodLiteral<"toolresult">;
|
|
@@ -1433,7 +1511,7 @@ type TaskyonMessage = z$1.infer<typeof TaskyonMessage>;
|
|
|
1433
1511
|
type processTasksOpts = {
|
|
1434
1512
|
timeoutMs?: number;
|
|
1435
1513
|
signal?: AbortSignal;
|
|
1436
|
-
|
|
1514
|
+
show?: boolean;
|
|
1437
1515
|
};
|
|
1438
1516
|
declare const createChatCompletionTask: (args: chatCompletionParams) => {
|
|
1439
1517
|
role: "function" | "system" | "user" | "assistant";
|
|
@@ -1441,20 +1519,17 @@ declare const createChatCompletionTask: (args: chatCompletionParams) => {
|
|
|
1441
1519
|
type: "message";
|
|
1442
1520
|
data: string;
|
|
1443
1521
|
ann?: ({
|
|
1444
|
-
type: "
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
} | undefined;
|
|
1522
|
+
type: "url";
|
|
1523
|
+
id?: string | undefined;
|
|
1524
|
+
end_index?: number | undefined;
|
|
1525
|
+
start_index?: number | undefined;
|
|
1526
|
+
title?: string | undefined;
|
|
1527
|
+
url?: string | undefined;
|
|
1528
|
+
content?: string | undefined;
|
|
1452
1529
|
} | {
|
|
1453
|
-
type: "
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
type: string;
|
|
1457
|
-
}[] | undefined;
|
|
1530
|
+
type: "document";
|
|
1531
|
+
text?: string | undefined;
|
|
1532
|
+
content?: string | undefined;
|
|
1458
1533
|
})[] | undefined;
|
|
1459
1534
|
} | {
|
|
1460
1535
|
type: "toolresult";
|
|
@@ -1506,28 +1581,95 @@ declare const createChatCompletionTask: (args: chatCompletionParams) => {
|
|
|
1506
1581
|
data: FunctionCall;
|
|
1507
1582
|
};
|
|
1508
1583
|
};
|
|
1509
|
-
declare const
|
|
1584
|
+
declare const sendTasks: <T extends {
|
|
1510
1585
|
type: string;
|
|
1511
1586
|
}>(tyPort: Port<T | TaskyonMessage>) => (taskList: partialTaskDraft[][], opts: processTasksOpts) => Promise<{
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1587
|
+
initialIds: string[];
|
|
1588
|
+
subTaskStream: Stream<{
|
|
1589
|
+
role: "function" | "system" | "user" | "assistant";
|
|
1590
|
+
content: {
|
|
1591
|
+
type: "message";
|
|
1592
|
+
data: string;
|
|
1593
|
+
ann?: ({
|
|
1594
|
+
type: "url";
|
|
1595
|
+
id?: string | undefined;
|
|
1519
1596
|
end_index?: number | undefined;
|
|
1520
1597
|
start_index?: number | undefined;
|
|
1521
1598
|
title?: string | undefined;
|
|
1522
1599
|
url?: string | undefined;
|
|
1523
1600
|
content?: string | undefined;
|
|
1524
|
-
} |
|
|
1601
|
+
} | {
|
|
1602
|
+
type: "document";
|
|
1603
|
+
text?: string | undefined;
|
|
1604
|
+
content?: string | undefined;
|
|
1605
|
+
})[] | undefined;
|
|
1606
|
+
} | {
|
|
1607
|
+
type: "toolresult";
|
|
1608
|
+
data: unknown;
|
|
1609
|
+
} | {
|
|
1610
|
+
type: "tooldefinition";
|
|
1611
|
+
data: {
|
|
1612
|
+
description: string;
|
|
1613
|
+
name: string;
|
|
1614
|
+
parameters: Readonly<json_schema.JSONSchema7>;
|
|
1615
|
+
longDescription?: string | undefined;
|
|
1616
|
+
renderOptions?: {
|
|
1617
|
+
hideChat?: boolean | undefined;
|
|
1618
|
+
hideLlm?: boolean | undefined;
|
|
1619
|
+
} | undefined;
|
|
1620
|
+
code?: string | undefined;
|
|
1621
|
+
};
|
|
1622
|
+
} | {
|
|
1623
|
+
type: "error";
|
|
1624
|
+
data: unknown;
|
|
1625
|
+
} | {
|
|
1626
|
+
type: "structured";
|
|
1627
|
+
data: unknown;
|
|
1628
|
+
} | {
|
|
1629
|
+
type: "functioncall";
|
|
1630
|
+
data: {
|
|
1631
|
+
name: string;
|
|
1632
|
+
arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
|
|
1633
|
+
};
|
|
1634
|
+
} | {
|
|
1635
|
+
type: "files";
|
|
1636
|
+
data: string[];
|
|
1637
|
+
} | {
|
|
1638
|
+
type: "return";
|
|
1639
|
+
data: string;
|
|
1640
|
+
};
|
|
1641
|
+
id: string;
|
|
1642
|
+
name?: string | undefined;
|
|
1643
|
+
label?: string[] | undefined;
|
|
1644
|
+
parentID?: string | undefined;
|
|
1645
|
+
priorID?: string | undefined;
|
|
1646
|
+
authorId?: string | undefined;
|
|
1647
|
+
created_at?: number | undefined;
|
|
1648
|
+
acl?: string[] | undefined;
|
|
1649
|
+
sig?: string | undefined;
|
|
1650
|
+
} & {
|
|
1651
|
+
id: string;
|
|
1652
|
+
}>;
|
|
1653
|
+
}>;
|
|
1654
|
+
declare const processTasks: <T extends {
|
|
1655
|
+
type: string;
|
|
1656
|
+
}>(tyPort: Port<T | TaskyonMessage>) => (taskList: partialTaskDraft[][], quitCondition: ((t: TaskNode) => boolean) | TaskContentType | TaskContentType[], opts: processTasksOpts) => Promise<{
|
|
1657
|
+
role: "function" | "system" | "user" | "assistant";
|
|
1658
|
+
content: {
|
|
1659
|
+
type: "message";
|
|
1660
|
+
data: string;
|
|
1661
|
+
ann?: ({
|
|
1662
|
+
type: "url";
|
|
1663
|
+
id?: string | undefined;
|
|
1664
|
+
end_index?: number | undefined;
|
|
1665
|
+
start_index?: number | undefined;
|
|
1666
|
+
title?: string | undefined;
|
|
1667
|
+
url?: string | undefined;
|
|
1668
|
+
content?: string | undefined;
|
|
1525
1669
|
} | {
|
|
1526
|
-
type: "
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
type: string;
|
|
1530
|
-
}[] | undefined;
|
|
1670
|
+
type: "document";
|
|
1671
|
+
text?: string | undefined;
|
|
1672
|
+
content?: string | undefined;
|
|
1531
1673
|
})[] | undefined;
|
|
1532
1674
|
} | {
|
|
1533
1675
|
type: "toolresult";
|
|
@@ -1578,9 +1720,9 @@ declare const processTasks: <T extends {
|
|
|
1578
1720
|
}>;
|
|
1579
1721
|
|
|
1580
1722
|
declare const TyProfile: z$1.ZodObject<{
|
|
1581
|
-
version: z$1.ZodLiteral<
|
|
1723
|
+
version: z$1.ZodLiteral<23>;
|
|
1582
1724
|
appConfiguration: z$1.ZodObject<{
|
|
1583
|
-
darkTheme: z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]
|
|
1725
|
+
darkTheme: z$1.ZodDefault<z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]>>;
|
|
1584
1726
|
appConfigurationUrl: z$1.ZodDefault<z$1.ZodString>;
|
|
1585
1727
|
gdriveConfigurationFile: z$1.ZodDefault<z$1.ZodString>;
|
|
1586
1728
|
enableGdriveSync: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
@@ -1602,6 +1744,7 @@ declare const TyProfile: z$1.ZodObject<{
|
|
|
1602
1744
|
on: "on";
|
|
1603
1745
|
off: "off";
|
|
1604
1746
|
}>>;
|
|
1747
|
+
webSearchButton: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1605
1748
|
guiMode: z$1.ZodDefault<z$1.ZodEnum<{
|
|
1606
1749
|
default: "default";
|
|
1607
1750
|
auto: "auto";
|
|
@@ -1613,10 +1756,8 @@ declare const TyProfile: z$1.ZodObject<{
|
|
|
1613
1756
|
}, z$1.core.$strip>;
|
|
1614
1757
|
llmSettings: z$1.ZodObject<{
|
|
1615
1758
|
userId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
1616
|
-
allowWebSearch: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1617
1759
|
secretPublicKey: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
1618
1760
|
selectedTaskId: z$1.ZodOptional<z$1.ZodString>;
|
|
1619
|
-
enableOpenAiTools: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1620
1761
|
selectedApi: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
1621
1762
|
llmApis: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
1622
1763
|
name: z$1.ZodString;
|
|
@@ -1651,20 +1792,17 @@ declare const TyProfile: z$1.ZodObject<{
|
|
|
1651
1792
|
type: z$1.ZodLiteral<"message">;
|
|
1652
1793
|
data: z$1.ZodString;
|
|
1653
1794
|
ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1654
|
-
type: z$1.ZodLiteral<"
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
}, z$1.core.$strip>>;
|
|
1795
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
|
|
1796
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1797
|
+
end_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1798
|
+
start_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1799
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
1800
|
+
url: z$1.ZodOptional<z$1.ZodString>;
|
|
1801
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
1662
1802
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1663
|
-
type: z$1.ZodLiteral<"
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
type: z$1.ZodString;
|
|
1667
|
-
}, z$1.core.$strip>>>;
|
|
1803
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
|
|
1804
|
+
text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1805
|
+
content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1668
1806
|
}, z$1.core.$strip>]>>>;
|
|
1669
1807
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1670
1808
|
type: z$1.ZodLiteral<"toolresult">;
|
|
@@ -1711,21 +1849,8 @@ declare const TyProfile: z$1.ZodObject<{
|
|
|
1711
1849
|
sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1712
1850
|
}, z$1.core.$strip>>;
|
|
1713
1851
|
enableToolChooser: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1714
|
-
useBasePrompt: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1715
|
-
tryUsingVisionModels: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1716
|
-
taskChatTemplates: z$1.ZodObject<{
|
|
1717
|
-
basePrompt: z$1.ZodString;
|
|
1718
|
-
instruction: z$1.ZodString;
|
|
1719
|
-
toolResult: z$1.ZodString;
|
|
1720
|
-
task: z$1.ZodString;
|
|
1721
|
-
evaluate: z$1.ZodString;
|
|
1722
|
-
schemaReminder: z$1.ZodString;
|
|
1723
|
-
tools: z$1.ZodString;
|
|
1724
|
-
}, z$1.core.$strip>;
|
|
1725
|
-
}, z$1.core.$strip>;
|
|
1726
|
-
toolchainConfig: z$1.ZodObject<{
|
|
1727
|
-
tools: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodJSONSchema>>;
|
|
1728
1852
|
}, z$1.core.$strip>;
|
|
1853
|
+
toolchainConfig: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber, z$1.ZodBoolean, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodArray<z$1.ZodUnknown>, z$1.ZodNull, z$1.ZodUndefined]>>>>;
|
|
1729
1854
|
signatureOrKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1730
1855
|
}, z$1.core.$strip>;
|
|
1731
1856
|
type TyProfile = z$1.infer<typeof TyProfile>;
|
|
@@ -1753,20 +1878,17 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
1753
1878
|
type: z$1.ZodLiteral<"message">;
|
|
1754
1879
|
data: z$1.ZodString;
|
|
1755
1880
|
ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1756
|
-
type: z$1.ZodLiteral<"
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
}, z$1.core.$strip>>;
|
|
1881
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
|
|
1882
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1883
|
+
end_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1884
|
+
start_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1885
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
1886
|
+
url: z$1.ZodOptional<z$1.ZodString>;
|
|
1887
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
1764
1888
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1765
|
-
type: z$1.ZodLiteral<"
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
type: z$1.ZodString;
|
|
1769
|
-
}, z$1.core.$strip>>>;
|
|
1889
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
|
|
1890
|
+
text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1891
|
+
content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1770
1892
|
}, z$1.core.$strip>]>>>;
|
|
1771
1893
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1772
1894
|
type: z$1.ZodLiteral<"toolresult">;
|
|
@@ -1849,20 +1971,17 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
1849
1971
|
type: z$1.ZodLiteral<"message">;
|
|
1850
1972
|
data: z$1.ZodString;
|
|
1851
1973
|
ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1852
|
-
type: z$1.ZodLiteral<"
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
}, z$1.core.$strip>>;
|
|
1974
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
|
|
1975
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1976
|
+
end_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1977
|
+
start_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1978
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
1979
|
+
url: z$1.ZodOptional<z$1.ZodString>;
|
|
1980
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
1860
1981
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1861
|
-
type: z$1.ZodLiteral<"
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
type: z$1.ZodString;
|
|
1865
|
-
}, z$1.core.$strip>>>;
|
|
1982
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
|
|
1983
|
+
text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1984
|
+
content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1866
1985
|
}, z$1.core.$strip>]>>>;
|
|
1867
1986
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1868
1987
|
type: z$1.ZodLiteral<"toolresult">;
|
|
@@ -1927,20 +2046,17 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
1927
2046
|
type: z$1.ZodLiteral<"message">;
|
|
1928
2047
|
data: z$1.ZodString;
|
|
1929
2048
|
ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1930
|
-
type: z$1.ZodLiteral<"
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
}, z$1.core.$strip>>;
|
|
2049
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
|
|
2050
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
2051
|
+
end_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2052
|
+
start_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2053
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
2054
|
+
url: z$1.ZodOptional<z$1.ZodString>;
|
|
2055
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
1938
2056
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1939
|
-
type: z$1.ZodLiteral<"
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
type: z$1.ZodString;
|
|
1943
|
-
}, z$1.core.$strip>>>;
|
|
2057
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
|
|
2058
|
+
text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2059
|
+
content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1944
2060
|
}, z$1.core.$strip>]>>>;
|
|
1945
2061
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1946
2062
|
type: z$1.ZodLiteral<"toolresult">;
|
|
@@ -2023,9 +2139,9 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
2023
2139
|
type: z$1.ZodLiteral<"configurationMessage">;
|
|
2024
2140
|
persist: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2025
2141
|
conf: z$1.ZodUnion<readonly [z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodObject<{
|
|
2026
|
-
version: z$1.ZodLiteral<
|
|
2142
|
+
version: z$1.ZodLiteral<23>;
|
|
2027
2143
|
appConfiguration: z$1.ZodObject<{
|
|
2028
|
-
darkTheme: z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]
|
|
2144
|
+
darkTheme: z$1.ZodDefault<z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]>>;
|
|
2029
2145
|
appConfigurationUrl: z$1.ZodDefault<z$1.ZodString>;
|
|
2030
2146
|
gdriveConfigurationFile: z$1.ZodDefault<z$1.ZodString>;
|
|
2031
2147
|
enableGdriveSync: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
@@ -2047,6 +2163,7 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
2047
2163
|
on: "on";
|
|
2048
2164
|
off: "off";
|
|
2049
2165
|
}>>;
|
|
2166
|
+
webSearchButton: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2050
2167
|
guiMode: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2051
2168
|
default: "default";
|
|
2052
2169
|
auto: "auto";
|
|
@@ -2058,10 +2175,8 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
2058
2175
|
}, z$1.core.$strip>;
|
|
2059
2176
|
llmSettings: z$1.ZodObject<{
|
|
2060
2177
|
userId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
2061
|
-
allowWebSearch: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2062
2178
|
secretPublicKey: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
2063
2179
|
selectedTaskId: z$1.ZodOptional<z$1.ZodString>;
|
|
2064
|
-
enableOpenAiTools: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
2065
2180
|
selectedApi: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
2066
2181
|
llmApis: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
2067
2182
|
name: z$1.ZodString;
|
|
@@ -2096,20 +2211,17 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
2096
2211
|
type: z$1.ZodLiteral<"message">;
|
|
2097
2212
|
data: z$1.ZodString;
|
|
2098
2213
|
ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
2099
|
-
type: z$1.ZodLiteral<"
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
}, z$1.core.$strip>>;
|
|
2214
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
|
|
2215
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
2216
|
+
end_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2217
|
+
start_index: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2218
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
2219
|
+
url: z$1.ZodOptional<z$1.ZodString>;
|
|
2220
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
2107
2221
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2108
|
-
type: z$1.ZodLiteral<"
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
type: z$1.ZodString;
|
|
2112
|
-
}, z$1.core.$strip>>>;
|
|
2222
|
+
type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
|
|
2223
|
+
text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2224
|
+
content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2113
2225
|
}, z$1.core.$strip>]>>>;
|
|
2114
2226
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
2115
2227
|
type: z$1.ZodLiteral<"toolresult">;
|
|
@@ -2156,21 +2268,8 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
2156
2268
|
sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2157
2269
|
}, z$1.core.$strip>>;
|
|
2158
2270
|
enableToolChooser: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
2159
|
-
useBasePrompt: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
2160
|
-
tryUsingVisionModels: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
2161
|
-
taskChatTemplates: z$1.ZodObject<{
|
|
2162
|
-
basePrompt: z$1.ZodString;
|
|
2163
|
-
instruction: z$1.ZodString;
|
|
2164
|
-
toolResult: z$1.ZodString;
|
|
2165
|
-
task: z$1.ZodString;
|
|
2166
|
-
evaluate: z$1.ZodString;
|
|
2167
|
-
schemaReminder: z$1.ZodString;
|
|
2168
|
-
tools: z$1.ZodString;
|
|
2169
|
-
}, z$1.core.$strip>;
|
|
2170
|
-
}, z$1.core.$strip>;
|
|
2171
|
-
toolchainConfig: z$1.ZodObject<{
|
|
2172
|
-
tools: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodJSONSchema>>;
|
|
2173
2271
|
}, z$1.core.$strip>;
|
|
2272
|
+
toolchainConfig: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber, z$1.ZodBoolean, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodArray<z$1.ZodUnknown>, z$1.ZodNull, z$1.ZodUndefined]>>>>;
|
|
2174
2273
|
signatureOrKey: z$1.ZodOptional<z$1.ZodString>;
|
|
2175
2274
|
}, z$1.core.$strip>]>;
|
|
2176
2275
|
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -2179,15 +2278,23 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
2179
2278
|
type TaskyonGuiMessage = z$1.infer<typeof TaskyonGuiMessage>;
|
|
2180
2279
|
|
|
2181
2280
|
interface TyClient {
|
|
2182
|
-
|
|
2281
|
+
sendTasks: ReturnType<typeof sendTasks>;
|
|
2282
|
+
waitForTaskResult: ReturnType<typeof processTasks>;
|
|
2183
2283
|
port: Port<TaskyonGuiMessage, TaskyonGuiMessage>;
|
|
2184
2284
|
sendFile: (file: File) => Promise<string>;
|
|
2285
|
+
reconfigure: (options: {
|
|
2286
|
+
name?: string;
|
|
2287
|
+
persist?: boolean;
|
|
2288
|
+
tools: ClientTool[];
|
|
2289
|
+
configuration: partialTyConfiguration;
|
|
2290
|
+
}) => void;
|
|
2185
2291
|
}
|
|
2186
2292
|
declare function initializeTaskyon(options: {
|
|
2187
2293
|
name?: string;
|
|
2188
2294
|
persist?: boolean;
|
|
2189
2295
|
tools: ClientTool[];
|
|
2190
2296
|
configuration: partialTyConfiguration;
|
|
2297
|
+
iframeId?: string;
|
|
2191
2298
|
}): Promise<TyClient>;
|
|
2192
2299
|
|
|
2193
2300
|
export { type ClientTool, TaskyonGuiMessage, TaskyonMessage, type TyClient, createChatCompletionTask, createTool, initializeTaskyon, makeTaskResult, partialTaskDraft, type partialTyConfiguration, processTasks, toolCall };
|