@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
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Agent.streamLegacy() (Legacy) | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the legacy `Agent.streamLegacy()` method in Mastra agents. This method is deprecated and will be removed in a future version."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Callout } from 'nextra/components';
|
|
7
|
+
|
|
8
|
+
# Agent.streamLegacy() (Legacy)
|
|
9
|
+
|
|
10
|
+
<Callout type="warning">
|
|
11
|
+
**Deprecated**: This method is deprecated and only works with V1 models. For V2 models, use the new [`.stream()`](./stream.mdx) method instead. See the [migration guide](../../agents/migration-guide.mdx) for details on upgrading.
|
|
12
|
+
</Callout>
|
|
13
|
+
|
|
14
|
+
The `.streamLegacy()` method is the legacy version of the agent streaming API, used for real-time streaming of responses from V1 model agents. This method accepts messages and optional streaming options.
|
|
15
|
+
|
|
16
|
+
## Usage example
|
|
17
|
+
|
|
18
|
+
```typescript copy
|
|
19
|
+
await agent.streamLegacy("message for agent");
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Parameters
|
|
23
|
+
|
|
24
|
+
<PropertiesTable
|
|
25
|
+
content={[
|
|
26
|
+
{
|
|
27
|
+
name: "messages",
|
|
28
|
+
type: "string | string[] | CoreMessage[] | AiMessageType[] | UIMessageWithMetadata[]",
|
|
29
|
+
description: "The messages to send to the agent. Can be a single string, array of strings, or structured message objects.",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "options",
|
|
33
|
+
type: "AgentStreamOptions<OUTPUT, EXPERIMENTAL_OUTPUT>",
|
|
34
|
+
isOptional: true,
|
|
35
|
+
description: "Optional configuration for the streaming process.",
|
|
36
|
+
},
|
|
37
|
+
]}
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
### Options parameters
|
|
41
|
+
|
|
42
|
+
<PropertiesTable
|
|
43
|
+
content={[
|
|
44
|
+
{
|
|
45
|
+
name: "abortSignal",
|
|
46
|
+
type: "AbortSignal",
|
|
47
|
+
isOptional: true,
|
|
48
|
+
description:
|
|
49
|
+
"Signal object that allows you to abort the agent's execution. When the signal is aborted, all ongoing operations will be terminated.",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "context",
|
|
53
|
+
type: "CoreMessage[]",
|
|
54
|
+
isOptional: true,
|
|
55
|
+
description: "Additional context messages to provide to the agent.",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "experimental_output",
|
|
59
|
+
type: "Zod schema | JsonSchema7",
|
|
60
|
+
isOptional: true,
|
|
61
|
+
description:
|
|
62
|
+
"Enables structured output generation alongside text generation and tool calls. The model will generate responses that conform to the provided schema.",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "instructions",
|
|
66
|
+
type: "string",
|
|
67
|
+
isOptional: true,
|
|
68
|
+
description:
|
|
69
|
+
"Custom instructions that override the agent's default instructions for this specific generation. Useful for dynamically modifying agent behavior without creating a new agent instance.",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "output",
|
|
73
|
+
type: "Zod schema | JsonSchema7",
|
|
74
|
+
isOptional: true,
|
|
75
|
+
description:
|
|
76
|
+
"Defines the expected structure of the output. Can be a JSON Schema object or a Zod schema.",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "memory",
|
|
80
|
+
type: "object",
|
|
81
|
+
isOptional: true,
|
|
82
|
+
description: "Configuration for memory. This is the preferred way to manage memory.",
|
|
83
|
+
properties: [
|
|
84
|
+
{
|
|
85
|
+
parameters: [{
|
|
86
|
+
name: "thread",
|
|
87
|
+
type: "string | { id: string; metadata?: Record<string, any>, title?: string }",
|
|
88
|
+
isOptional: false,
|
|
89
|
+
description: "The conversation thread, as a string ID or an object with an `id` and optional `metadata`."
|
|
90
|
+
}]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
parameters: [{
|
|
94
|
+
name: "resource",
|
|
95
|
+
type: "string",
|
|
96
|
+
isOptional: false,
|
|
97
|
+
description: "Identifier for the user or resource associated with the thread."
|
|
98
|
+
}]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
parameters: [{
|
|
102
|
+
name: "options",
|
|
103
|
+
type: "MemoryConfig",
|
|
104
|
+
isOptional: true,
|
|
105
|
+
description: "Configuration for memory behavior, like message history and semantic recall."
|
|
106
|
+
}]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "maxSteps",
|
|
112
|
+
type: "number",
|
|
113
|
+
isOptional: true,
|
|
114
|
+
defaultValue: "5",
|
|
115
|
+
description: "Maximum number of execution steps allowed.",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "maxRetries",
|
|
119
|
+
type: "number",
|
|
120
|
+
isOptional: true,
|
|
121
|
+
defaultValue: "2",
|
|
122
|
+
description: "Maximum number of retries. Set to 0 to disable retries.",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "memoryOptions",
|
|
126
|
+
type: "MemoryConfig",
|
|
127
|
+
isOptional: true,
|
|
128
|
+
description:
|
|
129
|
+
"**Deprecated.** Use `memory.options` instead. Configuration options for memory management.",
|
|
130
|
+
properties: [
|
|
131
|
+
{
|
|
132
|
+
parameters: [{
|
|
133
|
+
name: "lastMessages",
|
|
134
|
+
type: "number | false",
|
|
135
|
+
isOptional: true,
|
|
136
|
+
description: "Number of recent messages to include in context, or false to disable."
|
|
137
|
+
}]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
parameters: [{
|
|
141
|
+
name: "semanticRecall",
|
|
142
|
+
type: "boolean | { topK: number; messageRange: number | { before: number; after: number }; scope?: 'thread' | 'resource' }",
|
|
143
|
+
isOptional: true,
|
|
144
|
+
description: "Enable semantic recall to find relevant past messages. Can be a boolean or detailed configuration."
|
|
145
|
+
}]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
parameters: [{
|
|
149
|
+
name: "workingMemory",
|
|
150
|
+
type: "WorkingMemory",
|
|
151
|
+
isOptional: true,
|
|
152
|
+
description: "Configuration for working memory functionality."
|
|
153
|
+
}]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
parameters: [{
|
|
157
|
+
name: "threads",
|
|
158
|
+
type: "{ generateTitle?: boolean | { model: DynamicArgument<MastraLanguageModel>; instructions?: DynamicArgument<string> } }",
|
|
159
|
+
isOptional: true,
|
|
160
|
+
description: "Thread-specific configuration, including automatic title generation."
|
|
161
|
+
}]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "onFinish",
|
|
167
|
+
type: "StreamTextOnFinishCallback<any> | StreamObjectOnFinishCallback<OUTPUT>",
|
|
168
|
+
isOptional: true,
|
|
169
|
+
description:
|
|
170
|
+
"Callback function called when streaming completes. Receives the final result.",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "onStepFinish",
|
|
174
|
+
type: "StreamTextOnStepFinishCallback<any> | never",
|
|
175
|
+
isOptional: true,
|
|
176
|
+
description:
|
|
177
|
+
"Callback function called after each execution step. Receives step details as a JSON string. Unavailable for structured output",
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "resourceId",
|
|
181
|
+
type: "string",
|
|
182
|
+
isOptional: true,
|
|
183
|
+
description:
|
|
184
|
+
"**Deprecated.** Use `memory.resource` instead. Identifier for the user or resource interacting with the agent. Must be provided if threadId is provided.",
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "telemetry",
|
|
188
|
+
type: "TelemetrySettings",
|
|
189
|
+
isOptional: true,
|
|
190
|
+
description:
|
|
191
|
+
"Settings for telemetry collection during streaming.",
|
|
192
|
+
properties: [
|
|
193
|
+
{
|
|
194
|
+
parameters: [{
|
|
195
|
+
name: "isEnabled",
|
|
196
|
+
type: "boolean",
|
|
197
|
+
isOptional: true,
|
|
198
|
+
description: "Enable or disable telemetry. Disabled by default while experimental."
|
|
199
|
+
}]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
parameters: [{
|
|
203
|
+
name: "recordInputs",
|
|
204
|
+
type: "boolean",
|
|
205
|
+
isOptional: true,
|
|
206
|
+
description: "Enable or disable input recording. Enabled by default. You might want to disable input recording to avoid recording sensitive information."
|
|
207
|
+
}]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
parameters: [{
|
|
211
|
+
name: "recordOutputs",
|
|
212
|
+
type: "boolean",
|
|
213
|
+
isOptional: true,
|
|
214
|
+
description: "Enable or disable output recording. Enabled by default. You might want to disable output recording to avoid recording sensitive information."
|
|
215
|
+
}]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
parameters: [{
|
|
219
|
+
name: "functionId",
|
|
220
|
+
type: "string",
|
|
221
|
+
isOptional: true,
|
|
222
|
+
description: "Identifier for this function. Used to group telemetry data by function."
|
|
223
|
+
}]
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: "temperature",
|
|
229
|
+
type: "number",
|
|
230
|
+
isOptional: true,
|
|
231
|
+
description:
|
|
232
|
+
"Controls randomness in the model's output. Higher values (e.g., 0.8) make the output more random, lower values (e.g., 0.2) make it more focused and deterministic.",
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "threadId",
|
|
236
|
+
type: "string",
|
|
237
|
+
isOptional: true,
|
|
238
|
+
description:
|
|
239
|
+
"**Deprecated.** Use `memory.thread` instead. Identifier for the conversation thread. Allows for maintaining context across multiple interactions. Must be provided if resourceId is provided.",
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "toolChoice",
|
|
243
|
+
type: "'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }",
|
|
244
|
+
isOptional: true,
|
|
245
|
+
defaultValue: "'auto'",
|
|
246
|
+
description: "Controls how the agent uses tools during streaming.",
|
|
247
|
+
properties: [
|
|
248
|
+
{
|
|
249
|
+
parameters: [{
|
|
250
|
+
name: "'auto'",
|
|
251
|
+
type: "string",
|
|
252
|
+
description: "Let the model decide whether to use tools (default)."
|
|
253
|
+
}]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
parameters: [{
|
|
257
|
+
name: "'none'",
|
|
258
|
+
type: "string",
|
|
259
|
+
description: "Do not use any tools."
|
|
260
|
+
}]
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
parameters: [{
|
|
264
|
+
name: "'required'",
|
|
265
|
+
type: "string",
|
|
266
|
+
description: "Require the model to use at least one tool."
|
|
267
|
+
}]
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
parameters: [{
|
|
271
|
+
name: "{ type: 'tool'; toolName: string }",
|
|
272
|
+
type: "object",
|
|
273
|
+
description: "Require the model to use a specific tool by name."
|
|
274
|
+
}]
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: "toolsets",
|
|
280
|
+
type: "ToolsetsInput",
|
|
281
|
+
isOptional: true,
|
|
282
|
+
description:
|
|
283
|
+
"Additional toolsets to make available to the agent during streaming.",
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: "clientTools",
|
|
287
|
+
type: "ToolsInput",
|
|
288
|
+
isOptional: true,
|
|
289
|
+
description:
|
|
290
|
+
"Tools that are executed on the 'client' side of the request. These tools do not have execute functions in the definition.",
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: "savePerStep",
|
|
294
|
+
type: "boolean",
|
|
295
|
+
isOptional: true,
|
|
296
|
+
description: "Save messages incrementally after each stream step completes (default: false).",
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: "providerOptions",
|
|
300
|
+
type: "Record<string, Record<string, JSONValue>>",
|
|
301
|
+
isOptional: true,
|
|
302
|
+
description: "Additional provider-specific options that are passed through to the underlying LLM provider. The structure is `{ providerName: { optionKey: value } }`. For example: `{ openai: { reasoningEffort: 'high' }, anthropic: { maxTokens: 1000 } }`.",
|
|
303
|
+
properties: [
|
|
304
|
+
{
|
|
305
|
+
parameters: [{
|
|
306
|
+
name: "openai",
|
|
307
|
+
type: "Record<string, JSONValue>",
|
|
308
|
+
isOptional: true,
|
|
309
|
+
description: "OpenAI-specific options. Example: `{ reasoningEffort: 'high' }`"
|
|
310
|
+
}]
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
parameters: [{
|
|
314
|
+
name: "anthropic",
|
|
315
|
+
type: "Record<string, JSONValue>",
|
|
316
|
+
isOptional: true,
|
|
317
|
+
description: "Anthropic-specific options. Example: `{ maxTokens: 1000 }`"
|
|
318
|
+
}]
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
parameters: [{
|
|
322
|
+
name: "google",
|
|
323
|
+
type: "Record<string, JSONValue>",
|
|
324
|
+
isOptional: true,
|
|
325
|
+
description: "Google-specific options. Example: `{ safetySettings: [...] }`"
|
|
326
|
+
}]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
parameters: [{
|
|
330
|
+
name: "[providerName]",
|
|
331
|
+
type: "Record<string, JSONValue>",
|
|
332
|
+
isOptional: true,
|
|
333
|
+
description: "Other provider-specific options. The key is the provider name and the value is a record of provider-specific options."
|
|
334
|
+
}]
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: "runId",
|
|
340
|
+
type: "string",
|
|
341
|
+
isOptional: true,
|
|
342
|
+
description: "Unique ID for this generation run. Useful for tracking and debugging purposes.",
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
name: "runtimeContext",
|
|
346
|
+
type: "RuntimeContext",
|
|
347
|
+
isOptional: true,
|
|
348
|
+
description: "Runtime context for dependency injection and contextual information.",
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: "maxTokens",
|
|
352
|
+
type: "number",
|
|
353
|
+
isOptional: true,
|
|
354
|
+
description: "Maximum number of tokens to generate.",
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
name: "topP",
|
|
358
|
+
type: "number",
|
|
359
|
+
isOptional: true,
|
|
360
|
+
description: "Nucleus sampling. This is a number between 0 and 1. It is recommended to set either `temperature` or `topP`, but not both.",
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
name: "topK",
|
|
364
|
+
type: "number",
|
|
365
|
+
isOptional: true,
|
|
366
|
+
description: "Only sample from the top K options for each subsequent token. Used to remove 'long tail' low probability responses.",
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "presencePenalty",
|
|
370
|
+
type: "number",
|
|
371
|
+
isOptional: true,
|
|
372
|
+
description: "Presence penalty setting. It affects the likelihood of the model to repeat information that is already in the prompt. A number between -1 (increase repetition) and 1 (maximum penalty, decrease repetition).",
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: "frequencyPenalty",
|
|
376
|
+
type: "number",
|
|
377
|
+
isOptional: true,
|
|
378
|
+
description: "Frequency penalty setting. It affects the likelihood of the model to repeatedly use the same words or phrases. A number between -1 (increase repetition) and 1 (maximum penalty, decrease repetition).",
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: "stopSequences",
|
|
382
|
+
type: "string[]",
|
|
383
|
+
isOptional: true,
|
|
384
|
+
description: "Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated.",
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
name: "seed",
|
|
388
|
+
type: "number",
|
|
389
|
+
isOptional: true,
|
|
390
|
+
description: "The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results.",
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: "headers",
|
|
394
|
+
type: "Record<string, string | undefined>",
|
|
395
|
+
isOptional: true,
|
|
396
|
+
description: "Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.",
|
|
397
|
+
}
|
|
398
|
+
]}
|
|
399
|
+
/>
|
|
400
|
+
|
|
401
|
+
## Returns
|
|
402
|
+
|
|
403
|
+
<PropertiesTable
|
|
404
|
+
content={[
|
|
405
|
+
{
|
|
406
|
+
name: "textStream",
|
|
407
|
+
type: "AsyncGenerator<string>",
|
|
408
|
+
isOptional: true,
|
|
409
|
+
description:
|
|
410
|
+
"Async generator that yields text chunks as they become available.",
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: "fullStream",
|
|
414
|
+
type: "Promise<ReadableStream>",
|
|
415
|
+
isOptional: true,
|
|
416
|
+
description:
|
|
417
|
+
"Promise that resolves to a ReadableStream for the complete response.",
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: "text",
|
|
421
|
+
type: "Promise<string>",
|
|
422
|
+
isOptional: true,
|
|
423
|
+
description:
|
|
424
|
+
"Promise that resolves to the complete text response.",
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
name: "usage",
|
|
428
|
+
type: "Promise<{ totalTokens: number; promptTokens: number; completionTokens: number }>",
|
|
429
|
+
isOptional: true,
|
|
430
|
+
description:
|
|
431
|
+
"Promise that resolves to token usage information.",
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: "finishReason",
|
|
435
|
+
type: "Promise<string>",
|
|
436
|
+
isOptional: true,
|
|
437
|
+
description:
|
|
438
|
+
"Promise that resolves to the reason why the stream finished.",
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: "toolCalls",
|
|
442
|
+
type: "Promise<Array<ToolCall>>",
|
|
443
|
+
isOptional: true,
|
|
444
|
+
description:
|
|
445
|
+
"Promise that resolves to the tool calls made during the streaming process.",
|
|
446
|
+
properties: [
|
|
447
|
+
{
|
|
448
|
+
parameters: [{
|
|
449
|
+
name: "toolName",
|
|
450
|
+
type: "string",
|
|
451
|
+
required: true,
|
|
452
|
+
description: "The name of the tool invoked."
|
|
453
|
+
}]
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
parameters: [{
|
|
457
|
+
name: "args",
|
|
458
|
+
type: "any",
|
|
459
|
+
required: true,
|
|
460
|
+
description: "The arguments passed to the tool."
|
|
461
|
+
}]
|
|
462
|
+
}
|
|
463
|
+
]
|
|
464
|
+
},
|
|
465
|
+
]}
|
|
466
|
+
/>
|
|
467
|
+
|
|
468
|
+
## Extended usage example
|
|
469
|
+
|
|
470
|
+
```typescript showLineNumbers copy
|
|
471
|
+
await agent.streamLegacy("message for agent", {
|
|
472
|
+
temperature: 0.7,
|
|
473
|
+
maxSteps: 3,
|
|
474
|
+
memory: {
|
|
475
|
+
thread: "user-123",
|
|
476
|
+
resource: "test-app"
|
|
477
|
+
},
|
|
478
|
+
toolChoice: "auto"
|
|
479
|
+
});
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
## Migration to New API
|
|
483
|
+
|
|
484
|
+
<Callout type="info">
|
|
485
|
+
The new `.stream()` method offers enhanced capabilities including AI SDK v5 compatibility, better structured output handling, and improved callback system. See the [migration guide](../../agents/migration-guide.mdx) for detailed migration instructions.
|
|
486
|
+
</Callout>
|
|
487
|
+
|
|
488
|
+
### Quick Migration Example
|
|
489
|
+
|
|
490
|
+
#### Before (Legacy)
|
|
491
|
+
```typescript
|
|
492
|
+
const result = await agent.streamLegacy("message", {
|
|
493
|
+
temperature: 0.7,
|
|
494
|
+
maxSteps: 3,
|
|
495
|
+
onFinish: (result) => console.log(result)
|
|
496
|
+
});
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
#### After (New API)
|
|
500
|
+
```typescript
|
|
501
|
+
const result = await agent.stream("message", {
|
|
502
|
+
modelSettings: {
|
|
503
|
+
temperature: 0.7
|
|
504
|
+
},
|
|
505
|
+
maxSteps: 3,
|
|
506
|
+
onFinish: (result) => console.log(result)
|
|
507
|
+
});
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
## Related
|
|
511
|
+
|
|
512
|
+
- [Migration Guide](../../agents/migration-guide.mdx)
|
|
513
|
+
- [New .stream() method](./stream.mdx)
|
|
514
|
+
- [Generating responses](../../docs/agents/overview.mdx#generating-responses)
|
|
515
|
+
- [Streaming responses](../../docs/agents/overview.mdx#streaming-responses)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: Astra Vector Store | Vector Databases |
|
|
2
|
+
title: "Reference: Astra Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for the AstraVector class in Mastra, which provides vector search using DataStax Astra DB.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -255,4 +255,4 @@ Required environment variables:
|
|
|
255
255
|
|
|
256
256
|
## Related
|
|
257
257
|
|
|
258
|
-
- [Metadata Filters](
|
|
258
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: Chroma Vector Store | Vector Databases |
|
|
2
|
+
title: "Reference: Chroma Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for the ChromaVector class in Mastra, which provides vector search using ChromaDB.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -419,4 +419,4 @@ try {
|
|
|
419
419
|
|
|
420
420
|
## Related
|
|
421
421
|
|
|
422
|
-
- [Metadata Filters](
|
|
422
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: Couchbase Vector Store | Vector Databases |
|
|
2
|
+
title: "Reference: Couchbase Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for the CouchbaseVector class in Mastra, which provides vector search using Couchbase Vector Search.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -342,4 +342,4 @@ try {
|
|
|
342
342
|
|
|
343
343
|
## Related
|
|
344
344
|
|
|
345
|
-
- [Metadata Filters](
|
|
345
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: Lance Vector Store | Vector Databases |
|
|
2
|
+
title: "Reference: Lance Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: "Documentation for the LanceVectorStore class in Mastra, which provides vector search using LanceDB, an embedded vector database based on the Lance columnar format."
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -448,4 +448,4 @@ try {
|
|
|
448
448
|
|
|
449
449
|
## Related
|
|
450
450
|
|
|
451
|
-
- [Metadata Filters](
|
|
451
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Default Vector Store | Vector Databases |
|
|
2
|
+
title: "Default Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for the LibSQLVector class in Mastra, which provides vector search using LibSQL with vector extensions.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -10,8 +10,6 @@ It's part of the `@mastra/libsql` package and offers efficient vector similarity
|
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
|
-
Default vector store is included in the core package:
|
|
14
|
-
|
|
15
13
|
```bash copy
|
|
16
14
|
npm install @mastra/libsql@latest
|
|
17
15
|
```
|
|
@@ -354,4 +352,4 @@ Common error cases include:
|
|
|
354
352
|
|
|
355
353
|
## Related
|
|
356
354
|
|
|
357
|
-
- [Metadata Filters](
|
|
355
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: MongoDB Vector Store | Vector Databases |
|
|
2
|
+
title: "Reference: MongoDB Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for the MongoDBVector class in Mastra, which provides vector search using MongoDB Atlas and Atlas Vector Search.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -306,4 +306,4 @@ try {
|
|
|
306
306
|
|
|
307
307
|
## Related
|
|
308
308
|
|
|
309
|
-
- [Metadata Filters](
|
|
309
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: OpenSearch Vector Store | Vector Databases |
|
|
2
|
+
title: "Reference: OpenSearch Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for the OpenSearchVector class in Mastra, which provides vector search using OpenSearch.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -197,4 +197,4 @@ Deletes specific vector entries by their IDs from the index.
|
|
|
197
197
|
|
|
198
198
|
## Related
|
|
199
199
|
|
|
200
|
-
- [Metadata Filters](
|
|
200
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: PG Vector Store | Vector Databases |
|
|
2
|
+
title: "Reference: PG Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for the PgVector class in Mastra, which provides vector search using PostgreSQL with pgvector extension.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -548,4 +548,4 @@ This design supports advanced use cases but requires careful resource management
|
|
|
548
548
|
|
|
549
549
|
## Related
|
|
550
550
|
|
|
551
|
-
- [Metadata Filters](
|
|
551
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: Pinecone Vector Store | Vector DBs |
|
|
2
|
+
title: "Reference: Pinecone Vector Store | Vector DBs | Mastra Docs"
|
|
3
3
|
description: Documentation for the PineconeVector class in Mastra, which provides an interface to Pinecone's vector database.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -283,4 +283,4 @@ Pinecone supports hybrid search by combining dense and sparse vectors. To use hy
|
|
|
283
283
|
|
|
284
284
|
## Related
|
|
285
285
|
|
|
286
|
-
- [Metadata Filters](
|
|
286
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: Qdrant Vector Store | Vector Databases |
|
|
2
|
+
title: "Reference: Qdrant Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for integrating Qdrant with Mastra, a vector similarity search engine for managing vectors and payloads.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -233,4 +233,4 @@ try {
|
|
|
233
233
|
|
|
234
234
|
## Related
|
|
235
235
|
|
|
236
|
-
- [Metadata Filters](
|
|
236
|
+
- [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: Amazon S3 Vectors Store | Vector Databases |
|
|
2
|
+
title: "Reference: Amazon S3 Vectors Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for the S3Vectors class in Mastra, which provides vector search using Amazon S3 Vectors (Preview).
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -383,4 +383,4 @@ Typical environment variables when wiring your app:
|
|
|
383
383
|
|
|
384
384
|
## Related
|
|
385
385
|
|
|
386
|
-
* [Metadata Filters](
|
|
386
|
+
* [Metadata Filters](../rag/metadata-filters)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: Turbopuffer Vector Store | Vector Databases |
|
|
2
|
+
title: "Reference: Turbopuffer Vector Store | Vector Databases | Mastra Docs"
|
|
3
3
|
description: Documentation for integrating Turbopuffer with Mastra, a high-performance vector database for efficient similarity search.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -246,4 +246,4 @@ try {
|
|
|
246
246
|
|
|
247
247
|
## Related
|
|
248
248
|
|
|
249
|
-
- [Metadata Filters](
|
|
249
|
+
- [Metadata Filters](../rag/metadata-filters)
|