@mastra/mcp-docs-server 0.13.11-alpha.1 → 0.13.11-alpha.3
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/%40mastra%2Fclient-js.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Flance.md +15 -12
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +22 -22
- package/.docs/organized/changelogs/create-mastra.md +11 -11
- package/.docs/organized/changelogs/mastra.md +24 -24
- package/.docs/organized/code-examples/a2a.md +52 -19
- package/.docs/organized/code-examples/weather-agent.md +14 -0
- package/.docs/raw/auth/jwt.mdx +3 -1
- package/.docs/raw/evals/overview.mdx +8 -0
- package/.docs/raw/getting-started/installation.mdx +45 -7
- package/.docs/raw/getting-started/mcp-docs-server.mdx +3 -3
- package/.docs/raw/memory/overview.mdx +11 -5
- package/.docs/raw/reference/agents/agent.mdx +6 -2
- package/.docs/raw/reference/agents/generate.mdx +48 -40
- package/.docs/raw/reference/agents/getAgent.mdx +10 -5
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +22 -17
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +22 -17
- package/.docs/raw/reference/agents/getDefaultVNextStreamOptions.mdx +22 -17
- package/.docs/raw/reference/agents/getDescription.mdx +9 -5
- package/.docs/raw/reference/agents/getInstructions.mdx +22 -17
- package/.docs/raw/reference/agents/getLLM.mdx +23 -18
- package/.docs/raw/reference/agents/getMemory.mdx +22 -17
- package/.docs/raw/reference/agents/getModel.mdx +22 -17
- package/.docs/raw/reference/agents/getScorers.mdx +22 -17
- package/.docs/raw/reference/agents/getTools.mdx +22 -17
- package/.docs/raw/reference/agents/getVoice.mdx +22 -17
- package/.docs/raw/reference/agents/getWorkflows.mdx +22 -17
- package/.docs/raw/reference/agents/stream.mdx +24 -19
- package/.docs/raw/reference/agents/streamVNext.mdx +18 -19
- package/.docs/raw/reference/storage/upstash.mdx +5 -0
- package/.docs/raw/reference/tools/create-tool.mdx +22 -29
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +2 -2
- package/.docs/raw/reference/tools/vector-query-tool.mdx +3 -3
- package/.docs/raw/reference/workflows/branch.mdx +6 -6
- package/.docs/raw/reference/workflows/commit.mdx +5 -5
- package/.docs/raw/reference/workflows/create-run.mdx +28 -29
- package/.docs/raw/reference/workflows/dountil.mdx +5 -5
- package/.docs/raw/reference/workflows/dowhile.mdx +5 -5
- package/.docs/raw/reference/workflows/execute.mdx +83 -91
- package/.docs/raw/reference/workflows/foreach.mdx +5 -5
- package/.docs/raw/reference/workflows/map.mdx +8 -93
- package/.docs/raw/reference/workflows/parallel.mdx +5 -5
- package/.docs/raw/reference/workflows/resume.mdx +45 -47
- package/.docs/raw/reference/workflows/sendEvent.mdx +5 -5
- package/.docs/raw/reference/workflows/sleep.mdx +5 -5
- package/.docs/raw/reference/workflows/sleepUntil.mdx +16 -8
- package/.docs/raw/reference/workflows/start.mdx +42 -27
- package/.docs/raw/reference/workflows/step.mdx +15 -29
- package/.docs/raw/reference/workflows/stream.mdx +55 -205
- package/.docs/raw/reference/workflows/streamVNext.mdx +55 -174
- package/.docs/raw/reference/workflows/then.mdx +5 -5
- package/.docs/raw/reference/workflows/waitForEvent.mdx +5 -5
- package/.docs/raw/reference/workflows/watch.mdx +31 -13
- package/.docs/raw/reference/workflows/workflow.mdx +27 -100
- package/.docs/raw/scorers/overview.mdx +8 -0
- package/.docs/raw/server-db/local-dev-playground.mdx +16 -1
- package/dist/tools/__tests__/test-setup.d.ts +1 -1
- package/dist/tools/__tests__/test-setup.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getDefaultGenerateOptions() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getDefaultGenerateOptions() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getDefaultGenerateOptions()` method in Mastra agents, which retrieves the default options used for generate calls."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getDefaultGenerateOptions()
|
|
6
|
+
# Agent.getDefaultGenerateOptions()
|
|
7
7
|
|
|
8
8
|
The `.getDefaultGenerateOptions()` method retrieves the default generation options configured for an agent, resolving them if they're a function. These options are used as the base configuration for all `generate()` calls unless overridden.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getDefaultGenerateOptions();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const defaultOptions = await agent.getDefaultGenerateOptions();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "defaultOptions",
|
|
36
|
+
type: "AgentGenerateOptions | Promise<AgentGenerateOptions>",
|
|
37
|
+
description: "The default generation options configured for the agent, either as a direct object or a promise that resolves to the options.",
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getDefaultGenerateOptions({
|
|
34
46
|
runtimeContext: new RuntimeContext()
|
|
35
47
|
});
|
|
36
48
|
```
|
|
@@ -49,14 +61,7 @@ const defaultOptions = await agent.getDefaultGenerateOptions({
|
|
|
49
61
|
]}
|
|
50
62
|
/>
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Related
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
name: "defaultOptions",
|
|
58
|
-
type: "AgentGenerateOptions | Promise<AgentGenerateOptions>",
|
|
59
|
-
description: "The default generation options configured for the agent, either as a direct object or a promise that resolves to the options.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
66
|
+
- [Agent generation](../../docs/agents/overview.mdx#generate)
|
|
67
|
+
- [Runtime variables](../../docs/agents/runtime-variables.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getDefaultStreamOptions() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getDefaultStreamOptions() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getDefaultStreamOptions()` method in Mastra agents, which retrieves the default options used for stream calls."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getDefaultStreamOptions()
|
|
6
|
+
# Agent.getDefaultStreamOptions()
|
|
7
7
|
|
|
8
8
|
The `.getDefaultStreamOptions()` method retrieves the default streaming options configured for an agent, resolving them if they're a function. These options are used as the base configuration for all `stream()` calls unless overridden.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getDefaultStreamOptions();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const defaultOptions = await agent.getDefaultStreamOptions();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "defaultOptions",
|
|
36
|
+
type: "AgentStreamOptions | Promise<AgentStreamOptions>",
|
|
37
|
+
description: "The default streaming options configured for the agent, either as a direct object or a promise that resolves to the options.",
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getDefaultStreamOptions({
|
|
34
46
|
runtimeContext: new RuntimeContext()
|
|
35
47
|
});
|
|
36
48
|
```
|
|
@@ -49,14 +61,7 @@ const defaultOptions = await agent.getDefaultStreamOptions({
|
|
|
49
61
|
]}
|
|
50
62
|
/>
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Related
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
name: "defaultOptions",
|
|
58
|
-
type: "AgentStreamOptions | Promise<AgentStreamOptions>",
|
|
59
|
-
description: "The default streaming options configured for the agent, either as a direct object or a promise that resolves to the options.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
66
|
+
- [Agent streaming](../../docs/agents/streaming.mdx)
|
|
67
|
+
- [Runtime variables](../../docs/agents/runtime-variables.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getDefaultVNextStreamOptions() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
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
4
|
---
|
|
5
5
|
|
|
6
|
-
# getDefaultVNextStreamOptions()
|
|
6
|
+
# Agent.getDefaultVNextStreamOptions()
|
|
7
7
|
|
|
8
8
|
The `.getDefaultVNextStreamOptions()` method retrieves the default vNext streaming options configured for an agent, resolving them if they're a function. These options are used as the base configuration for all `streamVNext()` calls unless overridden.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getDefaultVNextStreamOptions();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const defaultOptions = await agent.getDefaultVNextStreamOptions();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "defaultOptions",
|
|
36
|
+
type: "AgentVNextStreamOptions<Output, StructuredOutput> | Promise<AgentVNextStreamOptions<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
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getDefaultVNextStreamOptions({
|
|
34
46
|
runtimeContext: new RuntimeContext()
|
|
35
47
|
});
|
|
36
48
|
```
|
|
@@ -49,14 +61,7 @@ const defaultOptions = await agent.getDefaultVNextStreamOptions({
|
|
|
49
61
|
]}
|
|
50
62
|
/>
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Related
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
name: "defaultOptions",
|
|
58
|
-
type: "AgentVNextStreamOptions<Output, StructuredOutput> | Promise<AgentVNextStreamOptions<Output, StructuredOutput>>",
|
|
59
|
-
description: "The default vNext streaming options configured for the agent, either as a direct object or a promise that resolves to the options.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
66
|
+
- [Agent streaming](../../docs/agents/streaming.mdx)
|
|
67
|
+
- [Runtime variables](../../docs/agents/runtime-variables.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getDescription() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getDescription() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getDescription()` method in Mastra agents, which retrieves the agent's description."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getDescription()
|
|
6
|
+
# Agent.getDescription()
|
|
7
7
|
|
|
8
8
|
The `.getDescription()` method retrieves the description configured for an agent. This method returns a simple string description that describes the agent's purpose and capabilities.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
agent.getDescription();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -28,3 +28,7 @@ This method takes no parameters.
|
|
|
28
28
|
},
|
|
29
29
|
]}
|
|
30
30
|
/>
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- [Agents overview](../../docs/agents/overview.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getInstructions() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getInstructions() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getInstructions()` method in Mastra agents, which retrieves the instructions that guide the agent's behavior."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getInstructions()
|
|
6
|
+
# Agent.getInstructions()
|
|
7
7
|
|
|
8
8
|
The `.getInstructions()` method retrieves the instructions configured for an agent, resolving them if they're a function. These instructions guide the agent's behavior and define its capabilities and constraints.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getInstructions();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const instructions = await agent.getInstructions();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "instructions",
|
|
36
|
+
type: "string | Promise<string>",
|
|
37
|
+
description: "The instructions configured for the agent, either as a direct string or a promise that resolves to the instructions.",
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getInstructions({
|
|
34
46
|
runtimeContext: new RuntimeContext()
|
|
35
47
|
});
|
|
36
48
|
```
|
|
@@ -49,14 +61,7 @@ const instructions = await agent.getInstructions({
|
|
|
49
61
|
]}
|
|
50
62
|
/>
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Related
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
name: "instructions",
|
|
58
|
-
type: "string | Promise<string>",
|
|
59
|
-
description: "The instructions configured for the agent, either as a direct string or a promise that resolves to the instructions.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
66
|
+
- [Agents overview](../../docs/agents/overview.mdx)
|
|
67
|
+
- [Runtime variables](../../docs/agents/runtime-variables.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getLLM() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getLLM() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getLLM()` method in Mastra agents, which retrieves the language model instance."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getLLM()
|
|
6
|
+
# Agent.getLLM()
|
|
7
7
|
|
|
8
8
|
The `.getLLM()` method retrieves the language model instance configured for an agent, resolving it if it's a function. This method provides access to the underlying LLM that powers the agent's capabilities.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getLLM();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const llm = await agent.getLLM();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "llm",
|
|
36
|
+
type: "MastraLLMBase | Promise<MastraLLMBase>",
|
|
37
|
+
description: "The language model instance configured for the agent, either as a direct instance or a promise that resolves to the LLM.",
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getLLM({
|
|
34
46
|
runtimeContext: new RuntimeContext(),
|
|
35
47
|
model: openai('gpt-4')
|
|
36
48
|
});
|
|
@@ -51,19 +63,12 @@ const llm = await agent.getLLM({
|
|
|
51
63
|
name: "model",
|
|
52
64
|
type: "MastraLanguageModel | DynamicArgument<MastraLanguageModel>",
|
|
53
65
|
isOptional: true,
|
|
54
|
-
description: "Optional model override. If provided, this model will be used instead of the agent's configured model.",
|
|
66
|
+
description: "Optional model override. If provided, this model will be used used instead of the agent's configured model.",
|
|
55
67
|
},
|
|
56
68
|
]}
|
|
57
69
|
/>
|
|
58
70
|
|
|
59
|
-
##
|
|
71
|
+
## Related
|
|
60
72
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
name: "llm",
|
|
65
|
-
type: "MastraLLMBase | Promise<MastraLLMBase>",
|
|
66
|
-
description: "The language model instance configured for the agent, either as a direct instance or a promise that resolves to the LLM.",
|
|
67
|
-
},
|
|
68
|
-
]}
|
|
69
|
-
/>
|
|
73
|
+
- [Agents overview](../../docs/agents/overview.mdx)
|
|
74
|
+
- [Runtime variables](../../docs/agents/runtime-variables.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getMemory() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getMemory() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getMemory()` method in Mastra agents, which retrieves the memory system associated with the agent."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getMemory()
|
|
6
|
+
# Agent.getMemory()
|
|
7
7
|
|
|
8
8
|
The `.getMemory()` method retrieves the memory system associated with an agent. This method is used to access the agent's memory capabilities for storing and retrieving information across conversations.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getMemory();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const memory = await agent.getMemory();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "memory",
|
|
36
|
+
type: "Promise<MastraMemory | undefined>",
|
|
37
|
+
description: "A promise that resolves to the memory system configured for the agent, or undefined if no memory system is configured.",
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getMemory({
|
|
34
46
|
runtimeContext: new RuntimeContext()
|
|
35
47
|
});
|
|
36
48
|
```
|
|
@@ -49,14 +61,7 @@ const memory = await agent.getMemory({
|
|
|
49
61
|
]}
|
|
50
62
|
/>
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Related
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
name: "memory",
|
|
58
|
-
type: "Promise<MastraMemory | undefined>",
|
|
59
|
-
description: "A promise that resolves to the memory system configured for the agent, or undefined if no memory system is configured.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
66
|
+
- [Agent memory](../../docs/agents/agent-memory.mdx)
|
|
67
|
+
- [Runtime variables](../../docs/agents/runtime-variables.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getModel() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getModel() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getModel()` method in Mastra agents, which retrieves the language model that powers the agent."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getModel()
|
|
6
|
+
# Agent.getModel()
|
|
7
7
|
|
|
8
8
|
The `.getModel()` method retrieves the language model configured for an agent, resolving it if it's a function. This method is used to access the underlying model that powers the agent's capabilities.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getModel();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const model = await agent.getModel();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "model",
|
|
36
|
+
type: "MastraLanguageModel | Promise<MastraLanguageModel>",
|
|
37
|
+
description: "The language model configured for the agent, either as a direct instance or a promise that resolves to the model.",
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getModel({
|
|
34
46
|
runtimeContext: new RuntimeContext()
|
|
35
47
|
});
|
|
36
48
|
```
|
|
@@ -49,14 +61,7 @@ const model = await agent.getModel({
|
|
|
49
61
|
]}
|
|
50
62
|
/>
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Related
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
name: "model",
|
|
58
|
-
type: "MastraLanguageModel | Promise<MastraLanguageModel>",
|
|
59
|
-
description: "The language model configured for the agent, either as a direct instance or a promise that resolves to the model.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
66
|
+
- [Agents overview](../../docs/agents/overview.mdx)
|
|
67
|
+
- [Runtime variables](../../docs/agents/runtime-variables.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getScorers() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getScorers() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getScorers()` method in Mastra agents, which retrieves the scoring configuration."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getScorers()
|
|
6
|
+
# Agent.getScorers()
|
|
7
7
|
|
|
8
8
|
The `.getScorers()` method retrieves the scoring configuration configured for an agent, resolving it if it's a function. This method provides access to the scoring system used for evaluating agent responses and performance.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getScorers();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const scorers = await agent.getScorers();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "scorers",
|
|
36
|
+
type: "MastraScorers | Promise<MastraScorers>",
|
|
37
|
+
description: "The scoring configuration configured for the agent, either as a direct object or a promise that resolves to the scorers.",
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getScorers({
|
|
34
46
|
runtimeContext: new RuntimeContext()
|
|
35
47
|
});
|
|
36
48
|
```
|
|
@@ -49,14 +61,7 @@ const scorers = await agent.getScorers({
|
|
|
49
61
|
]}
|
|
50
62
|
/>
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Related
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
name: "scorers",
|
|
58
|
-
type: "MastraScorers | Promise<MastraScorers>",
|
|
59
|
-
description: "The scoring configuration configured for the agent, either as a direct object or a promise that resolves to the scorers.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
66
|
+
- [Agents overview](../../docs/agents/overview.mdx)
|
|
67
|
+
- [Runtime variables](../../docs/agents/runtime-variables.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getTools() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getTools() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getTools()` method in Mastra agents, which retrieves the tools that the agent can use."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getTools()
|
|
6
|
+
# Agent.getTools()
|
|
7
7
|
|
|
8
8
|
The `.getTools()` method retrieves the tools configured for an agent, resolving them if they're a function. These tools extend the agent's capabilities, allowing it to perform specific actions or access external systems.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getTools();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const tools = await agent.getTools();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "tools",
|
|
36
|
+
type: "TTools | Promise<TTools>",
|
|
37
|
+
description: "The tools configured for the agent, either as a direct object or a promise that resolves to the tools.",
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getTools({
|
|
34
46
|
runtimeContext: new RuntimeContext()
|
|
35
47
|
});
|
|
36
48
|
```
|
|
@@ -49,14 +61,7 @@ const tools = await agent.getTools({
|
|
|
49
61
|
]}
|
|
50
62
|
/>
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Related
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
name: "tools",
|
|
58
|
-
type: "TTools | Promise<TTools>",
|
|
59
|
-
description: "The tools configured for the agent, either as a direct object or a promise that resolves to the tools.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
66
|
+
- [Using tools with agents](../../docs/agents/using-tools-and-mcp.mdx)
|
|
67
|
+
- [Creating tools](../../docs/tools-mcp/overview.mdx)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference: getVoice() | Agents | Mastra Docs"
|
|
3
|
-
description: "Documentation for the
|
|
2
|
+
title: "Reference: Agent.getVoice() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.getVoice()` method in Mastra agents, which retrieves the voice provider for speech capabilities."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# getVoice()
|
|
6
|
+
# Agent.getVoice()
|
|
7
7
|
|
|
8
8
|
The `.getVoice()` method retrieves the voice provider configured for an agent, resolving it if it's a function. This method is used to access the agent's speech capabilities for text-to-speech and speech-to-text functionality.
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.getVoice();
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
@@ -27,10 +27,22 @@ const voice = await agent.getVoice();
|
|
|
27
27
|
]}
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "voice",
|
|
36
|
+
type: "Promise<MastraVoice>",
|
|
37
|
+
description: "A promise that resolves to the voice provider configured for the agent, or a default voice provider if none was configured.",
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
|
|
30
42
|
## Extended usage example
|
|
31
43
|
|
|
32
|
-
```typescript
|
|
33
|
-
|
|
44
|
+
```typescript copy
|
|
45
|
+
await agent.getVoice({
|
|
34
46
|
runtimeContext: new RuntimeContext()
|
|
35
47
|
});
|
|
36
48
|
```
|
|
@@ -49,14 +61,7 @@ const voice = await agent.getVoice({
|
|
|
49
61
|
]}
|
|
50
62
|
/>
|
|
51
63
|
|
|
52
|
-
##
|
|
64
|
+
## Related
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
name: "voice",
|
|
58
|
-
type: "Promise<MastraVoice>",
|
|
59
|
-
description: "A promise that resolves to the voice provider configured for the agent, or a default voice provider if none was configured.",
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
/>
|
|
66
|
+
- [Adding voice to agents](../../docs/agents/adding-voice.mdx)
|
|
67
|
+
- [Voice providers](../voice/mastra-voice.mdx)
|