@ai-sdk/workflow 1.0.0-canary.41 → 1.0.0-canary.43
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/CHANGELOG.md +23 -0
- package/dist/index.d.mts +7 -57
- package/dist/index.mjs +304 -39
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/do-stream-step.ts +18 -3
- package/src/stream-text-iterator.ts +89 -3
- package/src/workflow-agent.ts +274 -91
- package/src/telemetry.ts +0 -199
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @ai-sdk/workflow
|
|
2
2
|
|
|
3
|
+
## 1.0.0-canary.43
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d775a57: feat: introduce Instructions type
|
|
8
|
+
- 39dad72: feat(workflow): add stable telemetry integration support to `WorkflowAgent` and remove legacy telemetry options.
|
|
9
|
+
- Updated dependencies [e95e38d]
|
|
10
|
+
- Updated dependencies [016e877]
|
|
11
|
+
- Updated dependencies [ca99fea]
|
|
12
|
+
- Updated dependencies [ca39020]
|
|
13
|
+
- Updated dependencies [d775a57]
|
|
14
|
+
- Updated dependencies [538c12b]
|
|
15
|
+
- ai@7.0.0-canary.127
|
|
16
|
+
- @ai-sdk/provider-utils@5.0.0-canary.36
|
|
17
|
+
|
|
18
|
+
## 1.0.0-canary.42
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [f634bac]
|
|
23
|
+
- @ai-sdk/provider-utils@5.0.0-canary.35
|
|
24
|
+
- ai@7.0.0-canary.126
|
|
25
|
+
|
|
3
26
|
## 1.0.0-canary.41
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LanguageModelV4, SharedV4ProviderOptions, LanguageModelV4CallOptions, LanguageModelV4Prompt, LanguageModelV4StreamPart } from '@ai-sdk/provider';
|
|
2
2
|
import { Context, HasRequiredKey, InferToolSetContext } from '@ai-sdk/provider-utils';
|
|
3
|
-
import { ToolSet, LanguageModel,
|
|
3
|
+
import { ToolSet, LanguageModel, Instructions, ToolChoice, TelemetryOptions as TelemetryOptions$1, StopCondition, ActiveTools, LanguageModelResponseMetadata, LanguageModelUsage, FinishReason, ToolCallRepairFunction, StepResult, GenerateTextOnStepFinishCallback, ModelMessage, Experimental_LanguageModelStreamPart, UIMessage, UIMessageChunk, ChatTransport, PrepareSendMessagesRequest, PrepareReconnectToStreamRequest, ChatRequestOptions } from 'ai';
|
|
4
4
|
export { Experimental_LanguageModelStreamPart as ModelCallStreamPart, Output, ToolCallRepairFunction } from 'ai';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -58,41 +58,7 @@ type WorkflowAgentToolsContextParameter<TTools extends ToolSet> = HasRequiredKey
|
|
|
58
58
|
} : {
|
|
59
59
|
toolsContext?: never;
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
* Telemetry settings for observability.
|
|
63
|
-
*/
|
|
64
|
-
interface TelemetryOptions {
|
|
65
|
-
/**
|
|
66
|
-
* Enable or disable telemetry. Defaults to true.
|
|
67
|
-
*/
|
|
68
|
-
isEnabled?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Identifier for this function. Used to group telemetry data by function.
|
|
71
|
-
*/
|
|
72
|
-
functionId?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Additional information to include in the telemetry data.
|
|
75
|
-
*/
|
|
76
|
-
metadata?: Record<string, string | number | boolean | Array<string | number | boolean> | null | undefined>;
|
|
77
|
-
/**
|
|
78
|
-
* Enable or disable input recording. Enabled by default.
|
|
79
|
-
*
|
|
80
|
-
* You might want to disable input recording to avoid recording sensitive
|
|
81
|
-
* information, to reduce data transfers, or to increase performance.
|
|
82
|
-
*/
|
|
83
|
-
recordInputs?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Enable or disable output recording. Enabled by default.
|
|
86
|
-
*
|
|
87
|
-
* You might want to disable output recording to avoid recording sensitive
|
|
88
|
-
* information, to reduce data transfers, or to increase performance.
|
|
89
|
-
*/
|
|
90
|
-
recordOutputs?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Custom tracer for the telemetry.
|
|
93
|
-
*/
|
|
94
|
-
tracer?: unknown;
|
|
95
|
-
}
|
|
61
|
+
type TelemetryOptions<TRuntimeContext extends Context = Context, TTools extends ToolSet = ToolSet> = TelemetryOptions$1<TRuntimeContext, TTools>;
|
|
96
62
|
/**
|
|
97
63
|
* A transformation that is applied to the stream.
|
|
98
64
|
*/
|
|
@@ -270,13 +236,9 @@ type PrepareStepCallback<TTools extends ToolSet = ToolSet, TRuntimeContext exten
|
|
|
270
236
|
interface PrepareCallOptions<TTools extends ToolSet = ToolSet, TRuntimeContext extends Context = Context> extends Partial<GenerationSettings> {
|
|
271
237
|
model: LanguageModel;
|
|
272
238
|
tools: TTools;
|
|
273
|
-
instructions?:
|
|
239
|
+
instructions?: Instructions;
|
|
274
240
|
toolChoice?: ToolChoice<TTools>;
|
|
275
|
-
telemetry?: TelemetryOptions
|
|
276
|
-
/**
|
|
277
|
-
* @deprecated Use `telemetry` instead. This alias will be removed in a future major release.
|
|
278
|
-
*/
|
|
279
|
-
experimental_telemetry?: TelemetryOptions;
|
|
241
|
+
telemetry?: TelemetryOptions<TRuntimeContext, TTools>;
|
|
280
242
|
/**
|
|
281
243
|
* Runtime context that flows through the agent loop.
|
|
282
244
|
* Treat as immutable; return a new `runtimeContext` to update it for the call.
|
|
@@ -324,7 +286,7 @@ type WorkflowAgentOptions<TTools extends ToolSet = ToolSet, TRuntimeContext exte
|
|
|
324
286
|
* Agent instructions. Can be a string, a SystemModelMessage, or an array of SystemModelMessages.
|
|
325
287
|
* Supports provider-specific options (e.g., caching) when using the SystemModelMessage form.
|
|
326
288
|
*/
|
|
327
|
-
instructions?:
|
|
289
|
+
instructions?: Instructions;
|
|
328
290
|
/**
|
|
329
291
|
* Optional system prompt to guide the agent's behavior.
|
|
330
292
|
* @deprecated Use `instructions` instead.
|
|
@@ -337,13 +299,7 @@ type WorkflowAgentOptions<TTools extends ToolSet = ToolSet, TRuntimeContext exte
|
|
|
337
299
|
/**
|
|
338
300
|
* Optional telemetry configuration.
|
|
339
301
|
*/
|
|
340
|
-
telemetry?: TelemetryOptions
|
|
341
|
-
/**
|
|
342
|
-
* Optional telemetry configuration.
|
|
343
|
-
*
|
|
344
|
-
* @deprecated Use `telemetry` instead. This alias will be removed in a future major release.
|
|
345
|
-
*/
|
|
346
|
-
experimental_telemetry?: TelemetryOptions;
|
|
302
|
+
telemetry?: TelemetryOptions<TRuntimeContext, TTools>;
|
|
347
303
|
/**
|
|
348
304
|
* Default runtime context for every stream call on this agent.
|
|
349
305
|
*
|
|
@@ -639,13 +595,7 @@ type WorkflowAgentStreamOptions<TTools extends ToolSet = ToolSet, TRuntimeContex
|
|
|
639
595
|
/**
|
|
640
596
|
* Optional telemetry configuration.
|
|
641
597
|
*/
|
|
642
|
-
telemetry?: TelemetryOptions
|
|
643
|
-
/**
|
|
644
|
-
* Optional telemetry configuration.
|
|
645
|
-
*
|
|
646
|
-
* @deprecated Use `telemetry` instead. This alias will be removed in a future major release.
|
|
647
|
-
*/
|
|
648
|
-
experimental_telemetry?: TelemetryOptions;
|
|
598
|
+
telemetry?: TelemetryOptions<TRuntimeContext, TTools>;
|
|
649
599
|
/**
|
|
650
600
|
* Runtime context that flows through the agent loop.
|
|
651
601
|
*
|