@workglow/ai 0.0.110 → 0.0.113
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/browser.js +183 -156
- package/dist/browser.js.map +13 -13
- package/dist/bun.js +183 -156
- package/dist/bun.js.map +13 -13
- package/dist/node.js +183 -156
- package/dist/node.js.map +13 -13
- package/dist/task/ChunkRetrievalTask.d.ts +38 -9
- package/dist/task/ChunkRetrievalTask.d.ts.map +1 -1
- package/dist/task/ChunkToVectorTask.d.ts +61 -41
- package/dist/task/ChunkToVectorTask.d.ts.map +1 -1
- package/dist/task/ChunkVectorHybridSearchTask.d.ts +16 -11
- package/dist/task/ChunkVectorHybridSearchTask.d.ts.map +1 -1
- package/dist/task/ChunkVectorSearchTask.d.ts +9 -9
- package/dist/task/ChunkVectorSearchTask.d.ts.map +1 -1
- package/dist/task/ChunkVectorUpsertTask.d.ts +8 -8
- package/dist/task/ChunkVectorUpsertTask.d.ts.map +1 -1
- package/dist/task/HierarchicalChunkerTask.d.ts +67 -44
- package/dist/task/HierarchicalChunkerTask.d.ts.map +1 -1
- package/dist/task/HierarchyJoinTask.d.ts +69 -42
- package/dist/task/HierarchyJoinTask.d.ts.map +1 -1
- package/dist/task/QueryExpanderTask.d.ts +3 -3
- package/dist/task/ToolCallingTask.d.ts +87 -40
- package/dist/task/ToolCallingTask.d.ts.map +1 -1
- package/dist/task/index.d.ts +1 -1
- package/dist/task/index.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -8,19 +8,19 @@ import { DataPortSchema, FromSchema } from "@workglow/util";
|
|
|
8
8
|
declare const inputSchema: {
|
|
9
9
|
readonly type: "object";
|
|
10
10
|
readonly properties: {
|
|
11
|
-
readonly
|
|
12
|
-
readonly title: "
|
|
13
|
-
readonly description: "
|
|
11
|
+
readonly knowledgeBase: {
|
|
12
|
+
readonly title: "Knowledge Base";
|
|
13
|
+
readonly description: "Knowledge base ID or instance";
|
|
14
14
|
} & {
|
|
15
15
|
title: string;
|
|
16
16
|
description: string;
|
|
17
17
|
} & {
|
|
18
|
-
readonly format: "dataset:
|
|
18
|
+
readonly format: "dataset:knowledge-base";
|
|
19
19
|
readonly anyOf: readonly [{
|
|
20
20
|
readonly type: "string";
|
|
21
|
-
readonly title: "
|
|
21
|
+
readonly title: "Knowledge Base ID";
|
|
22
22
|
}, {
|
|
23
|
-
readonly title: "
|
|
23
|
+
readonly title: "Knowledge Base Instance";
|
|
24
24
|
readonly additionalProperties: true;
|
|
25
25
|
}];
|
|
26
26
|
};
|
|
@@ -45,25 +45,15 @@ declare const inputSchema: {
|
|
|
45
45
|
readonly items: {
|
|
46
46
|
readonly type: "object";
|
|
47
47
|
readonly properties: {
|
|
48
|
-
readonly doc_id: {
|
|
49
|
-
readonly type: "string";
|
|
50
|
-
readonly title: "Document ID";
|
|
51
|
-
readonly description: "ID of the parent document";
|
|
52
|
-
};
|
|
53
48
|
readonly chunkId: {
|
|
54
49
|
readonly type: "string";
|
|
55
50
|
readonly title: "Chunk ID";
|
|
56
51
|
readonly description: "Unique identifier for this chunk";
|
|
57
52
|
};
|
|
58
|
-
readonly
|
|
53
|
+
readonly doc_id: {
|
|
59
54
|
readonly type: "string";
|
|
60
|
-
readonly title: "
|
|
61
|
-
readonly description: "ID of the
|
|
62
|
-
};
|
|
63
|
-
readonly depth: {
|
|
64
|
-
readonly type: "integer";
|
|
65
|
-
readonly title: "Depth";
|
|
66
|
-
readonly description: "Depth in the document tree";
|
|
55
|
+
readonly title: "Document ID";
|
|
56
|
+
readonly description: "ID of the parent document";
|
|
67
57
|
};
|
|
68
58
|
readonly text: {
|
|
69
59
|
readonly type: "string";
|
|
@@ -78,6 +68,16 @@ declare const inputSchema: {
|
|
|
78
68
|
readonly title: "Node Path";
|
|
79
69
|
readonly description: "Node IDs from root to leaf";
|
|
80
70
|
};
|
|
71
|
+
readonly depth: {
|
|
72
|
+
readonly type: "integer";
|
|
73
|
+
readonly title: "Depth";
|
|
74
|
+
readonly description: "Depth in the document tree";
|
|
75
|
+
};
|
|
76
|
+
readonly leafNodeId: {
|
|
77
|
+
readonly type: "string";
|
|
78
|
+
readonly title: "Leaf Node ID";
|
|
79
|
+
readonly description: "ID of the leaf node this chunk belongs to";
|
|
80
|
+
};
|
|
81
81
|
readonly summary: {
|
|
82
82
|
readonly type: "string";
|
|
83
83
|
readonly title: "Summary";
|
|
@@ -110,12 +110,33 @@ declare const inputSchema: {
|
|
|
110
110
|
readonly title: "Entities";
|
|
111
111
|
readonly description: "Named entities extracted from the chunk";
|
|
112
112
|
};
|
|
113
|
+
readonly parentSummaries: {
|
|
114
|
+
readonly type: "array";
|
|
115
|
+
readonly items: {
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
};
|
|
118
|
+
readonly title: "Parent Summaries";
|
|
119
|
+
readonly description: "Summaries from ancestor nodes";
|
|
120
|
+
};
|
|
121
|
+
readonly sectionTitles: {
|
|
122
|
+
readonly type: "array";
|
|
123
|
+
readonly items: {
|
|
124
|
+
readonly type: "string";
|
|
125
|
+
};
|
|
126
|
+
readonly title: "Section Titles";
|
|
127
|
+
readonly description: "Titles of ancestor section nodes";
|
|
128
|
+
};
|
|
129
|
+
readonly doc_title: {
|
|
130
|
+
readonly type: "string";
|
|
131
|
+
readonly title: "Document Title";
|
|
132
|
+
readonly description: "Title of the parent document";
|
|
133
|
+
};
|
|
113
134
|
};
|
|
114
|
-
readonly required: readonly ["
|
|
135
|
+
readonly required: readonly ["chunkId", "doc_id", "text", "nodePath", "depth"];
|
|
115
136
|
readonly additionalProperties: true;
|
|
116
137
|
};
|
|
117
|
-
readonly title: "Chunk
|
|
118
|
-
readonly description: "
|
|
138
|
+
readonly title: "Chunk Records";
|
|
139
|
+
readonly description: "Array of chunk records";
|
|
119
140
|
};
|
|
120
141
|
readonly scores: {
|
|
121
142
|
readonly type: "array";
|
|
@@ -138,7 +159,7 @@ declare const inputSchema: {
|
|
|
138
159
|
readonly default: true;
|
|
139
160
|
};
|
|
140
161
|
};
|
|
141
|
-
readonly required: readonly ["
|
|
162
|
+
readonly required: readonly ["knowledgeBase", "chunks", "chunk_ids", "metadata", "scores"];
|
|
142
163
|
readonly additionalProperties: false;
|
|
143
164
|
};
|
|
144
165
|
declare const outputSchema: {
|
|
@@ -165,25 +186,15 @@ declare const outputSchema: {
|
|
|
165
186
|
readonly items: {
|
|
166
187
|
readonly type: "object";
|
|
167
188
|
readonly properties: {
|
|
168
|
-
readonly doc_id: {
|
|
169
|
-
readonly type: "string";
|
|
170
|
-
readonly title: "Document ID";
|
|
171
|
-
readonly description: "ID of the parent document";
|
|
172
|
-
};
|
|
173
189
|
readonly chunkId: {
|
|
174
190
|
readonly type: "string";
|
|
175
191
|
readonly title: "Chunk ID";
|
|
176
192
|
readonly description: "Unique identifier for this chunk";
|
|
177
193
|
};
|
|
178
|
-
readonly
|
|
194
|
+
readonly doc_id: {
|
|
179
195
|
readonly type: "string";
|
|
180
|
-
readonly title: "
|
|
181
|
-
readonly description: "ID of the
|
|
182
|
-
};
|
|
183
|
-
readonly depth: {
|
|
184
|
-
readonly type: "integer";
|
|
185
|
-
readonly title: "Depth";
|
|
186
|
-
readonly description: "Depth in the document tree";
|
|
196
|
+
readonly title: "Document ID";
|
|
197
|
+
readonly description: "ID of the parent document";
|
|
187
198
|
};
|
|
188
199
|
readonly text: {
|
|
189
200
|
readonly type: "string";
|
|
@@ -198,6 +209,16 @@ declare const outputSchema: {
|
|
|
198
209
|
readonly title: "Node Path";
|
|
199
210
|
readonly description: "Node IDs from root to leaf";
|
|
200
211
|
};
|
|
212
|
+
readonly depth: {
|
|
213
|
+
readonly type: "integer";
|
|
214
|
+
readonly title: "Depth";
|
|
215
|
+
readonly description: "Depth in the document tree";
|
|
216
|
+
};
|
|
217
|
+
readonly leafNodeId: {
|
|
218
|
+
readonly type: "string";
|
|
219
|
+
readonly title: "Leaf Node ID";
|
|
220
|
+
readonly description: "ID of the leaf node this chunk belongs to";
|
|
221
|
+
};
|
|
201
222
|
readonly summary: {
|
|
202
223
|
readonly type: "string";
|
|
203
224
|
readonly title: "Summary";
|
|
@@ -228,7 +249,7 @@ declare const outputSchema: {
|
|
|
228
249
|
readonly additionalProperties: false;
|
|
229
250
|
};
|
|
230
251
|
readonly title: "Entities";
|
|
231
|
-
readonly description: "Named entities
|
|
252
|
+
readonly description: "Named entities extracted from the chunk";
|
|
232
253
|
};
|
|
233
254
|
readonly parentSummaries: {
|
|
234
255
|
readonly type: "array";
|
|
@@ -246,12 +267,17 @@ declare const outputSchema: {
|
|
|
246
267
|
readonly title: "Section Titles";
|
|
247
268
|
readonly description: "Titles of ancestor section nodes";
|
|
248
269
|
};
|
|
270
|
+
readonly doc_title: {
|
|
271
|
+
readonly type: "string";
|
|
272
|
+
readonly title: "Document Title";
|
|
273
|
+
readonly description: "Title of the parent document";
|
|
274
|
+
};
|
|
249
275
|
};
|
|
250
|
-
readonly required: readonly ["
|
|
276
|
+
readonly required: readonly ["chunkId", "doc_id", "text", "nodePath", "depth"];
|
|
251
277
|
readonly additionalProperties: true;
|
|
252
278
|
};
|
|
253
|
-
readonly title: "
|
|
254
|
-
readonly description: "
|
|
279
|
+
readonly title: "Chunk Records";
|
|
280
|
+
readonly description: "Array of chunk records";
|
|
255
281
|
};
|
|
256
282
|
readonly scores: {
|
|
257
283
|
readonly type: "array";
|
|
@@ -274,7 +300,7 @@ export type HierarchyJoinTaskInput = FromSchema<typeof inputSchema>;
|
|
|
274
300
|
export type HierarchyJoinTaskOutput = FromSchema<typeof outputSchema>;
|
|
275
301
|
/**
|
|
276
302
|
* Task for enriching search results with hierarchy information
|
|
277
|
-
* Joins chunk IDs back to
|
|
303
|
+
* Joins chunk IDs back to knowledge base to get parent summaries and entities
|
|
278
304
|
*/
|
|
279
305
|
export declare class HierarchyJoinTask extends Task<HierarchyJoinTaskInput, HierarchyJoinTaskOutput, JobQueueTaskConfig> {
|
|
280
306
|
static type: string;
|
|
@@ -289,6 +315,8 @@ export declare class HierarchyJoinTask extends Task<HierarchyJoinTaskInput, Hier
|
|
|
289
315
|
export declare const hierarchyJoin: (input: HierarchyJoinTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
290
316
|
metadata: {
|
|
291
317
|
[x: string]: unknown;
|
|
318
|
+
doc_title?: string | undefined;
|
|
319
|
+
leafNodeId?: string | undefined;
|
|
292
320
|
summary?: string | undefined;
|
|
293
321
|
entities?: {
|
|
294
322
|
type: string;
|
|
@@ -302,7 +330,6 @@ export declare const hierarchyJoin: (input: HierarchyJoinTaskInput, config?: Job
|
|
|
302
330
|
text: string;
|
|
303
331
|
nodePath: string[];
|
|
304
332
|
depth: number;
|
|
305
|
-
leafNodeId: string;
|
|
306
333
|
}[];
|
|
307
334
|
chunks: string[];
|
|
308
335
|
count: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyJoinTask.d.ts","sourceRoot":"","sources":["../../src/task/HierarchyJoinTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"HierarchyJoinTask.d.ts","sourceRoot":"","sources":["../../src/task/HierarchyJoinTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EACL,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,IAAI,EAEL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCkB,CAAC;AAEpC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BiB,CAAC;AAEpC,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AACpE,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtE;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,IAAI,CACzC,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,CACnB;IACC,OAAc,IAAI,SAAuB;IACzC,OAAc,QAAQ,SAAS;IAC/B,OAAc,KAAK,SAAoB;IACvC,OAAc,WAAW,SAA2D;IACpF,OAAc,SAAS,UAAS;WAElB,WAAW,IAAI,cAAc;WAI7B,YAAY,IAAI,cAAc;IAItC,OAAO,CACX,KAAK,EAAE,sBAAsB,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,uBAAuB,CAAC;CAiGpC;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,sBAAsB,EAAE,SAAS,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;EAEvF,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,aAAa,EAAE,cAAc,CAC3B,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,CACnB,CAAC;KACH;CACF"}
|
|
@@ -47,7 +47,7 @@ declare const inputSchema: {
|
|
|
47
47
|
declare const outputSchema: {
|
|
48
48
|
readonly type: "object";
|
|
49
49
|
readonly properties: {
|
|
50
|
-
readonly
|
|
50
|
+
readonly query: {
|
|
51
51
|
readonly type: "array";
|
|
52
52
|
readonly items: {
|
|
53
53
|
readonly type: "string";
|
|
@@ -71,7 +71,7 @@ declare const outputSchema: {
|
|
|
71
71
|
readonly description: "Number of queries generated";
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
-
readonly required: readonly ["
|
|
74
|
+
readonly required: readonly ["query", "originalQuery", "method", "count"];
|
|
75
75
|
readonly additionalProperties: false;
|
|
76
76
|
};
|
|
77
77
|
export type QueryExpanderTaskInput = FromSchema<typeof inputSchema>;
|
|
@@ -116,8 +116,8 @@ export declare class QueryExpanderTask extends Task<QueryExpanderTaskInput, Quer
|
|
|
116
116
|
}
|
|
117
117
|
export declare const queryExpander: (input: QueryExpanderTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
118
118
|
count: number;
|
|
119
|
+
query: string[];
|
|
119
120
|
method: string;
|
|
120
|
-
queries: string[];
|
|
121
121
|
originalQuery: string;
|
|
122
122
|
}>;
|
|
123
123
|
declare module "@workglow/task-graph" {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { CreateWorkflow, JobQueueTaskConfig } from "@workglow/task-graph";
|
|
7
|
-
import { DataPortSchema, FromSchema, JsonSchema } from "@workglow/util";
|
|
7
|
+
import { DataPortSchema, FromSchema, JsonSchema, ServiceRegistry } from "@workglow/util";
|
|
8
8
|
import { StreamingAiTask } from "./base/StreamingAiTask";
|
|
9
9
|
/**
|
|
10
10
|
* A tool definition that can be passed to an LLM for tool calling.
|
|
11
11
|
* Can be created manually or generated from TaskRegistry entries via {@link taskTypesToTools}.
|
|
12
12
|
*/
|
|
13
13
|
export interface ToolDefinition {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
inputSchema: JsonSchema;
|
|
17
|
+
outputSchema?: JsonSchema;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* A tool call returned by the LLM, requesting invocation of a specific tool.
|
|
21
21
|
*/
|
|
22
22
|
export interface ToolCall {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
input: Record<string, unknown>;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Controls which tools the model may call.
|
|
@@ -48,17 +48,47 @@ export declare function isAllowedToolName(name: string, allowedTools: ReadonlyAr
|
|
|
48
48
|
*/
|
|
49
49
|
export declare function filterValidToolCalls(toolCalls: Record<string, unknown>, allowedTools: ReadonlyArray<ToolDefinition>): Record<string, unknown>;
|
|
50
50
|
/**
|
|
51
|
-
* Converts an allow-list of task type names
|
|
52
|
-
*
|
|
51
|
+
* Converts an allow-list of task type names into {@link ToolDefinition} objects
|
|
52
|
+
* suitable for the ToolCallingTask input.
|
|
53
53
|
*
|
|
54
54
|
* Each task's `type`, `description`, `inputSchema()`, and `outputSchema()`
|
|
55
55
|
* are used to build the tool definition.
|
|
56
56
|
*
|
|
57
|
-
* @param taskNames - Array of task type names registered in
|
|
57
|
+
* @param taskNames - Array of task type names registered in the task constructors
|
|
58
|
+
* @param registry - Optional service registry for DI-based lookups
|
|
58
59
|
* @returns Array of ToolDefinition objects
|
|
59
60
|
* @throws Error if a task name is not found in the registry
|
|
60
61
|
*/
|
|
61
|
-
export declare function taskTypesToTools(taskNames: ReadonlyArray<string
|
|
62
|
+
export declare function taskTypesToTools(taskNames: ReadonlyArray<string>, registry?: ServiceRegistry): ToolDefinition[];
|
|
63
|
+
export declare const ToolDefinitionSchema: {
|
|
64
|
+
readonly type: "object";
|
|
65
|
+
readonly properties: {
|
|
66
|
+
readonly name: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
readonly title: "Name";
|
|
69
|
+
readonly description: "The tool name";
|
|
70
|
+
};
|
|
71
|
+
readonly description: {
|
|
72
|
+
readonly type: "string";
|
|
73
|
+
readonly title: "Description";
|
|
74
|
+
readonly description: "A description of what the tool does";
|
|
75
|
+
};
|
|
76
|
+
readonly inputSchema: {
|
|
77
|
+
readonly type: "object";
|
|
78
|
+
readonly title: "Input Schema";
|
|
79
|
+
readonly description: "JSON Schema describing the tool's input parameters";
|
|
80
|
+
readonly additionalProperties: true;
|
|
81
|
+
};
|
|
82
|
+
readonly outputSchema: {
|
|
83
|
+
readonly type: "object";
|
|
84
|
+
readonly title: "Output Schema";
|
|
85
|
+
readonly description: "JSON Schema describing what the tool returns";
|
|
86
|
+
readonly additionalProperties: true;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
readonly required: readonly ["name", "description", "inputSchema"];
|
|
90
|
+
readonly additionalProperties: false;
|
|
91
|
+
};
|
|
62
92
|
export declare const ToolCallingInputSchema: {
|
|
63
93
|
readonly type: "object";
|
|
64
94
|
readonly properties: {
|
|
@@ -140,36 +170,43 @@ export declare const ToolCallingInputSchema: {
|
|
|
140
170
|
};
|
|
141
171
|
readonly tools: {
|
|
142
172
|
readonly type: "array";
|
|
173
|
+
readonly format: "tasks";
|
|
143
174
|
readonly title: "Tools";
|
|
144
175
|
readonly description: "Tool definitions available for the model to call";
|
|
145
176
|
readonly items: {
|
|
146
|
-
readonly
|
|
147
|
-
|
|
148
|
-
readonly
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
177
|
+
readonly oneOf: readonly [{
|
|
178
|
+
readonly type: "string";
|
|
179
|
+
readonly format: "tasks";
|
|
180
|
+
readonly description: "Task type name";
|
|
181
|
+
}, {
|
|
182
|
+
readonly type: "object";
|
|
183
|
+
readonly properties: {
|
|
184
|
+
readonly name: {
|
|
185
|
+
readonly type: "string";
|
|
186
|
+
readonly title: "Name";
|
|
187
|
+
readonly description: "The tool name";
|
|
188
|
+
};
|
|
189
|
+
readonly description: {
|
|
190
|
+
readonly type: "string";
|
|
191
|
+
readonly title: "Description";
|
|
192
|
+
readonly description: "A description of what the tool does";
|
|
193
|
+
};
|
|
194
|
+
readonly inputSchema: {
|
|
195
|
+
readonly type: "object";
|
|
196
|
+
readonly title: "Input Schema";
|
|
197
|
+
readonly description: "JSON Schema describing the tool's input parameters";
|
|
198
|
+
readonly additionalProperties: true;
|
|
199
|
+
};
|
|
200
|
+
readonly outputSchema: {
|
|
201
|
+
readonly type: "object";
|
|
202
|
+
readonly title: "Output Schema";
|
|
203
|
+
readonly description: "JSON Schema describing what the tool returns";
|
|
204
|
+
readonly additionalProperties: true;
|
|
205
|
+
};
|
|
169
206
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
207
|
+
readonly required: readonly ["name", "description", "inputSchema"];
|
|
208
|
+
readonly additionalProperties: false;
|
|
209
|
+
}];
|
|
173
210
|
};
|
|
174
211
|
};
|
|
175
212
|
readonly toolChoice: {
|
|
@@ -238,7 +275,17 @@ export declare const ToolCallingOutputSchema: {
|
|
|
238
275
|
readonly required: readonly ["text", "toolCalls"];
|
|
239
276
|
readonly additionalProperties: false;
|
|
240
277
|
};
|
|
241
|
-
|
|
278
|
+
/**
|
|
279
|
+
* Runtime input type for ToolCallingTask.
|
|
280
|
+
*
|
|
281
|
+
* The schema uses `oneOf: [string, object]` so the UI can accept both task-name
|
|
282
|
+
* references and inline tool definitions, but the input resolver converts all
|
|
283
|
+
* strings to {@link ToolDefinition} objects before execution. The `tools` field
|
|
284
|
+
* is therefore narrowed to `ToolDefinition[]` here.
|
|
285
|
+
*/
|
|
286
|
+
export type ToolCallingTaskInput = Omit<FromSchema<typeof ToolCallingInputSchema>, "tools"> & {
|
|
287
|
+
readonly tools: ToolDefinition[];
|
|
288
|
+
};
|
|
242
289
|
export type ToolCallingTaskOutput = FromSchema<typeof ToolCallingOutputSchema>;
|
|
243
290
|
export declare class ToolCallingTask extends StreamingAiTask<ToolCallingTaskInput, ToolCallingTaskOutput, JobQueueTaskConfig> {
|
|
244
291
|
static type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolCallingTask.d.ts","sourceRoot":"","sources":["../../src/task/ToolCallingTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"ToolCallingTask.d.ts","sourceRoot":"","sources":["../../src/task/ToolCallingTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EAEd,kBAAkB,EAEnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAa,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEpG,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAMzD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAM5E;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAMjE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,GAC1C,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,GAC1C,MAAM,CAAC,M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EAAE,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;KAC9F;CACF"}
|
package/dist/task/index.d.ts
CHANGED
|
@@ -39,8 +39,8 @@ import { TextNamedEntityRecognitionTask } from "./TextNamedEntityRecognitionTask
|
|
|
39
39
|
import { TextQuestionAnswerTask } from "./TextQuestionAnswerTask";
|
|
40
40
|
import { TextRewriterTask } from "./TextRewriterTask";
|
|
41
41
|
import { TextSummaryTask } from "./TextSummaryTask";
|
|
42
|
-
import { ToolCallingTask } from "./ToolCallingTask";
|
|
43
42
|
import { TextTranslationTask } from "./TextTranslationTask";
|
|
43
|
+
import { ToolCallingTask } from "./ToolCallingTask";
|
|
44
44
|
import { TopicSegmenterTask } from "./TopicSegmenterTask";
|
|
45
45
|
import { UnloadModelTask } from "./UnloadModelTask";
|
|
46
46
|
import { VectorQuantizeTask } from "./VectorQuantizeTask";
|
package/dist/task/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAA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,cAAc,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workglow/ai",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.113",
|
|
5
5
|
"description": "Core AI functionality for Workglow, including task execution, model management, and AI pipeline orchestration.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"watch": "concurrently -c 'auto' 'bun:watch-*'",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@workglow/dataset": "0.0.
|
|
41
|
-
"@workglow/job-queue": "0.0.
|
|
42
|
-
"@workglow/storage": "0.0.
|
|
43
|
-
"@workglow/task-graph": "0.0.
|
|
44
|
-
"@workglow/util": "0.0.
|
|
40
|
+
"@workglow/dataset": "0.0.113",
|
|
41
|
+
"@workglow/job-queue": "0.0.113",
|
|
42
|
+
"@workglow/storage": "0.0.113",
|
|
43
|
+
"@workglow/task-graph": "0.0.113",
|
|
44
|
+
"@workglow/util": "0.0.113"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"@workglow/dataset": {
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@workglow/dataset": "0.0.
|
|
65
|
-
"@workglow/job-queue": "0.0.
|
|
66
|
-
"@workglow/storage": "0.0.
|
|
67
|
-
"@workglow/task-graph": "0.0.
|
|
68
|
-
"@workglow/util": "0.0.
|
|
64
|
+
"@workglow/dataset": "0.0.113",
|
|
65
|
+
"@workglow/job-queue": "0.0.113",
|
|
66
|
+
"@workglow/storage": "0.0.113",
|
|
67
|
+
"@workglow/task-graph": "0.0.113",
|
|
68
|
+
"@workglow/util": "0.0.113"
|
|
69
69
|
}
|
|
70
70
|
}
|