@mastra/mcp-docs-server 0.13.26 → 0.13.27
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/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +9 -9
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +2 -0
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +11 -0
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +61 -61
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +24 -24
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Flance.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +65 -65
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Frag.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Freact.md +18 -0
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +12 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +10 -10
- package/.docs/organized/changelogs/create-mastra.md +47 -47
- package/.docs/organized/changelogs/mastra.md +63 -63
- package/.docs/organized/code-examples/agent.md +19 -14
- package/.docs/organized/code-examples/heads-up-game.md +5 -5
- package/.docs/raw/agents/agent-memory.mdx +86 -125
- package/.docs/raw/agents/input-processors.mdx +3 -3
- package/.docs/raw/agents/output-processors.mdx +4 -4
- package/.docs/raw/agents/overview.mdx +11 -52
- package/.docs/raw/agents/using-tools-and-mcp.mdx +34 -29
- package/.docs/raw/deployment/serverless-platforms/vercel-deployer.mdx +18 -0
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +4 -8
- package/.docs/raw/getting-started/installation.mdx +2 -3
- package/.docs/raw/getting-started/model-providers.mdx +28 -123
- package/.docs/raw/memory/semantic-recall.mdx +1 -1
- package/.docs/raw/reference/agents/agent.mdx +1 -1
- package/.docs/raw/reference/agents/generate.mdx +255 -218
- package/.docs/raw/reference/agents/generateLegacy.mdx +528 -0
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +3 -4
- package/.docs/raw/reference/agents/migration-guide.mdx +291 -0
- package/.docs/raw/reference/client-js/agents.mdx +14 -8
- package/.docs/raw/reference/deployer/vercel.mdx +26 -0
- package/.docs/raw/reference/streaming/ChunkType.mdx +4 -4
- package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +13 -13
- package/.docs/raw/reference/streaming/agents/stream.mdx +351 -178
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +515 -0
- package/.docs/raw/reference/{rag → vectors}/astra.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/chroma.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/couchbase.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/lance.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/libsql.mdx +2 -4
- package/.docs/raw/reference/{rag → vectors}/mongodb.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/opensearch.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/pg.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/pinecone.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/qdrant.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/s3vectors.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/turbopuffer.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/upstash.mdx +2 -2
- package/.docs/raw/reference/{rag → vectors}/vectorize.mdx +2 -2
- package/.docs/raw/streaming/events.mdx +4 -4
- package/.docs/raw/streaming/overview.mdx +9 -11
- package/.docs/raw/streaming/tool-streaming.mdx +3 -3
- package/.docs/raw/streaming/workflow-streaming.mdx +3 -3
- package/CHANGELOG.md +16 -0
- package/package.json +5 -5
- package/.docs/organized/code-examples/agent-network.md +0 -322
- package/.docs/raw/getting-started/model-capability.mdx +0 -11
- package/.docs/raw/reference/agents/generateVNext.mdx +0 -557
- package/.docs/raw/reference/agents/getDefaultVNextStreamOptions.mdx +0 -67
- package/.docs/raw/reference/streaming/agents/streamVNext.mdx +0 -673
|
@@ -1,557 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Reference: Agent.generateVNext() (Experimental) | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the `Agent.generateVNext()` method in Mastra agents, which enables non-streaming generation of responses with enhanced capabilities."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { GenerateVNextCallout } from "@/components/generateVNext-callout.tsx"
|
|
7
|
-
|
|
8
|
-
# Agent.generateVNext() (Experimental)
|
|
9
|
-
|
|
10
|
-
<GenerateVNextCallout />
|
|
11
|
-
|
|
12
|
-
The `.generateVNext()` method enables non-streaming response generation from an agent, with enhanced capabilities and flexible output formats. It accepts messages and optional generation options, supporting both Mastra’s native format and AI SDK v5 compatibility.
|
|
13
|
-
|
|
14
|
-
## Usage example
|
|
15
|
-
|
|
16
|
-
```typescript copy
|
|
17
|
-
// Default Mastra format
|
|
18
|
-
const mastraResult = await agent.generateVNext("message for agent");
|
|
19
|
-
|
|
20
|
-
// AI SDK v5 compatible format
|
|
21
|
-
const aiSdkResult = await agent.generateVNext("message for agent", {
|
|
22
|
-
format: 'aisdk'
|
|
23
|
-
});
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Parameters
|
|
27
|
-
|
|
28
|
-
<PropertiesTable
|
|
29
|
-
content={[
|
|
30
|
-
{
|
|
31
|
-
name: "messages",
|
|
32
|
-
type: "string | string[] | CoreMessage[] | AiMessageType[] | UIMessageWithMetadata[]",
|
|
33
|
-
description: "The messages to send to the agent. Can be a single string, array of strings, or structured message objects.",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "options",
|
|
37
|
-
type: "AgentExecutionOptions<Output, StructuredOutput, Format>",
|
|
38
|
-
isOptional: true,
|
|
39
|
-
description: "Optional configuration for the generation process.",
|
|
40
|
-
},
|
|
41
|
-
]}
|
|
42
|
-
/>
|
|
43
|
-
|
|
44
|
-
### Options
|
|
45
|
-
|
|
46
|
-
<PropertiesTable
|
|
47
|
-
content={[
|
|
48
|
-
{
|
|
49
|
-
name: "format",
|
|
50
|
-
type: "'mastra' | 'aisdk'",
|
|
51
|
-
isOptional: true,
|
|
52
|
-
defaultValue: "'mastra'",
|
|
53
|
-
description: "Determines the output format. Use 'mastra' for Mastra's native format (default) or 'aisdk' for AI SDK v5 compatibility.",
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: "maxSteps",
|
|
57
|
-
type: "number",
|
|
58
|
-
isOptional: true,
|
|
59
|
-
description: "Maximum number of steps to run during execution.",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: "scorers",
|
|
63
|
-
type: "MastraScorers | Record<string, { scorer: MastraScorer['name']; sampling?: ScoringSamplingConfig }>",
|
|
64
|
-
isOptional: true,
|
|
65
|
-
description: "Evaluation scorers to run on the execution results.",
|
|
66
|
-
properties: [
|
|
67
|
-
{
|
|
68
|
-
parameters: [{
|
|
69
|
-
name: "scorer",
|
|
70
|
-
type: "string",
|
|
71
|
-
isOptional: false,
|
|
72
|
-
description: "Name of the scorer to use."
|
|
73
|
-
}]
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
parameters: [{
|
|
77
|
-
name: "sampling",
|
|
78
|
-
type: "ScoringSamplingConfig",
|
|
79
|
-
isOptional: true,
|
|
80
|
-
description: "Sampling configuration for the scorer.",
|
|
81
|
-
properties: [
|
|
82
|
-
{
|
|
83
|
-
parameters: [{
|
|
84
|
-
name: "type",
|
|
85
|
-
type: "'none' | 'ratio'",
|
|
86
|
-
isOptional: false,
|
|
87
|
-
description: "Type of sampling strategy. Use 'none' to disable sampling or 'ratio' for percentage-based sampling."
|
|
88
|
-
}]
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
parameters: [{
|
|
92
|
-
name: "rate",
|
|
93
|
-
type: "number",
|
|
94
|
-
isOptional: true,
|
|
95
|
-
description: "Sampling rate (0-1). Required when type is 'ratio'."
|
|
96
|
-
}]
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
}]
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: "tracingContext",
|
|
105
|
-
type: "TracingContext",
|
|
106
|
-
isOptional: true,
|
|
107
|
-
description: "AI tracing context for span hierarchy and metadata.",
|
|
108
|
-
properties: [
|
|
109
|
-
{
|
|
110
|
-
parameters: [{
|
|
111
|
-
name: "currentSpan",
|
|
112
|
-
type: "AISpan",
|
|
113
|
-
isOptional: true,
|
|
114
|
-
description: "Current AI span for creating child spans and adding metadata."
|
|
115
|
-
}]
|
|
116
|
-
}
|
|
117
|
-
]
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: "tracingOptions",
|
|
121
|
-
type: "TracingOptions",
|
|
122
|
-
isOptional: true,
|
|
123
|
-
description: "Options for AI tracing configuration.",
|
|
124
|
-
properties: [
|
|
125
|
-
{
|
|
126
|
-
parameters: [{
|
|
127
|
-
name: "metadata",
|
|
128
|
-
type: "Record<string, any>",
|
|
129
|
-
isOptional: true,
|
|
130
|
-
description: "Metadata to add to the root trace span."
|
|
131
|
-
}]
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
name: "returnScorerData",
|
|
137
|
-
type: "boolean",
|
|
138
|
-
isOptional: true,
|
|
139
|
-
description: "Whether to return detailed scoring data in the response.",
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: "onChunk",
|
|
143
|
-
type: "(chunk: ChunkType) => Promise<void> | void",
|
|
144
|
-
isOptional: true,
|
|
145
|
-
description: "Callback function called for each chunk during generation.",
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
name: "onError",
|
|
149
|
-
type: "({ error }: { error: Error | string }) => Promise<void> | void",
|
|
150
|
-
isOptional: true,
|
|
151
|
-
description: "Callback function called when an error occurs during generation.",
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: "onAbort",
|
|
155
|
-
type: "(event: any) => Promise<void> | void",
|
|
156
|
-
isOptional: true,
|
|
157
|
-
description: "Callback function called when the generation is aborted.",
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: "activeTools",
|
|
161
|
-
type: "Array<keyof ToolSet> | undefined",
|
|
162
|
-
isOptional: true,
|
|
163
|
-
description: "Array of tool names that should be active during execution. If undefined, all available tools are active.",
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
name: "abortSignal",
|
|
167
|
-
type: "AbortSignal",
|
|
168
|
-
isOptional: true,
|
|
169
|
-
description: "Signal object that allows you to abort the agent's execution. When the signal is aborted, all ongoing operations will be terminated.",
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: "prepareStep",
|
|
173
|
-
type: "PrepareStepFunction<any>",
|
|
174
|
-
isOptional: true,
|
|
175
|
-
description: "Callback function called before each step of multi-step execution.",
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
name: "context",
|
|
179
|
-
type: "ModelMessage[]",
|
|
180
|
-
isOptional: true,
|
|
181
|
-
description: "Additional context messages to provide to the agent.",
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
name: "structuredOutput",
|
|
185
|
-
type: "StructuredOutputOptions<S extends ZodTypeAny = ZodTypeAny>",
|
|
186
|
-
isOptional: true,
|
|
187
|
-
description: "Enables structured output generation with better developer experience. Automatically creates and uses a StructuredOutputProcessor internally.",
|
|
188
|
-
properties: [
|
|
189
|
-
{
|
|
190
|
-
parameters: [{
|
|
191
|
-
name: "schema",
|
|
192
|
-
type: "z.ZodSchema<S>",
|
|
193
|
-
isOptional: false,
|
|
194
|
-
description: "Zod schema defining the expected output structure."
|
|
195
|
-
}]
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
parameters: [{
|
|
199
|
-
name: "model",
|
|
200
|
-
type: "MastraLanguageModel",
|
|
201
|
-
isOptional: true,
|
|
202
|
-
description: "Language model to use for structured output generation. If not provided, uses the agent's default model."
|
|
203
|
-
}]
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
parameters: [{
|
|
207
|
-
name: "errorStrategy",
|
|
208
|
-
type: "'strict' | 'warn' | 'fallback'",
|
|
209
|
-
isOptional: true,
|
|
210
|
-
description: "Strategy for handling schema validation errors. 'strict' throws errors, 'warn' logs warnings, 'fallback' uses fallback values."
|
|
211
|
-
}]
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
parameters: [{
|
|
215
|
-
name: "fallbackValue",
|
|
216
|
-
type: "<S extends ZodTypeAny>",
|
|
217
|
-
isOptional: true,
|
|
218
|
-
description: "Fallback value to use when schema validation fails and errorStrategy is 'fallback'."
|
|
219
|
-
}]
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
parameters: [{
|
|
223
|
-
name: "instructions",
|
|
224
|
-
type: "string",
|
|
225
|
-
isOptional: true,
|
|
226
|
-
description: "Additional instructions for structured output generation."
|
|
227
|
-
}]
|
|
228
|
-
}
|
|
229
|
-
]
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
name: "outputProcessors",
|
|
233
|
-
type: "Processor[]",
|
|
234
|
-
isOptional: true,
|
|
235
|
-
description: "Output processors to use for this execution (overrides agent's default).",
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
name: "inputProcessors",
|
|
239
|
-
type: "Processor[]",
|
|
240
|
-
isOptional: true,
|
|
241
|
-
description: "Input processors to use for this execution (overrides agent's default).",
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
name: "instructions",
|
|
245
|
-
type: "string",
|
|
246
|
-
isOptional: true,
|
|
247
|
-
description: "Custom instructions that override the agent's default instructions for this execution.",
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
name: "system",
|
|
251
|
-
type: "string | string[] | CoreSystemMessage | SystemModelMessage | CoreSystemMessage[] | SystemModelMessage[]",
|
|
252
|
-
isOptional: true,
|
|
253
|
-
description: "Custom system message(s) to include in the prompt. Can be a single string, message object, or array of either. System messages provide additional context or behavior instructions that supplement the agent's main instructions.",
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
name: "output",
|
|
257
|
-
type: "Zod schema | JsonSchema7",
|
|
258
|
-
isOptional: true,
|
|
259
|
-
description: "**Deprecated.** Use structuredOutput with maxSteps:1 to achieve the same thing. Defines the expected structure of the output. Can be a JSON Schema object or a Zod schema.",
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
name: "memory",
|
|
263
|
-
type: "object",
|
|
264
|
-
isOptional: true,
|
|
265
|
-
description: "Memory configuration for conversation persistence and retrieval.",
|
|
266
|
-
properties: [
|
|
267
|
-
{
|
|
268
|
-
parameters: [{
|
|
269
|
-
name: "thread",
|
|
270
|
-
type: "string | { id: string; metadata?: Record<string, any>, title?: string }",
|
|
271
|
-
isOptional: false,
|
|
272
|
-
description: "Thread identifier for conversation continuity. Can be a string ID or an object with ID and optional metadata/title."
|
|
273
|
-
}]
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
parameters: [{
|
|
277
|
-
name: "resource",
|
|
278
|
-
type: "string",
|
|
279
|
-
isOptional: false,
|
|
280
|
-
description: "Resource identifier for organizing conversations by user, session, or context."
|
|
281
|
-
}]
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
parameters: [{
|
|
285
|
-
name: "options",
|
|
286
|
-
type: "MemoryConfig",
|
|
287
|
-
isOptional: true,
|
|
288
|
-
description: "Additional memory configuration options for conversation management."
|
|
289
|
-
}]
|
|
290
|
-
}
|
|
291
|
-
]
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
name: "onFinish",
|
|
295
|
-
type: "StreamTextOnFinishCallback<any> | StreamObjectOnFinishCallback<OUTPUT>",
|
|
296
|
-
isOptional: true,
|
|
297
|
-
description: "Callback fired when generation completes. Type varies by format.",
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
name: "onStepFinish",
|
|
301
|
-
type: "StreamTextOnStepFinishCallback<any> | never",
|
|
302
|
-
isOptional: true,
|
|
303
|
-
description: "Callback fired after each generation step. Type varies by format.",
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
name: "resourceId",
|
|
307
|
-
type: "string",
|
|
308
|
-
isOptional: true,
|
|
309
|
-
description: "Deprecated. Use memory.resource instead. Identifier for the resource/user.",
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
name: "telemetry",
|
|
313
|
-
type: "TelemetrySettings",
|
|
314
|
-
isOptional: true,
|
|
315
|
-
description: "Settings for OTLP telemetry collection (not AI tracing).",
|
|
316
|
-
properties: [
|
|
317
|
-
{
|
|
318
|
-
parameters: [{
|
|
319
|
-
name: "isEnabled",
|
|
320
|
-
type: "boolean",
|
|
321
|
-
isOptional: true,
|
|
322
|
-
description: "Whether telemetry collection is enabled."
|
|
323
|
-
}]
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
parameters: [{
|
|
327
|
-
name: "recordInputs",
|
|
328
|
-
type: "boolean",
|
|
329
|
-
isOptional: true,
|
|
330
|
-
description: "Whether to record input data in telemetry."
|
|
331
|
-
}]
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
parameters: [{
|
|
335
|
-
name: "recordOutputs",
|
|
336
|
-
type: "boolean",
|
|
337
|
-
isOptional: true,
|
|
338
|
-
description: "Whether to record output data in telemetry."
|
|
339
|
-
}]
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
parameters: [{
|
|
343
|
-
name: "functionId",
|
|
344
|
-
type: "string",
|
|
345
|
-
isOptional: true,
|
|
346
|
-
description: "Identifier for the function being executed."
|
|
347
|
-
}]
|
|
348
|
-
}
|
|
349
|
-
]
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
name: "modelSettings",
|
|
353
|
-
type: "CallSettings",
|
|
354
|
-
isOptional: true,
|
|
355
|
-
description: "Model-specific settings like temperature, topP, etc.",
|
|
356
|
-
properties: [
|
|
357
|
-
{
|
|
358
|
-
parameters: [{
|
|
359
|
-
name: "temperature",
|
|
360
|
-
type: "number",
|
|
361
|
-
isOptional: true,
|
|
362
|
-
description: "Controls randomness in generation (0-2). Higher values make output more random."
|
|
363
|
-
}]
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
parameters: [{
|
|
367
|
-
name: "maxRetries",
|
|
368
|
-
type: "number",
|
|
369
|
-
isOptional: true,
|
|
370
|
-
description: "Maximum number of retry attempts for failed requests."
|
|
371
|
-
}]
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
parameters: [{
|
|
375
|
-
name: "topP",
|
|
376
|
-
type: "number",
|
|
377
|
-
isOptional: true,
|
|
378
|
-
description: "Nucleus sampling parameter (0-1). Controls diversity of generated text."
|
|
379
|
-
}]
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
parameters: [{
|
|
383
|
-
name: "topK",
|
|
384
|
-
type: "number",
|
|
385
|
-
isOptional: true,
|
|
386
|
-
description: "Top-k sampling parameter. Limits vocabulary to k most likely tokens."
|
|
387
|
-
}]
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
parameters: [{
|
|
391
|
-
name: "presencePenalty",
|
|
392
|
-
type: "number",
|
|
393
|
-
isOptional: true,
|
|
394
|
-
description: "Penalty for token presence (-2 to 2). Reduces repetition."
|
|
395
|
-
}]
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
parameters: [{
|
|
399
|
-
name: "frequencyPenalty",
|
|
400
|
-
type: "number",
|
|
401
|
-
isOptional: true,
|
|
402
|
-
description: "Penalty for token frequency (-2 to 2). Reduces repetition of frequent tokens."
|
|
403
|
-
}]
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
parameters: [{
|
|
407
|
-
name: "stopSequences",
|
|
408
|
-
type: "string[]",
|
|
409
|
-
isOptional: true,
|
|
410
|
-
description: "Array of strings that will stop generation when encountered."
|
|
411
|
-
}]
|
|
412
|
-
}
|
|
413
|
-
]
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
name: "threadId",
|
|
417
|
-
type: "string",
|
|
418
|
-
isOptional: true,
|
|
419
|
-
description: "Deprecated. Use memory.thread instead. Thread identifier for conversation continuity.",
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
name: "toolChoice",
|
|
423
|
-
type: "'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }",
|
|
424
|
-
isOptional: true,
|
|
425
|
-
description: "Controls how tools are selected during generation.",
|
|
426
|
-
properties: [
|
|
427
|
-
{
|
|
428
|
-
parameters: [{
|
|
429
|
-
name: "'auto'",
|
|
430
|
-
type: "string",
|
|
431
|
-
isOptional: false,
|
|
432
|
-
description: "Let the model decide when to use tools (default)."
|
|
433
|
-
}]
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
parameters: [{
|
|
437
|
-
name: "'none'",
|
|
438
|
-
type: "string",
|
|
439
|
-
isOptional: false,
|
|
440
|
-
description: "Disable tool usage entirely."
|
|
441
|
-
}]
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
parameters: [{
|
|
445
|
-
name: "'required'",
|
|
446
|
-
type: "string",
|
|
447
|
-
isOptional: false,
|
|
448
|
-
description: "Force the model to use at least one tool."
|
|
449
|
-
}]
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
parameters: [{
|
|
453
|
-
name: "{ type: 'tool'; toolName: string }",
|
|
454
|
-
type: "object",
|
|
455
|
-
isOptional: false,
|
|
456
|
-
description: "Force the model to use a specific tool."
|
|
457
|
-
}]
|
|
458
|
-
}
|
|
459
|
-
]
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
name: "toolsets",
|
|
463
|
-
type: "ToolsetsInput",
|
|
464
|
-
isOptional: true,
|
|
465
|
-
description: "Additional tool sets that can be used for this execution.",
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
name: "clientTools",
|
|
469
|
-
type: "ToolsInput",
|
|
470
|
-
isOptional: true,
|
|
471
|
-
description: "Client-side tools available during execution.",
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
name: "savePerStep",
|
|
475
|
-
type: "boolean",
|
|
476
|
-
isOptional: true,
|
|
477
|
-
description: "Save messages incrementally after each generation step completes (default: false).",
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
name: "providerOptions",
|
|
481
|
-
type: "Record<string, Record<string, JSONValue>>",
|
|
482
|
-
isOptional: true,
|
|
483
|
-
description: "Provider-specific options passed to the language model.",
|
|
484
|
-
properties: [
|
|
485
|
-
{
|
|
486
|
-
parameters: [{
|
|
487
|
-
name: "openai",
|
|
488
|
-
type: "Record<string, JSONValue>",
|
|
489
|
-
isOptional: true,
|
|
490
|
-
description: "OpenAI-specific options like reasoningEffort, responseFormat, etc."
|
|
491
|
-
}]
|
|
492
|
-
},
|
|
493
|
-
{
|
|
494
|
-
parameters: [{
|
|
495
|
-
name: "anthropic",
|
|
496
|
-
type: "Record<string, JSONValue>",
|
|
497
|
-
isOptional: true,
|
|
498
|
-
description: "Anthropic-specific options like maxTokens, etc."
|
|
499
|
-
}]
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
parameters: [{
|
|
503
|
-
name: "google",
|
|
504
|
-
type: "Record<string, JSONValue>",
|
|
505
|
-
isOptional: true,
|
|
506
|
-
description: "Google-specific options."
|
|
507
|
-
}]
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
parameters: [{
|
|
511
|
-
name: "[providerName]",
|
|
512
|
-
type: "Record<string, JSONValue>",
|
|
513
|
-
isOptional: true,
|
|
514
|
-
description: "Any provider-specific options."
|
|
515
|
-
}]
|
|
516
|
-
}
|
|
517
|
-
]
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
name: "runId",
|
|
521
|
-
type: "string",
|
|
522
|
-
isOptional: true,
|
|
523
|
-
description: "Unique identifier for this execution run.",
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
name: "runtimeContext",
|
|
527
|
-
type: "RuntimeContext",
|
|
528
|
-
isOptional: true,
|
|
529
|
-
description: "Runtime context containing dynamic configuration and state.",
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
name: "stopWhen",
|
|
533
|
-
type: "StopCondition | StopCondition[]",
|
|
534
|
-
isOptional: true,
|
|
535
|
-
description: "Conditions for stopping execution (e.g., step count, token limit).",
|
|
536
|
-
},
|
|
537
|
-
]}
|
|
538
|
-
/>
|
|
539
|
-
|
|
540
|
-
## Returns
|
|
541
|
-
|
|
542
|
-
<PropertiesTable
|
|
543
|
-
content={[
|
|
544
|
-
{
|
|
545
|
-
name: "result",
|
|
546
|
-
type: "Awaited<ReturnType<MastraModelOutput<Output>['getFullOutput']>> | Awaited<ReturnType<AISDKV5OutputStream<Output>['getFullOutput']>>",
|
|
547
|
-
description: "Returns the full output of the generation process. When format is 'mastra' (default), returns MastraModelOutput result with traceId property. When format is 'aisdk', returns AISDKV5OutputStream result for AI SDK v5 compatibility.",
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
name: "traceId",
|
|
551
|
-
type: "string",
|
|
552
|
-
isOptional: true,
|
|
553
|
-
description: "The trace ID associated with this execution when AI tracing is enabled. Available in the result object (result.traceId for Mastra format).",
|
|
554
|
-
},
|
|
555
|
-
]}
|
|
556
|
-
/>
|
|
557
|
-
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Reference: Agent.getDefaultVNextStreamOptions() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the `Agent.getDefaultVNextStreamOptions()` method in Mastra agents, which retrieves the default options used for streamVNext calls."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Agent.getDefaultVNextStreamOptions()
|
|
7
|
-
|
|
8
|
-
Agents can be configured with default streaming options for memory usage, output format, and iteration steps. The `.getDefaultVNextStreamOptions()` method returns these defaults, resolving them if they are functions. These options apply to all `streamVNext()` calls unless overridden and are useful for inspecting an agent’s unknown defaults.
|
|
9
|
-
|
|
10
|
-
## Usage example
|
|
11
|
-
|
|
12
|
-
```typescript copy
|
|
13
|
-
await agent.getDefaultVNextStreamOptions();
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Parameters
|
|
17
|
-
|
|
18
|
-
<PropertiesTable
|
|
19
|
-
content={[
|
|
20
|
-
{
|
|
21
|
-
name: "options",
|
|
22
|
-
type: "{ runtimeContext?: RuntimeContext }",
|
|
23
|
-
isOptional: true,
|
|
24
|
-
defaultValue: "{}",
|
|
25
|
-
description: "Optional configuration object containing runtime context.",
|
|
26
|
-
},
|
|
27
|
-
]}
|
|
28
|
-
/>
|
|
29
|
-
|
|
30
|
-
## Returns
|
|
31
|
-
|
|
32
|
-
<PropertiesTable
|
|
33
|
-
content={[
|
|
34
|
-
{
|
|
35
|
-
name: "defaultOptions",
|
|
36
|
-
type: "AgentExecutionOptions<Output, StructuredOutput> | Promise<AgentExecutionOptions<Output, StructuredOutput>>",
|
|
37
|
-
description: "The default vNext streaming options configured for the agent, either as a direct object or a promise that resolves to the options.",
|
|
38
|
-
},
|
|
39
|
-
]}
|
|
40
|
-
/>
|
|
41
|
-
|
|
42
|
-
## Extended usage example
|
|
43
|
-
|
|
44
|
-
```typescript copy
|
|
45
|
-
await agent.getDefaultVNextStreamOptions({
|
|
46
|
-
runtimeContext: new RuntimeContext()
|
|
47
|
-
});
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Options parameters
|
|
51
|
-
|
|
52
|
-
<PropertiesTable
|
|
53
|
-
content={[
|
|
54
|
-
{
|
|
55
|
-
name: "runtimeContext",
|
|
56
|
-
type: "RuntimeContext",
|
|
57
|
-
isOptional: true,
|
|
58
|
-
defaultValue: "new RuntimeContext()",
|
|
59
|
-
description: "Runtime context for dependency injection and contextual information.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
63
|
-
|
|
64
|
-
## Related
|
|
65
|
-
|
|
66
|
-
- [Streaming with agents](../../docs/streaming/overview.mdx#streaming-with-agents)
|
|
67
|
-
- [Agent Runtime Context](../../docs/agents/runtime-context.mdx)
|