@mastra/mcp-docs-server 1.2.14-alpha.1 → 1.2.14-alpha.4
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/a2a.md +1 -1
- package/.docs/docs/agents/acp.md +1 -1
- package/.docs/docs/agents/agent-approval.md +1 -1
- package/.docs/docs/agents/networks.md +2 -2
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/processors.md +25 -1
- package/.docs/docs/agents/using-tools.md +2 -2
- package/.docs/docs/capabilities/channels/overview.md +1 -1
- package/.docs/docs/{agents/supervisor-agents.md → capabilities/subagents.md} +58 -58
- package/.docs/docs/deployment/sandbox.md +95 -1
- package/.docs/docs/getting-started/develop.md +2 -0
- package/.docs/docs/harness/agent-controller.md +370 -0
- package/.docs/docs/long-running-agents/background-tasks.md +1 -1
- package/.docs/docs/long-running-agents/goals.md +3 -3
- package/.docs/docs/mcp/overview.md +222 -281
- package/.docs/docs/memory/overview.md +2 -2
- package/.docs/docs/observability/integrations/exporters/confident-ai.md +140 -0
- package/.docs/docs/observability/integrations/overview.md +1 -1
- package/.docs/docs/observability/overview.md +122 -8
- package/.docs/docs/observability/tracing/overview.md +2 -2
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/server-adapters.md +2 -0
- package/.docs/docs/storage/overview.md +2 -2
- package/.docs/docs/workflows/agents-and-tools.md +29 -0
- package/.docs/docs/workflows/stored-workflows.md +146 -0
- package/.docs/guides/build-your-ui/copilotkit/channels.md +49 -39
- package/.docs/guides/concepts/multi-agent-systems.md +7 -7
- package/.docs/guides/guide/coding-agent.md +2 -2
- package/.docs/guides/guide/research-coordinator.md +1 -1
- package/.docs/guides/migrations/network-to-supervisor.md +1 -1
- package/.docs/models/environment-variables.md +1 -1
- package/.docs/models/gateways/neon.md +71 -0
- package/.docs/models/gateways/netlify.md +6 -6
- package/.docs/models/gateways/openrouter.md +6 -6
- package/.docs/models/gateways/vercel.md +6 -6
- package/.docs/models/gateways.md +1 -0
- package/.docs/models/index.md +96 -97
- package/.docs/models/providers/alibaba-cn.md +23 -25
- package/.docs/models/providers/alibaba-token-plan-cn.md +24 -24
- package/.docs/models/providers/alibaba-token-plan.md +23 -25
- package/.docs/models/providers/alibaba.md +23 -25
- package/.docs/models/providers/ambient.md +23 -25
- package/.docs/models/providers/baseten.md +23 -25
- package/.docs/models/providers/chutes.md +23 -25
- package/.docs/models/providers/cortecs.md +23 -25
- package/.docs/models/providers/crof.md +23 -25
- package/.docs/models/providers/crossmodel.md +23 -25
- package/.docs/models/providers/deepinfra.md +22 -24
- package/.docs/models/providers/digitalocean.md +32 -34
- package/.docs/models/providers/empiriolabs.md +23 -25
- package/.docs/models/providers/fireworks-ai.md +24 -24
- package/.docs/models/providers/greenpt.md +23 -25
- package/.docs/models/providers/groq.md +23 -25
- package/.docs/models/providers/huggingface.md +23 -25
- package/.docs/models/providers/hyper.md +23 -25
- package/.docs/models/providers/impossibl.md +23 -25
- package/.docs/models/providers/infomaniak.md +24 -24
- package/.docs/models/providers/kilo.md +24 -26
- package/.docs/models/providers/llmgateway.md +24 -26
- package/.docs/models/providers/mistral.md +23 -25
- package/.docs/models/providers/modal.md +23 -25
- package/.docs/models/providers/modelis.md +23 -25
- package/.docs/models/providers/nano-gpt.md +23 -25
- package/.docs/models/providers/neuralwatt.md +23 -25
- package/.docs/models/providers/ofox.md +23 -25
- package/.docs/models/providers/ollama-cloud.md +23 -25
- package/.docs/models/providers/opencode-go.md +23 -25
- package/.docs/models/providers/opencode.md +25 -26
- package/.docs/models/providers/pioneer.md +23 -25
- package/.docs/models/providers/requesty.md +23 -25
- package/.docs/models/providers/routing-run.md +23 -25
- package/.docs/models/providers/scx.md +23 -25
- package/.docs/models/providers/tensorx.md +23 -25
- package/.docs/models/providers/togetherai.md +22 -24
- package/.docs/models/providers/umans-ai-coding-plan.md +24 -24
- package/.docs/models/providers/umans-ai.md +23 -25
- package/.docs/models/providers/wandb.md +23 -25
- package/.docs/models/providers/xai.md +26 -28
- package/.docs/models/providers/zai-coding-plan.md +23 -25
- package/.docs/models/providers/zhipuai-coding-plan.md +23 -25
- package/.docs/models/providers.md +0 -1
- package/.docs/reference/acp/acp-agent.md +1 -1
- package/.docs/reference/agent-controller/agent-controller-class.md +195 -506
- package/.docs/reference/agent-controller/session.md +274 -111
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/ai-sdk/handle-network-stream.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +1 -1
- package/.docs/reference/cli/create-mastra.md +1 -1
- package/.docs/reference/client-js/workflows.md +92 -0
- package/.docs/reference/core/addStoredWorkflow.md +62 -0
- package/.docs/reference/core/addStoredWorkflows.md +40 -0
- package/.docs/reference/editor/versioning.md +1 -1
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/file-based-agents/observability.md +2 -2
- package/.docs/reference/file-based-agents/storage.md +1 -1
- package/.docs/reference/file-based-agents/subagents.md +1 -1
- package/.docs/reference/file-based-agents/tools.md +1 -1
- package/.docs/reference/index.md +5 -0
- package/.docs/reference/observability/tracing/configuration.md +1 -1
- package/.docs/reference/observability/tracing/exporters/confident-ai.md +138 -0
- package/.docs/reference/observability/tracing/interfaces.md +29 -0
- package/.docs/reference/processors/processor-interface.md +121 -10
- package/.docs/reference/server/routes.md +13 -0
- package/.docs/reference/signals/signal-provider.md +2 -0
- package/.docs/reference/storage/overview.md +9 -8
- package/.docs/reference/streaming/workflows/observeStream.md +1 -1
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/streaming/workflows/stream.md +1 -1
- package/.docs/reference/tools/mcp-server.md +1 -1
- package/.docs/reference/tools/submit-plan-tool.md +1 -1
- package/.docs/reference/workflows/stored-workflow-definition.md +292 -0
- package/.docs/reference/workflows/workflow-methods/agent.md +62 -0
- package/.docs/reference/workflows/workflow-methods/tool.md +43 -0
- package/.docs/reference/workspace/railway-sandbox.md +5 -5
- package/CHANGELOG.md +14 -0
- package/package.json +4 -4
- package/.docs/docs/agent-controller/channels.md +0 -111
- package/.docs/docs/agent-controller/modes.md +0 -147
- package/.docs/docs/agent-controller/overview.md +0 -136
- package/.docs/docs/agent-controller/session.md +0 -161
- package/.docs/docs/agent-controller/subagents.md +0 -110
- package/.docs/docs/agent-controller/threads-and-state.md +0 -148
- package/.docs/docs/agent-controller/tool-approvals.md +0 -147
- package/.docs/docs/mcp/mcp-apps.md +0 -306
- package/.docs/docs/observability/config.md +0 -140
- package/.docs/docs/observability/storage.md +0 -81
- package/.docs/models/providers/neon.md +0 -109
|
@@ -11,22 +11,22 @@ DIGITALOCEAN_ACCESS_TOKEN=your-api-token
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Agent } from
|
|
14
|
+
import { Agent } from '@mastra/core/agent'
|
|
15
15
|
|
|
16
16
|
const agent = new Agent({
|
|
17
|
-
id:
|
|
18
|
-
name:
|
|
19
|
-
instructions:
|
|
20
|
-
model:
|
|
21
|
-
})
|
|
17
|
+
id: 'my-agent',
|
|
18
|
+
name: 'My Agent',
|
|
19
|
+
instructions: 'You are a helpful assistant',
|
|
20
|
+
model: 'digitalocean/alibaba-qwen3-32b',
|
|
21
|
+
})
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
24
|
-
const response = await agent.generate(
|
|
24
|
+
const response = await agent.generate('Hello!')
|
|
25
25
|
|
|
26
26
|
// Stream a response
|
|
27
|
-
const stream = await agent.stream(
|
|
27
|
+
const stream = await agent.stream('Tell me a story')
|
|
28
28
|
for await (const chunk of stream) {
|
|
29
|
-
console.log(chunk)
|
|
29
|
+
console.log(chunk)
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -55,11 +55,11 @@ for await (const chunk of stream) {
|
|
|
55
55
|
| `digitalocean/arcee-trinity-large-thinking` | 128K | | | | | | $0.25 | $0.90 |
|
|
56
56
|
| `digitalocean/bge-m3` | 8K | | | | | | $0.02 | — |
|
|
57
57
|
| `digitalocean/bge-reranker-v2-m3` | 8K | | | | | | $0.01 | — |
|
|
58
|
-
| `digitalocean/deepseek-3.2` | 164K | | | | | | $0.
|
|
59
|
-
| `digitalocean/deepseek-4-flash` | 1.0M | | | | | | $0.
|
|
58
|
+
| `digitalocean/deepseek-3.2` | 164K | | | | | | $0.25 | $0.80 |
|
|
59
|
+
| `digitalocean/deepseek-4-flash` | 1.0M | | | | | | $0.08 | $0.17 |
|
|
60
60
|
| `digitalocean/deepseek-r1-distill-llama-70b` | 33K | | | | | | $0.99 | $0.99 |
|
|
61
61
|
| `digitalocean/deepseek-v3` | 164K | | | | | | — | — |
|
|
62
|
-
| `digitalocean/deepseek-v4-pro` | 262K | | | | | | $
|
|
62
|
+
| `digitalocean/deepseek-v4-pro` | 262K | | | | | | $0.87 | $2 |
|
|
63
63
|
| `digitalocean/e5-large-v2` | 512 | | | | | | $0.02 | — |
|
|
64
64
|
| `digitalocean/fal-ai/elevenlabs/tts/multilingual-v2` | — | | | | | | — | — |
|
|
65
65
|
| `digitalocean/fal-ai/fast-sdxl` | — | | | | | | — | — |
|
|
@@ -68,15 +68,15 @@ for await (const chunk of stream) {
|
|
|
68
68
|
| `digitalocean/gemma-4-31B-it` | 256K | | | | | | $0.18 | $0.50 |
|
|
69
69
|
| `digitalocean/glm-5` | 64K | | | | | | $0.75 | $2 |
|
|
70
70
|
| `digitalocean/glm-5.1` | 164K | | | | | | $0.97 | $4 |
|
|
71
|
-
| `digitalocean/glm-5.2` | 262K | | | | | | $
|
|
71
|
+
| `digitalocean/glm-5.2` | 262K | | | | | | $0.70 | $2 |
|
|
72
72
|
| `digitalocean/gte-large-en-v1.5` | 8K | | | | | | $0.09 | — |
|
|
73
73
|
| `digitalocean/kimi-k2.5` | 262K | | | | | | $0.38 | $2 |
|
|
74
74
|
| `digitalocean/kimi-k2.6` | 262K | | | | | | $0.76 | $3 |
|
|
75
75
|
| `digitalocean/kimi-k3` | 1.0M | | | | | | $3 | $15 |
|
|
76
|
-
| `digitalocean/llama-4-maverick` | 128K | | | | | | $0.
|
|
76
|
+
| `digitalocean/llama-4-maverick` | 128K | | | | | | $0.20 | $0.70 |
|
|
77
77
|
| `digitalocean/llama3-8b-instruct` | 131K | | | | | | $0.20 | $0.20 |
|
|
78
78
|
| `digitalocean/llama3.3-70b-instruct` | 128K | | | | | | $0.65 | $0.65 |
|
|
79
|
-
| `digitalocean/mimo-v2.5-pro` | 262K | | | | | | $0.
|
|
79
|
+
| `digitalocean/mimo-v2.5-pro` | 262K | | | | | | $0.80 | $3 |
|
|
80
80
|
| `digitalocean/minimax-m2.5` | 66K | | | | | | $0.23 | $0.90 |
|
|
81
81
|
| `digitalocean/ministral-3-8b-instruct-2512` | 262K | | | | | | — | — |
|
|
82
82
|
| `digitalocean/mistral-3-14B` | 262K | | | | | | $0.20 | $0.20 |
|
|
@@ -86,7 +86,7 @@ for await (const chunk of stream) {
|
|
|
86
86
|
| `digitalocean/nemotron-3-nano-omni` | 66K | | | | | | $0.50 | $0.90 |
|
|
87
87
|
| `digitalocean/nemotron-3-ultra-550b` | 131K | | | | | | $0.90 | $2 |
|
|
88
88
|
| `digitalocean/nemotron-nano-12b-v2-vl` | 128K | | | | | | $0.20 | $0.60 |
|
|
89
|
-
| `digitalocean/nvidia-nemotron-3-super-120b` | 1.0M | | | | | | $0.
|
|
89
|
+
| `digitalocean/nvidia-nemotron-3-super-120b` | 1.0M | | | | | | $0.17 | $0.36 |
|
|
90
90
|
| `digitalocean/openai-gpt-4.1` | 1.0M | | | | | | $2 | $8 |
|
|
91
91
|
| `digitalocean/openai-gpt-4o` | 128K | | | | | | $3 | $10 |
|
|
92
92
|
| `digitalocean/openai-gpt-4o-mini` | 128K | | | | | | $0.15 | $0.60 |
|
|
@@ -108,7 +108,7 @@ for await (const chunk of stream) {
|
|
|
108
108
|
| `digitalocean/openai-gpt-image-1` | — | | | | | | $5 | $40 |
|
|
109
109
|
| `digitalocean/openai-gpt-image-1.5` | — | | | | | | $5 | $10 |
|
|
110
110
|
| `digitalocean/openai-gpt-image-2` | — | | | | | | $8 | $30 |
|
|
111
|
-
| `digitalocean/openai-gpt-oss-120b` | 128K | | | | | | $0.
|
|
111
|
+
| `digitalocean/openai-gpt-oss-120b` | 128K | | | | | | $0.06 | $0.39 |
|
|
112
112
|
| `digitalocean/openai-gpt-oss-20b` | 128K | | | | | | $0.05 | $0.45 |
|
|
113
113
|
| `digitalocean/openai-o1` | 200K | | | | | | $15 | $60 |
|
|
114
114
|
| `digitalocean/openai-o3` | 200K | | | | | | $2 | $8 |
|
|
@@ -117,7 +117,7 @@ for await (const chunk of stream) {
|
|
|
117
117
|
| `digitalocean/qwen3-coder-flash` | 262K | | | | | | $0.45 | $2 |
|
|
118
118
|
| `digitalocean/qwen3-embedding-0.6b` | 8K | | | | | | $0.04 | — |
|
|
119
119
|
| `digitalocean/qwen3-tts-voicedesign` | 33K | | | | | | — | — |
|
|
120
|
-
| `digitalocean/qwen3.5-397b-a17b` | 131K | | | | | | $0.
|
|
120
|
+
| `digitalocean/qwen3.5-397b-a17b` | 131K | | | | | | $0.30 | $2 |
|
|
121
121
|
| `digitalocean/stable-diffusion-3.5-large` | 256 | | | | | | $0.08 | — |
|
|
122
122
|
| `digitalocean/wan2-2-t2v-a14b` | 100 | | | | | | $0.60 | — |
|
|
123
123
|
|
|
@@ -127,30 +127,28 @@ for await (const chunk of stream) {
|
|
|
127
127
|
|
|
128
128
|
```typescript
|
|
129
129
|
const agent = new Agent({
|
|
130
|
-
id:
|
|
131
|
-
name:
|
|
130
|
+
id: 'custom-agent',
|
|
131
|
+
name: 'custom-agent',
|
|
132
132
|
model: {
|
|
133
|
-
url:
|
|
134
|
-
id:
|
|
133
|
+
url: 'https://inference.do-ai.run/v1',
|
|
134
|
+
id: 'digitalocean/alibaba-qwen3-32b',
|
|
135
135
|
apiKey: process.env.DIGITALOCEAN_ACCESS_TOKEN,
|
|
136
136
|
headers: {
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
})
|
|
137
|
+
'X-Custom-Header': 'value',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
})
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
### Dynamic model selection
|
|
144
144
|
|
|
145
145
|
```typescript
|
|
146
146
|
const agent = new Agent({
|
|
147
|
-
id:
|
|
148
|
-
name:
|
|
147
|
+
id: 'dynamic-agent',
|
|
148
|
+
name: 'Dynamic Agent',
|
|
149
149
|
model: ({ requestContext }) => {
|
|
150
|
-
const useAdvanced = requestContext.task ===
|
|
151
|
-
return useAdvanced
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
});
|
|
150
|
+
const useAdvanced = requestContext.task === 'complex'
|
|
151
|
+
return useAdvanced ? 'digitalocean/wan2-2-t2v-a14b' : 'digitalocean/alibaba-qwen3-32b'
|
|
152
|
+
},
|
|
153
|
+
})
|
|
156
154
|
```
|
|
@@ -11,22 +11,22 @@ EMPIRIOLABS_API_KEY=your-api-key
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Agent } from
|
|
14
|
+
import { Agent } from '@mastra/core/agent'
|
|
15
15
|
|
|
16
16
|
const agent = new Agent({
|
|
17
|
-
id:
|
|
18
|
-
name:
|
|
19
|
-
instructions:
|
|
20
|
-
model:
|
|
21
|
-
})
|
|
17
|
+
id: 'my-agent',
|
|
18
|
+
name: 'My Agent',
|
|
19
|
+
instructions: 'You are a helpful assistant',
|
|
20
|
+
model: 'empiriolabs/deepseek-v4-flash',
|
|
21
|
+
})
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
24
|
-
const response = await agent.generate(
|
|
24
|
+
const response = await agent.generate('Hello!')
|
|
25
25
|
|
|
26
26
|
// Stream a response
|
|
27
|
-
const stream = await agent.stream(
|
|
27
|
+
const stream = await agent.stream('Tell me a story')
|
|
28
28
|
for await (const chunk of stream) {
|
|
29
|
-
console.log(chunk)
|
|
29
|
+
console.log(chunk)
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -83,30 +83,28 @@ for await (const chunk of stream) {
|
|
|
83
83
|
|
|
84
84
|
```typescript
|
|
85
85
|
const agent = new Agent({
|
|
86
|
-
id:
|
|
87
|
-
name:
|
|
86
|
+
id: 'custom-agent',
|
|
87
|
+
name: 'custom-agent',
|
|
88
88
|
model: {
|
|
89
|
-
url:
|
|
90
|
-
id:
|
|
89
|
+
url: 'https://api.empiriolabs.ai/v1',
|
|
90
|
+
id: 'empiriolabs/deepseek-v4-flash',
|
|
91
91
|
apiKey: process.env.EMPIRIOLABS_API_KEY,
|
|
92
92
|
headers: {
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
})
|
|
93
|
+
'X-Custom-Header': 'value',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
})
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
### Dynamic model selection
|
|
100
100
|
|
|
101
101
|
```typescript
|
|
102
102
|
const agent = new Agent({
|
|
103
|
-
id:
|
|
104
|
-
name:
|
|
103
|
+
id: 'dynamic-agent',
|
|
104
|
+
name: 'Dynamic Agent',
|
|
105
105
|
model: ({ requestContext }) => {
|
|
106
|
-
const useAdvanced = requestContext.task ===
|
|
107
|
-
return useAdvanced
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
});
|
|
106
|
+
const useAdvanced = requestContext.task === 'complex'
|
|
107
|
+
return useAdvanced ? 'empiriolabs/step-3-7-flash' : 'empiriolabs/deepseek-v4-flash'
|
|
108
|
+
},
|
|
109
|
+
})
|
|
112
110
|
```
|
|
@@ -11,22 +11,22 @@ FIREWORKS_API_KEY=your-api-key
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Agent } from
|
|
14
|
+
import { Agent } from '@mastra/core/agent'
|
|
15
15
|
|
|
16
16
|
const agent = new Agent({
|
|
17
|
-
id:
|
|
18
|
-
name:
|
|
19
|
-
instructions:
|
|
20
|
-
model:
|
|
21
|
-
})
|
|
17
|
+
id: 'my-agent',
|
|
18
|
+
name: 'My Agent',
|
|
19
|
+
instructions: 'You are a helpful assistant',
|
|
20
|
+
model: 'fireworks-ai/accounts/fireworks/models/deepseek-v4-flash',
|
|
21
|
+
})
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
24
|
-
const response = await agent.generate(
|
|
24
|
+
const response = await agent.generate('Hello!')
|
|
25
25
|
|
|
26
26
|
// Stream a response
|
|
27
|
-
const stream = await agent.stream(
|
|
27
|
+
const stream = await agent.stream('Tell me a story')
|
|
28
28
|
for await (const chunk of stream) {
|
|
29
|
-
console.log(chunk)
|
|
29
|
+
console.log(chunk)
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -60,30 +60,30 @@ for await (const chunk of stream) {
|
|
|
60
60
|
|
|
61
61
|
```typescript
|
|
62
62
|
const agent = new Agent({
|
|
63
|
-
id:
|
|
64
|
-
name:
|
|
63
|
+
id: 'custom-agent',
|
|
64
|
+
name: 'custom-agent',
|
|
65
65
|
model: {
|
|
66
|
-
url:
|
|
67
|
-
id:
|
|
66
|
+
url: 'https://api.fireworks.ai/inference/v1/',
|
|
67
|
+
id: 'fireworks-ai/accounts/fireworks/models/deepseek-v4-flash',
|
|
68
68
|
apiKey: process.env.FIREWORKS_API_KEY,
|
|
69
69
|
headers: {
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
})
|
|
70
|
+
'X-Custom-Header': 'value',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
### Dynamic model selection
|
|
77
77
|
|
|
78
78
|
```typescript
|
|
79
79
|
const agent = new Agent({
|
|
80
|
-
id:
|
|
81
|
-
name:
|
|
80
|
+
id: 'dynamic-agent',
|
|
81
|
+
name: 'Dynamic Agent',
|
|
82
82
|
model: ({ requestContext }) => {
|
|
83
|
-
const useAdvanced = requestContext.task ===
|
|
83
|
+
const useAdvanced = requestContext.task === 'complex'
|
|
84
84
|
return useAdvanced
|
|
85
|
-
?
|
|
86
|
-
:
|
|
87
|
-
}
|
|
88
|
-
})
|
|
85
|
+
? 'fireworks-ai/accounts/fireworks/routers/kimi-k3-fast'
|
|
86
|
+
: 'fireworks-ai/accounts/fireworks/models/deepseek-v4-flash'
|
|
87
|
+
},
|
|
88
|
+
})
|
|
89
89
|
```
|
|
@@ -11,22 +11,22 @@ GREENPT_API_KEY=your-api-key
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Agent } from
|
|
14
|
+
import { Agent } from '@mastra/core/agent'
|
|
15
15
|
|
|
16
16
|
const agent = new Agent({
|
|
17
|
-
id:
|
|
18
|
-
name:
|
|
19
|
-
instructions:
|
|
20
|
-
model:
|
|
21
|
-
})
|
|
17
|
+
id: 'my-agent',
|
|
18
|
+
name: 'My Agent',
|
|
19
|
+
instructions: 'You are a helpful assistant',
|
|
20
|
+
model: 'greenpt/deepseek-v4-flash-0731',
|
|
21
|
+
})
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
24
|
-
const response = await agent.generate(
|
|
24
|
+
const response = await agent.generate('Hello!')
|
|
25
25
|
|
|
26
26
|
// Stream a response
|
|
27
|
-
const stream = await agent.stream(
|
|
27
|
+
const stream = await agent.stream('Tell me a story')
|
|
28
28
|
for await (const chunk of stream) {
|
|
29
|
-
console.log(chunk)
|
|
29
|
+
console.log(chunk)
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -78,30 +78,28 @@ for await (const chunk of stream) {
|
|
|
78
78
|
|
|
79
79
|
```typescript
|
|
80
80
|
const agent = new Agent({
|
|
81
|
-
id:
|
|
82
|
-
name:
|
|
81
|
+
id: 'custom-agent',
|
|
82
|
+
name: 'custom-agent',
|
|
83
83
|
model: {
|
|
84
|
-
url:
|
|
85
|
-
id:
|
|
84
|
+
url: 'https://api.greenpt.ai/v1',
|
|
85
|
+
id: 'greenpt/deepseek-v4-flash-0731',
|
|
86
86
|
apiKey: process.env.GREENPT_API_KEY,
|
|
87
87
|
headers: {
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
})
|
|
88
|
+
'X-Custom-Header': 'value',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
### Dynamic model selection
|
|
95
95
|
|
|
96
96
|
```typescript
|
|
97
97
|
const agent = new Agent({
|
|
98
|
-
id:
|
|
99
|
-
name:
|
|
98
|
+
id: 'dynamic-agent',
|
|
99
|
+
name: 'Dynamic Agent',
|
|
100
100
|
model: ({ requestContext }) => {
|
|
101
|
-
const useAdvanced = requestContext.task ===
|
|
102
|
-
return useAdvanced
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
});
|
|
101
|
+
const useAdvanced = requestContext.task === 'complex'
|
|
102
|
+
return useAdvanced ? 'greenpt/voxtral-small-24b-2507' : 'greenpt/deepseek-v4-flash-0731'
|
|
103
|
+
},
|
|
104
|
+
})
|
|
107
105
|
```
|
|
@@ -11,22 +11,22 @@ GROQ_API_KEY=your-api-key
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Agent } from
|
|
14
|
+
import { Agent } from '@mastra/core/agent'
|
|
15
15
|
|
|
16
16
|
const agent = new Agent({
|
|
17
|
-
id:
|
|
18
|
-
name:
|
|
19
|
-
instructions:
|
|
20
|
-
model:
|
|
21
|
-
})
|
|
17
|
+
id: 'my-agent',
|
|
18
|
+
name: 'My Agent',
|
|
19
|
+
instructions: 'You are a helpful assistant',
|
|
20
|
+
model: 'groq/allam-2-7b',
|
|
21
|
+
})
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
24
|
-
const response = await agent.generate(
|
|
24
|
+
const response = await agent.generate('Hello!')
|
|
25
25
|
|
|
26
26
|
// Stream a response
|
|
27
|
-
const stream = await agent.stream(
|
|
27
|
+
const stream = await agent.stream('Tell me a story')
|
|
28
28
|
for await (const chunk of stream) {
|
|
29
|
-
console.log(chunk)
|
|
29
|
+
console.log(chunk)
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -56,32 +56,30 @@ for await (const chunk of stream) {
|
|
|
56
56
|
|
|
57
57
|
```typescript
|
|
58
58
|
const agent = new Agent({
|
|
59
|
-
id:
|
|
60
|
-
name:
|
|
59
|
+
id: 'custom-agent',
|
|
60
|
+
name: 'custom-agent',
|
|
61
61
|
model: {
|
|
62
|
-
url:
|
|
63
|
-
id:
|
|
62
|
+
url: 'https://api.groq.com/openai/v1',
|
|
63
|
+
id: 'groq/allam-2-7b',
|
|
64
64
|
apiKey: process.env.GROQ_API_KEY,
|
|
65
65
|
headers: {
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
})
|
|
66
|
+
'X-Custom-Header': 'value',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
})
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
### Dynamic model selection
|
|
73
73
|
|
|
74
74
|
```typescript
|
|
75
75
|
const agent = new Agent({
|
|
76
|
-
id:
|
|
77
|
-
name:
|
|
76
|
+
id: 'dynamic-agent',
|
|
77
|
+
name: 'Dynamic Agent',
|
|
78
78
|
model: ({ requestContext }) => {
|
|
79
|
-
const useAdvanced = requestContext.task ===
|
|
80
|
-
return useAdvanced
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
});
|
|
79
|
+
const useAdvanced = requestContext.task === 'complex'
|
|
80
|
+
return useAdvanced ? 'groq/whisper-large-v3-turbo' : 'groq/allam-2-7b'
|
|
81
|
+
},
|
|
82
|
+
})
|
|
85
83
|
```
|
|
86
84
|
|
|
87
85
|
## Direct provider installation
|
|
@@ -11,22 +11,22 @@ HF_TOKEN=your-api-token
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Agent } from
|
|
14
|
+
import { Agent } from '@mastra/core/agent'
|
|
15
15
|
|
|
16
16
|
const agent = new Agent({
|
|
17
|
-
id:
|
|
18
|
-
name:
|
|
19
|
-
instructions:
|
|
20
|
-
model:
|
|
21
|
-
})
|
|
17
|
+
id: 'my-agent',
|
|
18
|
+
name: 'My Agent',
|
|
19
|
+
instructions: 'You are a helpful assistant',
|
|
20
|
+
model: 'huggingface/MiniMaxAI/MiniMax-M2',
|
|
21
|
+
})
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
24
|
-
const response = await agent.generate(
|
|
24
|
+
const response = await agent.generate('Hello!')
|
|
25
25
|
|
|
26
26
|
// Stream a response
|
|
27
|
-
const stream = await agent.stream(
|
|
27
|
+
const stream = await agent.stream('Tell me a story')
|
|
28
28
|
for await (const chunk of stream) {
|
|
29
|
-
console.log(chunk)
|
|
29
|
+
console.log(chunk)
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -100,30 +100,28 @@ for await (const chunk of stream) {
|
|
|
100
100
|
|
|
101
101
|
```typescript
|
|
102
102
|
const agent = new Agent({
|
|
103
|
-
id:
|
|
104
|
-
name:
|
|
103
|
+
id: 'custom-agent',
|
|
104
|
+
name: 'custom-agent',
|
|
105
105
|
model: {
|
|
106
|
-
url:
|
|
107
|
-
id:
|
|
106
|
+
url: 'https://router.huggingface.co/v1',
|
|
107
|
+
id: 'huggingface/MiniMaxAI/MiniMax-M2',
|
|
108
108
|
apiKey: process.env.HF_TOKEN,
|
|
109
109
|
headers: {
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
})
|
|
110
|
+
'X-Custom-Header': 'value',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
})
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
### Dynamic model selection
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
119
|
const agent = new Agent({
|
|
120
|
-
id:
|
|
121
|
-
name:
|
|
120
|
+
id: 'dynamic-agent',
|
|
121
|
+
name: 'Dynamic Agent',
|
|
122
122
|
model: ({ requestContext }) => {
|
|
123
|
-
const useAdvanced = requestContext.task ===
|
|
124
|
-
return useAdvanced
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
});
|
|
123
|
+
const useAdvanced = requestContext.task === 'complex'
|
|
124
|
+
return useAdvanced ? 'huggingface/zai-org/GLM-5.2' : 'huggingface/MiniMaxAI/MiniMax-M2'
|
|
125
|
+
},
|
|
126
|
+
})
|
|
129
127
|
```
|
|
@@ -11,22 +11,22 @@ HYPER_API_KEY=your-api-key
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Agent } from
|
|
14
|
+
import { Agent } from '@mastra/core/agent'
|
|
15
15
|
|
|
16
16
|
const agent = new Agent({
|
|
17
|
-
id:
|
|
18
|
-
name:
|
|
19
|
-
instructions:
|
|
20
|
-
model:
|
|
21
|
-
})
|
|
17
|
+
id: 'my-agent',
|
|
18
|
+
name: 'My Agent',
|
|
19
|
+
instructions: 'You are a helpful assistant',
|
|
20
|
+
model: 'hyper/deepseek-v4-flash',
|
|
21
|
+
})
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
24
|
-
const response = await agent.generate(
|
|
24
|
+
const response = await agent.generate('Hello!')
|
|
25
25
|
|
|
26
26
|
// Stream a response
|
|
27
|
-
const stream = await agent.stream(
|
|
27
|
+
const stream = await agent.stream('Tell me a story')
|
|
28
28
|
for await (const chunk of stream) {
|
|
29
|
-
console.log(chunk)
|
|
29
|
+
console.log(chunk)
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -68,30 +68,28 @@ for await (const chunk of stream) {
|
|
|
68
68
|
|
|
69
69
|
```typescript
|
|
70
70
|
const agent = new Agent({
|
|
71
|
-
id:
|
|
72
|
-
name:
|
|
71
|
+
id: 'custom-agent',
|
|
72
|
+
name: 'custom-agent',
|
|
73
73
|
model: {
|
|
74
|
-
url:
|
|
75
|
-
id:
|
|
74
|
+
url: 'https://hyper.charm.land/v1',
|
|
75
|
+
id: 'hyper/deepseek-v4-flash',
|
|
76
76
|
apiKey: process.env.HYPER_API_KEY,
|
|
77
77
|
headers: {
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
})
|
|
78
|
+
'X-Custom-Header': 'value',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
})
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
### Dynamic model selection
|
|
85
85
|
|
|
86
86
|
```typescript
|
|
87
87
|
const agent = new Agent({
|
|
88
|
-
id:
|
|
89
|
-
name:
|
|
88
|
+
id: 'dynamic-agent',
|
|
89
|
+
name: 'Dynamic Agent',
|
|
90
90
|
model: ({ requestContext }) => {
|
|
91
|
-
const useAdvanced = requestContext.task ===
|
|
92
|
-
return useAdvanced
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
});
|
|
91
|
+
const useAdvanced = requestContext.task === 'complex'
|
|
92
|
+
return useAdvanced ? 'hyper/qwen3.8-max' : 'hyper/deepseek-v4-flash'
|
|
93
|
+
},
|
|
94
|
+
})
|
|
97
95
|
```
|