@mastra/mcp-docs-server 1.1.7 → 1.1.8
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/docs/agents/agent-approval.md +61 -31
- package/.docs/docs/agents/supervisor-agents.md +1 -1
- package/.docs/docs/getting-started/manual-install.md +1 -1
- package/.docs/docs/index.md +68 -24
- package/.docs/docs/mastra-cloud/setup.md +1 -1
- package/.docs/docs/memory/observational-memory.md +9 -0
- package/.docs/docs/memory/semantic-recall.md +17 -1
- package/.docs/docs/workspace/skills.md +7 -5
- package/.docs/guides/deployment/aws-lambda.md +76 -165
- package/.docs/guides/deployment/azure-app-services.md +38 -61
- package/.docs/guides/deployment/cloudflare.md +1 -1
- package/.docs/guides/deployment/netlify.md +1 -1
- package/.docs/guides/deployment/vercel.md +1 -1
- package/.docs/models/gateways/netlify.md +5 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/anthropic.md +9 -9
- package/.docs/models/providers/deepseek.md +1 -1
- package/.docs/models/providers/google.md +11 -11
- package/.docs/models/providers/openai.md +19 -19
- package/.docs/models/providers/opencode.md +33 -33
- package/.docs/models/providers/xai.md +3 -3
- package/.docs/reference/agents/agent.md +20 -20
- package/.docs/reference/agents/generate.md +200 -66
- package/.docs/reference/agents/generateLegacy.md +77 -35
- package/.docs/reference/agents/getDefaultGenerateOptions.md +4 -6
- package/.docs/reference/agents/getDefaultOptions.md +4 -6
- package/.docs/reference/agents/getDefaultStreamOptions.md +4 -6
- package/.docs/reference/agents/getDescription.md +1 -1
- package/.docs/reference/agents/getInstructions.md +4 -6
- package/.docs/reference/agents/getLLM.md +6 -8
- package/.docs/reference/agents/getMemory.md +4 -6
- package/.docs/reference/agents/getModel.md +4 -6
- package/.docs/reference/agents/getTools.md +5 -7
- package/.docs/reference/agents/getVoice.md +4 -6
- package/.docs/reference/agents/listAgents.md +4 -6
- package/.docs/reference/agents/listScorers.md +4 -6
- package/.docs/reference/agents/listTools.md +4 -6
- package/.docs/reference/agents/listWorkflows.md +4 -6
- package/.docs/reference/agents/network.md +69 -23
- package/.docs/reference/ai-sdk/chat-route.md +7 -7
- package/.docs/reference/ai-sdk/handle-chat-stream.md +12 -12
- package/.docs/reference/ai-sdk/handle-network-stream.md +4 -4
- package/.docs/reference/ai-sdk/handle-workflow-stream.md +11 -11
- package/.docs/reference/ai-sdk/network-route.md +3 -3
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +9 -9
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +9 -9
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +5 -5
- package/.docs/reference/ai-sdk/with-mastra.md +12 -12
- package/.docs/reference/ai-sdk/workflow-route.md +3 -3
- package/.docs/reference/auth/auth0.md +6 -6
- package/.docs/reference/auth/better-auth.md +5 -5
- package/.docs/reference/auth/clerk.md +5 -5
- package/.docs/reference/auth/firebase.md +7 -7
- package/.docs/reference/auth/jwt.md +1 -1
- package/.docs/reference/auth/supabase.md +4 -4
- package/.docs/reference/auth/workos.md +6 -6
- package/.docs/reference/cli/create-mastra.md +14 -14
- package/.docs/reference/client-js/mastra-client.md +23 -23
- package/.docs/reference/client-js/workflows.md +3 -3
- package/.docs/reference/core/addGateway.md +2 -2
- package/.docs/reference/core/getAgent.md +2 -2
- package/.docs/reference/core/getAgentById.md +2 -2
- package/.docs/reference/core/getDeployer.md +1 -1
- package/.docs/reference/core/getGateway.md +2 -2
- package/.docs/reference/core/getGatewayById.md +2 -2
- package/.docs/reference/core/getLogger.md +1 -1
- package/.docs/reference/core/getMCPServer.md +2 -2
- package/.docs/reference/core/getMCPServerById.md +3 -3
- package/.docs/reference/core/getMemory.md +2 -2
- package/.docs/reference/core/getScorer.md +2 -2
- package/.docs/reference/core/getScorerById.md +2 -2
- package/.docs/reference/core/getServer.md +1 -1
- package/.docs/reference/core/getStorage.md +1 -1
- package/.docs/reference/core/getStoredAgentById.md +18 -20
- package/.docs/reference/core/getTelemetry.md +1 -1
- package/.docs/reference/core/getVector.md +2 -2
- package/.docs/reference/core/getWorkflow.md +3 -3
- package/.docs/reference/core/listAgents.md +1 -1
- package/.docs/reference/core/listGateways.md +1 -1
- package/.docs/reference/core/listLogs.md +9 -11
- package/.docs/reference/core/listLogsByRunId.md +9 -9
- package/.docs/reference/core/listMCPServers.md +1 -1
- package/.docs/reference/core/listMemory.md +1 -1
- package/.docs/reference/core/listScorers.md +1 -1
- package/.docs/reference/core/listStoredAgents.md +9 -11
- package/.docs/reference/core/listVectors.md +1 -1
- package/.docs/reference/core/listWorkflows.md +2 -2
- package/.docs/reference/core/mastra-class.md +17 -17
- package/.docs/reference/core/mastra-model-gateway.md +15 -15
- package/.docs/reference/core/setLogger.md +2 -4
- package/.docs/reference/core/setStorage.md +1 -1
- package/.docs/reference/datasets/addItem.md +20 -4
- package/.docs/reference/datasets/addItems.md +8 -2
- package/.docs/reference/datasets/compareExperiments.md +15 -3
- package/.docs/reference/datasets/create.md +6 -6
- package/.docs/reference/datasets/dataset.md +1 -1
- package/.docs/reference/datasets/delete.md +2 -2
- package/.docs/reference/datasets/deleteExperiment.md +2 -2
- package/.docs/reference/datasets/deleteItem.md +2 -2
- package/.docs/reference/datasets/deleteItems.md +2 -2
- package/.docs/reference/datasets/get.md +2 -2
- package/.docs/reference/datasets/getDetails.md +9 -9
- package/.docs/reference/datasets/getExperiment.md +2 -2
- package/.docs/reference/datasets/getItem.md +3 -3
- package/.docs/reference/datasets/getItemHistory.md +22 -2
- package/.docs/reference/datasets/list.md +7 -3
- package/.docs/reference/datasets/listExperimentResults.md +34 -4
- package/.docs/reference/datasets/listExperiments.md +41 -3
- package/.docs/reference/datasets/listItems.md +18 -6
- package/.docs/reference/datasets/listVersions.md +23 -3
- package/.docs/reference/datasets/startExperiment.md +62 -12
- package/.docs/reference/datasets/startExperimentAsync.md +5 -1
- package/.docs/reference/datasets/update.md +6 -6
- package/.docs/reference/datasets/updateItem.md +5 -5
- package/.docs/reference/deployer.md +8 -8
- package/.docs/reference/evals/answer-relevancy.md +11 -11
- package/.docs/reference/evals/answer-similarity.md +17 -19
- package/.docs/reference/evals/bias.md +10 -10
- package/.docs/reference/evals/completeness.md +3 -3
- package/.docs/reference/evals/content-similarity.md +6 -6
- package/.docs/reference/evals/context-precision.md +4 -4
- package/.docs/reference/evals/context-relevance.md +4 -4
- package/.docs/reference/evals/create-scorer.md +47 -49
- package/.docs/reference/evals/faithfulness.md +11 -11
- package/.docs/reference/evals/hallucination.md +17 -21
- package/.docs/reference/evals/keyword-coverage.md +4 -4
- package/.docs/reference/evals/mastra-scorer.md +14 -14
- package/.docs/reference/evals/noise-sensitivity.md +4 -4
- package/.docs/reference/evals/prompt-alignment.md +4 -4
- package/.docs/reference/evals/run-evals.md +16 -16
- package/.docs/reference/evals/scorer-utils.md +3 -3
- package/.docs/reference/evals/textual-difference.md +3 -3
- package/.docs/reference/evals/tone-consistency.md +3 -3
- package/.docs/reference/evals/tool-call-accuracy.md +5 -5
- package/.docs/reference/evals/toxicity.md +8 -8
- package/.docs/reference/harness/harness-class.md +34 -42
- package/.docs/reference/logging/pino-logger.md +5 -5
- package/.docs/reference/memory/clone-utilities.md +5 -5
- package/.docs/reference/memory/cloneThread.md +17 -21
- package/.docs/reference/memory/createThread.md +10 -10
- package/.docs/reference/memory/deleteMessages.md +2 -2
- package/.docs/reference/memory/getThreadById.md +2 -2
- package/.docs/reference/memory/listThreads.md +5 -5
- package/.docs/reference/memory/memory-class.md +12 -14
- package/.docs/reference/memory/observational-memory.md +102 -94
- package/.docs/reference/memory/recall.md +14 -16
- package/.docs/reference/observability/tracing/configuration.md +27 -10
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +4 -7
- package/.docs/reference/processors/batch-parts-processor.md +8 -10
- package/.docs/reference/processors/language-detector.md +14 -16
- package/.docs/reference/processors/message-history-processor.md +7 -9
- package/.docs/reference/processors/moderation-processor.md +13 -15
- package/.docs/reference/processors/pii-detector.md +14 -16
- package/.docs/reference/processors/processor-interface.md +62 -62
- package/.docs/reference/processors/prompt-injection-detector.md +11 -13
- package/.docs/reference/processors/semantic-recall-processor.md +14 -16
- package/.docs/reference/processors/system-prompt-scrubber.md +12 -14
- package/.docs/reference/processors/token-limiter-processor.md +11 -13
- package/.docs/reference/processors/tool-call-filter.md +5 -7
- package/.docs/reference/processors/tool-search-processor.md +9 -11
- package/.docs/reference/processors/unicode-normalizer.md +8 -10
- package/.docs/reference/processors/working-memory-processor.md +14 -18
- package/.docs/reference/rag/chunk.md +38 -38
- package/.docs/reference/rag/database-config.md +11 -7
- package/.docs/reference/rag/document.md +2 -2
- package/.docs/reference/rag/embeddings.md +12 -12
- package/.docs/reference/rag/extract-params.md +23 -23
- package/.docs/reference/rag/graph-rag.md +12 -12
- package/.docs/reference/rag/rerank.md +25 -17
- package/.docs/reference/rag/rerankWithScorer.md +25 -17
- package/.docs/reference/server/create-route.md +14 -14
- package/.docs/reference/server/express-adapter.md +10 -10
- package/.docs/reference/server/fastify-adapter.md +10 -10
- package/.docs/reference/server/hono-adapter.md +10 -10
- package/.docs/reference/server/koa-adapter.md +10 -10
- package/.docs/reference/server/mastra-server.md +10 -10
- package/.docs/reference/server/register-api-route.md +13 -13
- package/.docs/reference/storage/cloudflare-d1.md +5 -5
- package/.docs/reference/storage/cloudflare.md +6 -6
- package/.docs/reference/storage/composite.md +9 -9
- package/.docs/reference/storage/convex.md +3 -3
- package/.docs/reference/storage/dynamodb.md +9 -9
- package/.docs/reference/storage/lance.md +3 -3
- package/.docs/reference/storage/libsql.md +2 -2
- package/.docs/reference/storage/mongodb.md +5 -5
- package/.docs/reference/storage/mssql.md +2 -2
- package/.docs/reference/storage/postgresql.md +25 -25
- package/.docs/reference/storage/upstash.md +3 -3
- package/.docs/reference/streaming/ChunkType.md +251 -59
- package/.docs/reference/streaming/agents/MastraModelOutput.md +86 -16
- package/.docs/reference/streaming/agents/stream.md +155 -43
- package/.docs/reference/streaming/agents/streamLegacy.md +79 -39
- package/.docs/reference/streaming/workflows/resumeStream.md +18 -8
- package/.docs/reference/streaming/workflows/stream.md +21 -9
- package/.docs/reference/streaming/workflows/timeTravelStream.md +4 -4
- package/.docs/reference/tools/create-tool.md +25 -21
- package/.docs/reference/tools/document-chunker-tool.md +7 -7
- package/.docs/reference/tools/graph-rag-tool.md +16 -18
- package/.docs/reference/tools/mcp-client.md +38 -27
- package/.docs/reference/tools/mcp-server.md +45 -45
- package/.docs/reference/tools/vector-query-tool.md +34 -22
- package/.docs/reference/vectors/astra.md +22 -22
- package/.docs/reference/vectors/chroma.md +44 -44
- package/.docs/reference/vectors/convex.md +26 -26
- package/.docs/reference/vectors/couchbase.md +30 -30
- package/.docs/reference/vectors/duckdb.md +29 -29
- package/.docs/reference/vectors/elasticsearch.md +27 -27
- package/.docs/reference/vectors/lance.md +46 -38
- package/.docs/reference/vectors/libsql.md +31 -31
- package/.docs/reference/vectors/mongodb.md +32 -32
- package/.docs/reference/vectors/opensearch.md +27 -27
- package/.docs/reference/vectors/pg.md +60 -44
- package/.docs/reference/vectors/pinecone.md +38 -38
- package/.docs/reference/vectors/qdrant.md +36 -36
- package/.docs/reference/vectors/s3vectors.md +24 -24
- package/.docs/reference/vectors/turbopuffer.md +29 -29
- package/.docs/reference/vectors/upstash.md +25 -25
- package/.docs/reference/vectors/vectorize.md +27 -27
- package/.docs/reference/voice/azure.md +19 -15
- package/.docs/reference/voice/cloudflare.md +10 -12
- package/.docs/reference/voice/composite-voice.md +10 -10
- package/.docs/reference/voice/deepgram.md +20 -14
- package/.docs/reference/voice/elevenlabs.md +20 -22
- package/.docs/reference/voice/google-gemini-live.md +42 -44
- package/.docs/reference/voice/google.md +25 -21
- package/.docs/reference/voice/mastra-voice.md +20 -20
- package/.docs/reference/voice/murf.md +24 -28
- package/.docs/reference/voice/openai-realtime.md +26 -26
- package/.docs/reference/voice/openai.md +14 -12
- package/.docs/reference/voice/playai.md +13 -15
- package/.docs/reference/voice/sarvam.md +21 -25
- package/.docs/reference/voice/speechify.md +11 -13
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/voice/voice.addTools.md +1 -1
- package/.docs/reference/voice/voice.answer.md +1 -1
- package/.docs/reference/voice/voice.connect.md +3 -3
- package/.docs/reference/voice/voice.events.md +11 -11
- package/.docs/reference/voice/voice.getSpeakers.md +30 -30
- package/.docs/reference/voice/voice.listen.md +9 -9
- package/.docs/reference/voice/voice.off.md +2 -2
- package/.docs/reference/voice/voice.on.md +2 -2
- package/.docs/reference/voice/voice.send.md +1 -1
- package/.docs/reference/voice/voice.speak.md +11 -11
- package/.docs/reference/voice/voice.updateConfig.md +3 -3
- package/.docs/reference/workflows/run-methods/cancel.md +2 -2
- package/.docs/reference/workflows/run-methods/restart.md +17 -5
- package/.docs/reference/workflows/run-methods/resume.md +23 -9
- package/.docs/reference/workflows/run-methods/start.md +22 -8
- package/.docs/reference/workflows/run-methods/startAsync.md +12 -6
- package/.docs/reference/workflows/run-methods/timeTravel.md +29 -13
- package/.docs/reference/workflows/run.md +12 -12
- package/.docs/reference/workflows/step.md +24 -26
- package/.docs/reference/workflows/workflow-methods/branch.md +2 -2
- package/.docs/reference/workflows/workflow-methods/commit.md +1 -1
- package/.docs/reference/workflows/workflow-methods/create-run.md +4 -4
- package/.docs/reference/workflows/workflow-methods/dountil.md +3 -3
- package/.docs/reference/workflows/workflow-methods/dowhile.md +3 -3
- package/.docs/reference/workflows/workflow-methods/foreach.md +9 -9
- package/.docs/reference/workflows/workflow-methods/map.md +2 -2
- package/.docs/reference/workflows/workflow-methods/parallel.md +2 -2
- package/.docs/reference/workflows/workflow-methods/sleep.md +2 -2
- package/.docs/reference/workflows/workflow-methods/sleepUntil.md +2 -2
- package/.docs/reference/workflows/workflow-methods/then.md +2 -2
- package/.docs/reference/workflows/workflow.md +40 -50
- package/.docs/reference/workspace/daytona-sandbox.md +33 -33
- package/.docs/reference/workspace/e2b-sandbox.md +20 -20
- package/.docs/reference/workspace/filesystem.md +22 -22
- package/.docs/reference/workspace/gcs-filesystem.md +15 -15
- package/.docs/reference/workspace/local-filesystem.md +35 -35
- package/.docs/reference/workspace/local-sandbox.md +26 -26
- package/.docs/reference/workspace/s3-filesystem.md +18 -18
- package/.docs/reference/workspace/sandbox.md +8 -8
- package/.docs/reference/workspace/workspace-class.md +30 -34
- package/CHANGELOG.md +16 -0
- package/package.json +6 -6
- package/.docs/docs/getting-started/start.md +0 -28
|
@@ -10,11 +10,13 @@ await agent.getDefaultOptions()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**defaultOptions
|
|
19
|
+
**defaultOptions** (`AgentExecutionOptions<Output> | Promise<AgentExecutionOptions<Output>>`): The default streaming options configured for the agent, either as a direct object or a promise that resolves to the options.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -24,10 +26,6 @@ await agent.getDefaultOptions({
|
|
|
24
26
|
})
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
### Options parameters
|
|
28
|
-
|
|
29
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
30
|
-
|
|
31
29
|
## Related
|
|
32
30
|
|
|
33
31
|
- [Streaming with agents](https://mastra.ai/docs/streaming/overview)
|
|
@@ -12,11 +12,13 @@ await agent.getDefaultStreamOptionsLegacy()
|
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
15
|
-
**options
|
|
15
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
16
|
+
|
|
17
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
16
18
|
|
|
17
19
|
## Returns
|
|
18
20
|
|
|
19
|
-
**defaultOptions
|
|
21
|
+
**defaultOptions** (`AgentStreamOptions | Promise<AgentStreamOptions>`): The default vNext streaming options configured for the agent, either as a direct object or a promise that resolves to the options.
|
|
20
22
|
|
|
21
23
|
## Extended usage example
|
|
22
24
|
|
|
@@ -26,10 +28,6 @@ await agent.getDefaultStreamOptionsLegacy({
|
|
|
26
28
|
})
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
### Options parameters
|
|
30
|
-
|
|
31
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
32
|
-
|
|
33
31
|
## Related
|
|
34
32
|
|
|
35
33
|
- [Streaming with agents](https://mastra.ai/docs/streaming/overview)
|
|
@@ -14,7 +14,7 @@ This method takes no parameters.
|
|
|
14
14
|
|
|
15
15
|
## Returns
|
|
16
16
|
|
|
17
|
-
**description
|
|
17
|
+
**description** (`string`): The description of the agent, or an empty string if no description was configured.
|
|
18
18
|
|
|
19
19
|
## Related
|
|
20
20
|
|
|
@@ -10,11 +10,13 @@ await agent.getInstructions()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**instructions
|
|
19
|
+
**instructions** (`SystemMessage | Promise<SystemMessage>`): The instructions configured for the agent. SystemMessage can be: string | string\[] | CoreSystemMessage | CoreSystemMessage\[] | SystemModelMessage | SystemModelMessage\[]. Returns either directly or as a promise that resolves to the instructions.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -24,10 +26,6 @@ await agent.getInstructions({
|
|
|
24
26
|
})
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
### Options parameters
|
|
28
|
-
|
|
29
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `undefined`)
|
|
30
|
-
|
|
31
29
|
## Related
|
|
32
30
|
|
|
33
31
|
- [Agents overview](https://mastra.ai/docs/agents/overview)
|
|
@@ -10,11 +10,15 @@ await agent.getLLM()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext; model?: MastraLanguageModel | DynamicArgument<MastraLanguageModel> }`): Optional configuration object containing request context and optional model override. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
16
|
+
|
|
17
|
+
**options.model** (`MastraLanguageModel | DynamicArgument<MastraLanguageModel>`): Optional model override. If provided, this model will be used used instead of the agent's configured model.
|
|
14
18
|
|
|
15
19
|
## Returns
|
|
16
20
|
|
|
17
|
-
**llm
|
|
21
|
+
**llm** (`MastraLLMV1 | Promise<MastraLLMV1>`): The language model instance configured for the agent, either as a direct instance or a promise that resolves to the LLM.
|
|
18
22
|
|
|
19
23
|
## Extended usage example
|
|
20
24
|
|
|
@@ -25,12 +29,6 @@ await agent.getLLM({
|
|
|
25
29
|
})
|
|
26
30
|
```
|
|
27
31
|
|
|
28
|
-
### Options parameters
|
|
29
|
-
|
|
30
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
31
|
-
|
|
32
|
-
**model?:** (`MastraLanguageModel | DynamicArgument<MastraLanguageModel>`): Optional model override. If provided, this model will be used used instead of the agent's configured model.
|
|
33
|
-
|
|
34
32
|
## Related
|
|
35
33
|
|
|
36
34
|
- [Agents overview](https://mastra.ai/docs/agents/overview)
|
|
@@ -10,11 +10,13 @@ await agent.getMemory()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**memory
|
|
19
|
+
**memory** (`Promise<MastraMemory | undefined>`): A promise that resolves to the memory system configured for the agent, or undefined if no memory system is configured.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -24,10 +26,6 @@ await agent.getMemory({
|
|
|
24
26
|
})
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
### Options parameters
|
|
28
|
-
|
|
29
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
30
|
-
|
|
31
29
|
## Related
|
|
32
30
|
|
|
33
31
|
- [Agent memory](https://mastra.ai/docs/agents/agent-memory)
|
|
@@ -10,11 +10,13 @@ await agent.getModel()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**model
|
|
19
|
+
**model** (`MastraLanguageModel | Promise<MastraLanguageModel>`): The language model configured for the agent, either as a direct instance or a promise that resolves to the model.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -24,10 +26,6 @@ await agent.getModel({
|
|
|
24
26
|
})
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
### Options parameters
|
|
28
|
-
|
|
29
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `undefined`)
|
|
30
|
-
|
|
31
29
|
## Related
|
|
32
30
|
|
|
33
31
|
- [Agents overview](https://mastra.ai/docs/agents/overview)
|
|
@@ -10,11 +10,13 @@ await agent.getTools()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing runtime context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Runtime context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**tools
|
|
19
|
+
**tools** (`TTools | Promise<TTools>`): The tools configured for the agent, either as a direct object or a promise that resolves to the tools.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -22,8 +24,4 @@ await agent.getTools()
|
|
|
22
24
|
await agent.getTools({
|
|
23
25
|
requestContext: new RequestContext(),
|
|
24
26
|
})
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Options parameters
|
|
28
|
-
|
|
29
|
-
**requestContext?:** (`RequestContext`): Runtime context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
27
|
+
```
|
|
@@ -10,11 +10,13 @@ await agent.getVoice()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**voice
|
|
19
|
+
**voice** (`Promise<MastraVoice>`): A promise that resolves to the voice provider configured for the agent, or a default voice provider if none was configured.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -24,10 +26,6 @@ await agent.getVoice({
|
|
|
24
26
|
})
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
### Options parameters
|
|
28
|
-
|
|
29
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
30
|
-
|
|
31
29
|
## Related
|
|
32
30
|
|
|
33
31
|
- [Adding voice to agents](https://mastra.ai/docs/agents/adding-voice)
|
|
@@ -10,11 +10,13 @@ await agent.listAgents()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**agents
|
|
19
|
+
**agents** (`Promise<Record<string, Agent>>`): A promise that resolves to a record of agent names to their corresponding Agent instances.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -26,10 +28,6 @@ await agent.listAgents({
|
|
|
26
28
|
})
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
### Options parameters
|
|
30
|
-
|
|
31
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
32
|
-
|
|
33
31
|
## Related
|
|
34
32
|
|
|
35
33
|
- [Agents overview](https://mastra.ai/docs/agents/overview)
|
|
@@ -10,11 +10,13 @@ await agent.listScorers()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**scorers
|
|
19
|
+
**scorers** (`MastraScorers | Promise<MastraScorers>`): The scoring configuration configured for the agent, either as a direct object or a promise that resolves to the scorers.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -24,10 +26,6 @@ await agent.listScorers({
|
|
|
24
26
|
})
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
### Options parameters
|
|
28
|
-
|
|
29
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
30
|
-
|
|
31
29
|
## Related
|
|
32
30
|
|
|
33
31
|
- [Agents overview](https://mastra.ai/docs/agents/overview)
|
|
@@ -10,11 +10,13 @@ await agent.listTools()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**tools
|
|
19
|
+
**tools** (`TTools | Promise<TTools>`): The tools configured for the agent, either as a direct object or a promise that resolves to the tools.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -24,10 +26,6 @@ await agent.listTools({
|
|
|
24
26
|
})
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
### Options parameters
|
|
28
|
-
|
|
29
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
30
|
-
|
|
31
29
|
## Related
|
|
32
30
|
|
|
33
31
|
- [Using tools with agents](https://mastra.ai/docs/agents/using-tools)
|
|
@@ -10,11 +10,13 @@ await agent.listWorkflows()
|
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
13
|
-
**options
|
|
13
|
+
**options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`)
|
|
14
|
+
|
|
15
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
14
16
|
|
|
15
17
|
## Returns
|
|
16
18
|
|
|
17
|
-
**workflows
|
|
19
|
+
**workflows** (`Promise<Record<string, Workflow>>`): A promise that resolves to a record of workflow names to their corresponding Workflow instances.
|
|
18
20
|
|
|
19
21
|
## Extended usage example
|
|
20
22
|
|
|
@@ -24,10 +26,6 @@ await agent.listWorkflows({
|
|
|
24
26
|
})
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
### Options parameters
|
|
28
|
-
|
|
29
|
-
**requestContext?:** (`RequestContext`): Request Context for dependency injection and contextual information. (Default: `new RequestContext()`)
|
|
30
|
-
|
|
31
29
|
## Related
|
|
32
30
|
|
|
33
31
|
- [Agents overview](https://mastra.ai/docs/agents/overview)
|
|
@@ -36,53 +36,99 @@ await agent.network(`
|
|
|
36
36
|
|
|
37
37
|
## Parameters
|
|
38
38
|
|
|
39
|
-
**messages
|
|
39
|
+
**messages** (`string | string[] | CoreMessage[] | AiMessageType[] | UIMessageWithMetadata[]`): The messages to send to the agent. Can be a single string, array of strings, or structured message objects.
|
|
40
40
|
|
|
41
|
-
**options
|
|
41
|
+
**options** (`MultiPrimitiveExecutionOptions`): Optional configuration for the network process.
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
**options.maxSteps** (`number`): Maximum number of steps to run during execution.
|
|
44
44
|
|
|
45
|
-
**
|
|
45
|
+
**options.abortSignal** (`AbortSignal`): Signal to abort the network execution. When aborted, the network stops routing, cancels any in-progress sub-agent, tool, or workflow execution, and skips saving partial results to memory.
|
|
46
46
|
|
|
47
|
-
**
|
|
47
|
+
**options.onAbort** (`(event: { primitiveType: string; primitiveId: string; iteration: number }) => void | Promise<void>`): Callback fired when the network is aborted. Receives an event with the type and ID of the primitive that was executing when the abort occurred.
|
|
48
48
|
|
|
49
|
-
**
|
|
49
|
+
**options.memory** (`object`): Configuration for memory. This is the preferred way to manage memory.
|
|
50
50
|
|
|
51
|
-
**memory
|
|
51
|
+
**options.memory.thread** (`string | { id: string; metadata?: Record<string, any>, title?: string }`): The conversation thread, as a string ID or an object with an \`id\` and optional \`metadata\`.
|
|
52
52
|
|
|
53
|
-
**
|
|
53
|
+
**options.memory.resource** (`string`): Identifier for the user or resource associated with the thread.
|
|
54
54
|
|
|
55
|
-
**
|
|
55
|
+
**options.memory.options** (`MemoryConfig`): Configuration for memory behavior, like message history and semantic recall.
|
|
56
56
|
|
|
57
|
-
**
|
|
57
|
+
**options.tracingContext** (`TracingContext`): Tracing context for creating child spans and adding metadata. Automatically injected when using Mastra's tracing system.
|
|
58
58
|
|
|
59
|
-
**
|
|
59
|
+
**options.tracingContext.currentSpan** (`Span`): Current span for creating child spans and adding metadata. Use this to create custom child spans or update span attributes during execution.
|
|
60
60
|
|
|
61
|
-
**
|
|
61
|
+
**options.tracingOptions** (`TracingOptions`): Options for Tracing configuration.
|
|
62
62
|
|
|
63
|
-
**
|
|
63
|
+
**options.tracingOptions.metadata** (`Record<string, any>`): Metadata to add to the root trace span. Useful for adding custom attributes like user IDs, session IDs, or feature flags.
|
|
64
64
|
|
|
65
|
-
**
|
|
65
|
+
**options.tracingOptions.requestContextKeys** (`string[]`): Additional RequestContext keys to extract as metadata for this trace. Supports dot notation for nested values (e.g., 'user.id').
|
|
66
66
|
|
|
67
|
-
**traceId
|
|
67
|
+
**options.tracingOptions.traceId** (`string`): Trace ID to use for this execution (1-32 hexadecimal characters). If provided, this trace will be part of the specified trace.
|
|
68
68
|
|
|
69
|
-
**
|
|
69
|
+
**options.tracingOptions.parentSpanId** (`string`): Parent span ID to use for this execution (1-16 hexadecimal characters). If provided, the root span will be created as a child of this span.
|
|
70
70
|
|
|
71
|
-
**
|
|
71
|
+
**options.tracingOptions.tags** (`string[]`): Tags to apply to this trace. String labels for categorizing and filtering traces.
|
|
72
|
+
|
|
73
|
+
**options.telemetry** (`TelemetrySettings`): Settings for OTLP telemetry collection during streaming (not Tracing).
|
|
74
|
+
|
|
75
|
+
**options.telemetry.isEnabled** (`boolean`): Enable or disable telemetry. Disabled by default while experimental.
|
|
76
|
+
|
|
77
|
+
**options.telemetry.recordInputs** (`boolean`): Enable or disable input recording. Enabled by default. You might want to disable input recording to avoid recording sensitive information.
|
|
78
|
+
|
|
79
|
+
**options.telemetry.recordOutputs** (`boolean`): Enable or disable output recording. Enabled by default. You might want to disable output recording to avoid recording sensitive information.
|
|
80
|
+
|
|
81
|
+
**options.telemetry.functionId** (`string`): Identifier for this function. Used to group telemetry data by function.
|
|
82
|
+
|
|
83
|
+
**options.modelSettings** (`CallSettings`): Model-specific settings like temperature, maxOutputTokens, topP, etc. These settings control how the language model generates responses.
|
|
84
|
+
|
|
85
|
+
**options.modelSettings.temperature** (`number`): Controls randomness in generation (0-2). Higher values make output more random.
|
|
86
|
+
|
|
87
|
+
**options.modelSettings.maxOutputTokens** (`number`): Maximum number of tokens to generate in the response. Note: Use maxOutputTokens (not maxTokens) as per AI SDK v5 convention.
|
|
88
|
+
|
|
89
|
+
**options.modelSettings.maxRetries** (`number`): Maximum number of retry attempts for failed requests.
|
|
90
|
+
|
|
91
|
+
**options.modelSettings.topP** (`number`): Nucleus sampling parameter (0-1). Controls diversity of generated text.
|
|
92
|
+
|
|
93
|
+
**options.modelSettings.topK** (`number`): Top-k sampling parameter. Limits vocabulary to k most likely tokens.
|
|
94
|
+
|
|
95
|
+
**options.modelSettings.presencePenalty** (`number`): Penalty for token presence (-2 to 2). Reduces repetition.
|
|
96
|
+
|
|
97
|
+
**options.modelSettings.frequencyPenalty** (`number`): Penalty for token frequency (-2 to 2). Reduces repetition of frequent tokens.
|
|
98
|
+
|
|
99
|
+
**options.modelSettings.stopSequences** (`string[]`): Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated.
|
|
100
|
+
|
|
101
|
+
**options.structuredOutput** (`StructuredOutputOptions`): Configuration for generating a typed structured output from the network result.
|
|
102
|
+
|
|
103
|
+
**options.structuredOutput.schema** (`ZodSchema | JSONSchema7`): The schema to validate the output against. Can be a Zod schema or JSON Schema.
|
|
104
|
+
|
|
105
|
+
**options.structuredOutput.model** (`MastraModelConfig`): Model to use for generating the structured output. Defaults to the agent's model.
|
|
106
|
+
|
|
107
|
+
**options.structuredOutput.instructions** (`string`): Custom instructions for generating the structured output.
|
|
108
|
+
|
|
109
|
+
**options.runId** (`string`): Unique ID for this generation run. Useful for tracking and debugging purposes.
|
|
110
|
+
|
|
111
|
+
**options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information.
|
|
112
|
+
|
|
113
|
+
**options.traceId** (`string`): The trace ID associated with this execution when Tracing is enabled. Use this to correlate logs and debug execution flow.
|
|
114
|
+
|
|
115
|
+
**options.onStepFinish** (`(event: any) => Promise<void> | void`): Callback fired after each LLM step within a sub-agent execution. Receives step details including finish reason and token usage.
|
|
116
|
+
|
|
117
|
+
**options.onError** (`({ error }: { error: Error | string }) => Promise<void> | void`): Callback fired when an error occurs during sub-agent execution.
|
|
72
118
|
|
|
73
119
|
## Returns
|
|
74
120
|
|
|
75
|
-
**stream
|
|
121
|
+
**stream** (`MastraAgentNetworkStream<NetworkChunkType>`): A custom stream that extends ReadableStream\<NetworkChunkType> with additional network-specific properties
|
|
76
122
|
|
|
77
|
-
**status
|
|
123
|
+
**status** (`Promise<RunStatus>`): A promise that resolves to the current workflow run status
|
|
78
124
|
|
|
79
|
-
**result
|
|
125
|
+
**result** (`Promise<WorkflowResult<TState, TOutput, TSteps>>`): A promise that resolves to the final workflow result
|
|
80
126
|
|
|
81
|
-
**usage
|
|
127
|
+
**usage** (`Promise<{ promptTokens: number; completionTokens: number; totalTokens: number }>`): A promise that resolves to token usage statistics
|
|
82
128
|
|
|
83
|
-
**object
|
|
129
|
+
**object** (`Promise<OUTPUT | undefined>`): A promise that resolves to the structured output object. Only available when structuredOutput option is provided. Resolves to undefined if no schema was specified.
|
|
84
130
|
|
|
85
|
-
**objectStream
|
|
131
|
+
**objectStream** (`ReadableStream<Partial<OUTPUT>>`): A stream of partial objects during structured output generation. Useful for streaming partial results as they're being generated.
|
|
86
132
|
|
|
87
133
|
## Structured Output
|
|
88
134
|
|
|
@@ -43,19 +43,19 @@ export const mastra = new Mastra({
|
|
|
43
43
|
|
|
44
44
|
## Parameters
|
|
45
45
|
|
|
46
|
-
**path
|
|
46
|
+
**path** (`string`): The route path (e.g., \`/chat\` or \`/chat/:agentId\`). Include \`:agentId\` for dynamic agent routing. (Default: `'/chat/:agentId'`)
|
|
47
47
|
|
|
48
|
-
**agent
|
|
48
|
+
**agent** (`string`): The ID of the agent to use for this chat route. Required if the path doesn't include \`:agentId\`.
|
|
49
49
|
|
|
50
|
-
**defaultOptions
|
|
50
|
+
**defaultOptions** (`AgentExecutionOptions`): Default options passed to agent execution. These can include instructions, memory configuration, maxSteps, and other execution settings.
|
|
51
51
|
|
|
52
|
-
**sendStart
|
|
52
|
+
**sendStart** (`boolean`): Whether to send start events in the stream. (Default: `true`)
|
|
53
53
|
|
|
54
|
-
**sendFinish
|
|
54
|
+
**sendFinish** (`boolean`): Whether to send finish events in the stream. (Default: `true`)
|
|
55
55
|
|
|
56
|
-
**sendReasoning
|
|
56
|
+
**sendReasoning** (`boolean`): Whether to include reasoning steps in the stream. (Default: `false`)
|
|
57
57
|
|
|
58
|
-
**sendSources
|
|
58
|
+
**sendSources** (`boolean`): Whether to include source citations in the stream. (Default: `false`)
|
|
59
59
|
|
|
60
60
|
## Additional configuration
|
|
61
61
|
|
|
@@ -28,26 +28,26 @@ export async function POST(req: Request) {
|
|
|
28
28
|
|
|
29
29
|
## Parameters
|
|
30
30
|
|
|
31
|
-
**mastra
|
|
31
|
+
**mastra** (`Mastra`): The Mastra instance containing registered agents.
|
|
32
32
|
|
|
33
|
-
**agentId
|
|
33
|
+
**agentId** (`string`): The ID of the agent to use for chat.
|
|
34
34
|
|
|
35
|
-
**params
|
|
35
|
+
**params** (`ChatStreamHandlerParams`): Parameters for the chat stream, including messages and optional resume data.
|
|
36
36
|
|
|
37
|
-
**params.messages
|
|
37
|
+
**params.messages** (`UIMessage[]`): Array of messages in the conversation.
|
|
38
38
|
|
|
39
|
-
**params.resumeData
|
|
39
|
+
**params.resumeData** (`Record<string, any>`): Data for resuming a suspended agent execution. Requires \`runId\` to be set.
|
|
40
40
|
|
|
41
|
-
**params.runId
|
|
41
|
+
**params.runId** (`string`): The run ID. Required when \`resumeData\` is provided.
|
|
42
42
|
|
|
43
|
-
**params.requestContext
|
|
43
|
+
**params.requestContext** (`RequestContext`): Request context to pass to the agent execution.
|
|
44
44
|
|
|
45
|
-
**defaultOptions
|
|
45
|
+
**defaultOptions** (`AgentExecutionOptions`): Default options passed to agent execution. These are merged with params, with params taking precedence.
|
|
46
46
|
|
|
47
|
-
**sendStart
|
|
47
|
+
**sendStart** (`boolean`): Whether to send start events in the stream. (Default: `true`)
|
|
48
48
|
|
|
49
|
-
**sendFinish
|
|
49
|
+
**sendFinish** (`boolean`): Whether to send finish events in the stream. (Default: `true`)
|
|
50
50
|
|
|
51
|
-
**sendReasoning
|
|
51
|
+
**sendReasoning** (`boolean`): Whether to include reasoning steps in the stream. (Default: `false`)
|
|
52
52
|
|
|
53
|
-
**sendSources
|
|
53
|
+
**sendSources** (`boolean`): Whether to include source citations in the stream. (Default: `false`)
|
|
@@ -28,10 +28,10 @@ export async function POST(req: Request) {
|
|
|
28
28
|
|
|
29
29
|
## Parameters
|
|
30
30
|
|
|
31
|
-
**mastra
|
|
31
|
+
**mastra** (`Mastra`): The Mastra instance to use for agent lookup and execution.
|
|
32
32
|
|
|
33
|
-
**agentId
|
|
33
|
+
**agentId** (`string`): The ID of the routing agent to execute as a network.
|
|
34
34
|
|
|
35
|
-
**params
|
|
35
|
+
**params** (`NetworkStreamHandlerParams`): The request parameters containing messages and execution options. Includes \`messages\` (required) and any AgentExecutionOptions like \`memory\`, \`maxSteps\`, \`runId\`, etc.
|
|
36
36
|
|
|
37
|
-
**defaultOptions
|
|
37
|
+
**defaultOptions** (`AgentExecutionOptions`): Default options passed to agent execution. These are merged with params, with params taking precedence.
|
|
@@ -32,24 +32,24 @@ export async function POST(req: Request) {
|
|
|
32
32
|
|
|
33
33
|
## Parameters
|
|
34
34
|
|
|
35
|
-
**mastra
|
|
35
|
+
**mastra** (`Mastra`): The Mastra instance containing registered workflows.
|
|
36
36
|
|
|
37
|
-
**workflowId
|
|
37
|
+
**workflowId** (`string`): The ID of the workflow to execute.
|
|
38
38
|
|
|
39
|
-
**params
|
|
39
|
+
**params** (`WorkflowStreamHandlerParams`): Parameters for the workflow stream.
|
|
40
40
|
|
|
41
|
-
**params.runId
|
|
41
|
+
**params.runId** (`string`): Optional run ID for the workflow execution.
|
|
42
42
|
|
|
43
|
-
**params.resourceId
|
|
43
|
+
**params.resourceId** (`string`): Optional resource ID for the workflow run.
|
|
44
44
|
|
|
45
|
-
**params.inputData
|
|
45
|
+
**params.inputData** (`Record<string, any>`): Input data for starting a new workflow execution.
|
|
46
46
|
|
|
47
|
-
**params.resumeData
|
|
47
|
+
**params.resumeData** (`Record<string, any>`): Data for resuming a suspended workflow execution.
|
|
48
48
|
|
|
49
|
-
**params.requestContext
|
|
49
|
+
**params.requestContext** (`RequestContext`): Request context to pass to the workflow execution.
|
|
50
50
|
|
|
51
|
-
**params.tracingOptions
|
|
51
|
+
**params.tracingOptions** (`TracingOptions`): Options for tracing and observability.
|
|
52
52
|
|
|
53
|
-
**params.step
|
|
53
|
+
**params.step** (`string`): Specific step to target in the workflow.
|
|
54
54
|
|
|
55
|
-
**includeTextStreamParts
|
|
55
|
+
**includeTextStreamParts** (`boolean`): Whether to include text stream parts in the output. (Default: `true`)
|
|
@@ -43,11 +43,11 @@ export const mastra = new Mastra({
|
|
|
43
43
|
|
|
44
44
|
## Parameters
|
|
45
45
|
|
|
46
|
-
**path
|
|
46
|
+
**path** (`string`): The route path (e.g., \`/network\` or \`/network/:agentId\`). Include \`:agentId\` for dynamic agent routing. (Default: `'/network/:agentId'`)
|
|
47
47
|
|
|
48
|
-
**agent
|
|
48
|
+
**agent** (`string`): The ID of the routing agent to use for this network route. Required if the path doesn't include \`:agentId\`.
|
|
49
49
|
|
|
50
|
-
**defaultOptions
|
|
50
|
+
**defaultOptions** (`AgentExecutionOptions`): Default options passed to agent execution. These can include instructions, memory configuration, maxSteps, and other execution settings.
|
|
51
51
|
|
|
52
52
|
## Additional configuration
|
|
53
53
|
|