@workglow/ai 0.2.8 → 0.2.9
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 +652 -209
- package/dist/browser.js.map +14 -12
- package/dist/bun.js +652 -209
- package/dist/bun.js.map +14 -12
- package/dist/execution/QueuedExecutionStrategy.d.ts +14 -5
- package/dist/execution/QueuedExecutionStrategy.d.ts.map +1 -1
- package/dist/node.js +652 -209
- package/dist/node.js.map +14 -12
- package/dist/task/AiChatTask.d.ts +666 -0
- package/dist/task/AiChatTask.d.ts.map +1 -0
- package/dist/task/ChatMessage.d.ts +356 -0
- package/dist/task/ChatMessage.d.ts.map +1 -0
- package/dist/task/MessageConversion.d.ts +1 -9
- package/dist/task/MessageConversion.d.ts.map +1 -1
- package/dist/task/StructuredGenerationTask.d.ts +50 -3
- package/dist/task/StructuredGenerationTask.d.ts.map +1 -1
- package/dist/task/ToolCallingTask.d.ts +162 -8
- package/dist/task/ToolCallingTask.d.ts.map +1 -1
- package/dist/task/index.d.ts +6 -3
- package/dist/task/index.d.ts.map +1 -1
- package/dist/worker.js +42 -91
- package/dist/worker.js.map +3 -3
- package/package.json +11 -11
|
@@ -28,6 +28,12 @@ export declare class QueuedExecutionStrategy implements IAiExecutionStrategy {
|
|
|
28
28
|
* within the same strategy instance share a single queue-creation flow.
|
|
29
29
|
*/
|
|
30
30
|
private initPromise;
|
|
31
|
+
/**
|
|
32
|
+
* Shared limiter used by both the underlying JobQueueServer (for `execute`)
|
|
33
|
+
* and `executeStream` below. Created lazily in createQueue() and reused so
|
|
34
|
+
* streaming calls compete for the same concurrency slots as queued jobs.
|
|
35
|
+
*/
|
|
36
|
+
private limiter;
|
|
31
37
|
constructor(queueName: string, concurrency?: number,
|
|
32
38
|
/**
|
|
33
39
|
* When false, the strategy will use a pre-registered queue and throw if
|
|
@@ -37,13 +43,16 @@ export declare class QueuedExecutionStrategy implements IAiExecutionStrategy {
|
|
|
37
43
|
execute(jobInput: AiJobInput<TaskInput>, context: IExecuteContext, runnerId: string | undefined): Promise<TaskOutput>;
|
|
38
44
|
abort(): void;
|
|
39
45
|
/**
|
|
40
|
-
* Streaming execution for queued providers.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
46
|
+
* Streaming execution for queued providers. Runs the provider's stream
|
|
47
|
+
* function directly (bypassing the storage-backed queue, which can't
|
|
48
|
+
* forward mid-stream events) while still acquiring a slot from the same
|
|
49
|
+
* concurrency limiter the queue uses — so GPU serialization is preserved.
|
|
50
|
+
*
|
|
51
|
+
* AiJob.executeStream handles worker-proxy lookup, abort wiring, timeouts,
|
|
52
|
+
* and error classification; we just gate it through the limiter.
|
|
45
53
|
*/
|
|
46
54
|
executeStream(jobInput: AiJobInput<TaskInput>, context: IExecuteContext, runnerId: string | undefined): AsyncIterable<StreamEvent<TaskOutput>>;
|
|
55
|
+
private acquireLimiterSlot;
|
|
47
56
|
private ensureQueue;
|
|
48
57
|
private createQueue;
|
|
49
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueuedExecutionStrategy.d.ts","sourceRoot":"","sources":["../../src/execution/QueuedExecutionStrategy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"QueuedExecutionStrategy.d.ts","sourceRoot":"","sources":["../../src/execution/QueuedExecutionStrategy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,KAAK,EAAmB,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;;;;;;GAOG;AACH,qBAAa,uBAAwB,YAAW,oBAAoB;IAehE,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU;IApB7B;;;OAGG;IACH,OAAO,CAAC,WAAW,CAA4E;IAE/F;;;;OAIG;IACH,OAAO,CAAC,OAAO,CAAuB;IAEtC,YACmB,SAAS,EAAE,MAAM,EACjB,WAAW,GAAE,MAAU;IACxC;;;OAGG;IACc,UAAU,GAAE,OAAc,EACzC;IAEE,OAAO,CACX,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,EAC/B,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAAC,UAAU,CAAC,CAyCrB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED;;;;;;;;OAQG;IACI,aAAa,CAClB,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,EAC/B,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,aAAa,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CA8BxC;YAOa,kBAAkB;IAehC,OAAO,CAAC,WAAW;YAWL,WAAW;CAkE1B"}
|