@mastra/mcp-docs-server 1.3.2 → 1.3.3-alpha.1
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/human-in-the-loop.md +2 -4
- package/.docs/docs/agents/processors.md +58 -4
- package/.docs/docs/connections/mcp.md +2 -0
- package/.docs/docs/deployment/workers.md +3 -1
- package/.docs/docs/guides/authentication-identity.md +4 -2
- package/.docs/docs/guides/mcp-authentication-authorization.md +136 -0
- package/.docs/docs/index.md +1 -1
- package/.docs/docs/server/server-adapters.md +54 -11
- package/.docs/docs/workflows/control-flow.md +2 -4
- package/.docs/docs/workflows/scheduled-workflows.md +5 -1
- package/.docs/models/environment-variables.md +1 -1
- package/.docs/models/gateways/merge-gateway.md +2 -1
- package/.docs/models/gateways/openrouter.md +2 -1
- package/.docs/models/gateways/vercel.md +4 -1
- package/.docs/models/index.md +2 -2
- package/.docs/models/providers/baseten.md +2 -1
- package/.docs/models/providers/cortecs.md +3 -2
- package/.docs/models/providers/deepinfra.md +0 -4
- package/.docs/models/providers/edenai.md +3 -2
- package/.docs/models/providers/kilo.md +14 -12
- package/.docs/models/providers/llmgateway-providers.md +2 -9
- package/.docs/models/providers/llmgateway.md +2 -1
- package/.docs/models/providers/nano-gpt.md +3 -1
- package/.docs/models/providers/opencode.md +2 -1
- package/.docs/models/providers/requesty.md +3 -1
- package/.docs/models/providers/tempr.md +23 -4
- package/.docs/models/providers.md +1 -1
- package/.docs/reference/agent-controller/agent-controller-class.md +2 -0
- package/.docs/reference/classifier/classifier.md +49 -22
- package/.docs/reference/client-js/observability.md +1 -1
- package/.docs/reference/coding-agent/create-coding-agent.md +2 -2
- package/.docs/reference/configuration.md +2 -4
- package/.docs/reference/evals/create-classifier-scorer.md +2 -4
- package/.docs/reference/evals/create-scorer.md +1 -1
- package/.docs/reference/memory/observational-memory.md +3 -1
- package/.docs/reference/observability/tracing/spans.md +1 -1
- package/.docs/reference/processors/classifier-processor.md +8 -10
- package/.docs/reference/processors/model-selection-processor.md +8 -10
- package/.docs/reference/processors/prefill-error-handler.md +2 -2
- package/.docs/reference/processors/processor-interface.md +2 -2
- package/.docs/reference/processors/provider-history-compat.md +37 -17
- package/.docs/reference/processors/stream-error-retry-processor.md +9 -4
- package/.docs/reference/server/elysia-adapter.md +2 -0
- package/.docs/reference/server/express-adapter.md +1 -1
- package/.docs/reference/server/fastify-adapter.md +2 -0
- package/.docs/reference/server/hono-adapter.md +2 -0
- package/.docs/reference/server/koa-adapter.md +2 -0
- package/.docs/reference/server/nestjs-adapter.md +48 -0
- package/.docs/reference/tools/mcp-server.md +25 -10
- package/.docs/reference/workflows/step.md +2 -4
- package/package.json +5 -5
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Eden AI
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 286 Eden AI models through Mastra's model router. Authentication is handled automatically using the `EDENAI_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Eden AI documentation](https://docs.edenai.co).
|
|
10
10
|
|
|
@@ -83,7 +83,7 @@ for await (const chunk of stream) {
|
|
|
83
83
|
| `edenai/azure/gpt-5.2-codex` | 272K | | | | | | $2 | $14 |
|
|
84
84
|
| `edenai/cerebras/gpt-oss-120b` | 131K | | | | | | $0.35 | $0.75 |
|
|
85
85
|
| `edenai/cloudflare/@cf/aisingapore/gemma-sea-lion-v4-27b-it` | 128K | | | | | | $0.35 | $0.56 |
|
|
86
|
-
| `edenai/cloudflare/@cf/deepseek-ai/deepseek-v4-flash-0731` | 1.
|
|
86
|
+
| `edenai/cloudflare/@cf/deepseek-ai/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.44 | $1 |
|
|
87
87
|
| `edenai/cloudflare/@cf/deepseek-ai/deepseek-v4-pro-0813` | 1.0M | | | | | | $1 | $4 |
|
|
88
88
|
| `edenai/cloudflare/@cf/meta/llama-guard-3-8b` | 131K | | | | | | $0.48 | $0.03 |
|
|
89
89
|
| `edenai/cloudflare/@cf/openai/gpt-oss-120b` | 128K | | | | | | $0.35 | $0.75 |
|
|
@@ -224,6 +224,7 @@ for await (const chunk of stream) {
|
|
|
224
224
|
| `edenai/openai/gpt-6-astra` | 1.1M | | | | | | $10 | $50 |
|
|
225
225
|
| `edenai/openai/gpt-6-luna` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
226
226
|
| `edenai/openai/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
|
|
227
|
+
| `edenai/openai/gpt-6.1-sol` | 1.1M | | | | | | $2 | $10 |
|
|
227
228
|
| `edenai/openai/gpt-latest` | 1.1M | | | | | | $10 | $50 |
|
|
228
229
|
| `edenai/openai/gpt-mini-latest` | 400K | | | | | | $0.75 | $5 |
|
|
229
230
|
| `edenai/openai/gpt-pro-latest` | 1.1M | | | | | | $30 | $180 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Kilo Gateway
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 394 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Kilo Gateway documentation](https://kilo.ai).
|
|
10
10
|
|
|
@@ -42,20 +42,20 @@ for await (const chunk of stream) {
|
|
|
42
42
|
| `kilo/~anthropic/claude-haiku-latest` | 200K | | | | | | $1 | $5 |
|
|
43
43
|
| `kilo/~anthropic/claude-opus-latest` | 1.0M | | | | | | $4 | $20 |
|
|
44
44
|
| `kilo/~anthropic/claude-sonnet-latest` | 1.0M | | | | | | $2 | $10 |
|
|
45
|
-
| `kilo/~deepseek/deepseek-flash-latest` | 1.0M | | | | | | $0.02 | $0.
|
|
46
|
-
| `kilo/~deepseek/deepseek-pro-latest` | 1.0M | | | | | | $0.
|
|
47
|
-
| `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.01 | $
|
|
45
|
+
| `kilo/~deepseek/deepseek-flash-latest` | 1.0M | | | | | | $0.02 | $0.40 |
|
|
46
|
+
| `kilo/~deepseek/deepseek-pro-latest` | 1.0M | | | | | | $0.12 | $4 |
|
|
47
|
+
| `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.01 | $0.13 |
|
|
48
48
|
| `kilo/~google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
|
|
49
49
|
| `kilo/~google/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
|
|
50
|
-
| `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $0.
|
|
50
|
+
| `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $0.37 | $9 |
|
|
51
51
|
| `kilo/~openai/gpt-astra-latest` | 1.1M | | | | | | $10 | $50 |
|
|
52
52
|
| `kilo/~openai/gpt-luna-latest` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
53
53
|
| `kilo/~openai/gpt-mini-latest` | 400K | | | | | | $0.75 | $5 |
|
|
54
54
|
| `kilo/~openai/gpt-sol-latest` | 1.1M | | | | | | $2 | $10 |
|
|
55
55
|
| `kilo/~openai/gpt-terra-latest` | 1.1M | | | | | | $2 | $12 |
|
|
56
56
|
| `kilo/~x-ai/grok-latest` | 500K | | | | | | $2 | $6 |
|
|
57
|
-
| `kilo/~z-ai/glm-flash-latest` | 1.0M | | | | | | $0.02 | $0.
|
|
58
|
-
| `kilo/~z-ai/glm-latest` | 1.0M | | | | | | $0.
|
|
57
|
+
| `kilo/~z-ai/glm-flash-latest` | 1.0M | | | | | | $0.02 | $0.25 |
|
|
58
|
+
| `kilo/~z-ai/glm-latest` | 1.0M | | | | | | $0.13 | $4 |
|
|
59
59
|
| `kilo/aion-labs/aion-2.0` | 131K | | | | | | $0.80 | $2 |
|
|
60
60
|
| `kilo/aion-labs/aion-3.0` | 131K | | | | | | $3 | $6 |
|
|
61
61
|
| `kilo/aion-labs/aion-3.0-mini` | 131K | | | | | | $0.70 | $1 |
|
|
@@ -140,7 +140,7 @@ for await (const chunk of stream) {
|
|
|
140
140
|
| `kilo/google/gemma-3-27b-it` | 131K | | | | | | $0.08 | $0.16 |
|
|
141
141
|
| `kilo/google/gemma-3-4b-it` | 131K | | | | | | $0.05 | $0.10 |
|
|
142
142
|
| `kilo/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.04 | $0.22 |
|
|
143
|
-
| `kilo/google/gemma-4-31b-it` | 262K | | | | | | $0.
|
|
143
|
+
| `kilo/google/gemma-4-31b-it` | 262K | | | | | | $0.06 | $0.33 |
|
|
144
144
|
| `kilo/google/lyria-3-clip-preview` | 1.0M | | | | | | — | — |
|
|
145
145
|
| `kilo/google/lyria-3-pro-preview` | 1.0M | | | | | | — | — |
|
|
146
146
|
| `kilo/gryphe/mythomax-l2-13b` | 4K | | | | | | $0.08 | $0.11 |
|
|
@@ -211,7 +211,7 @@ for await (const chunk of stream) {
|
|
|
211
211
|
| `kilo/moonshotai/kimi-k2-thinking` | 262K | | | | | | $0.60 | $3 |
|
|
212
212
|
| `kilo/moonshotai/kimi-k2.5` | 262K | | | | | | $0.60 | $3 |
|
|
213
213
|
| `kilo/moonshotai/kimi-k2.6` | 262K | | | | | | $0.65 | $3 |
|
|
214
|
-
| `kilo/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.
|
|
214
|
+
| `kilo/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.67 | $3 |
|
|
215
215
|
| `kilo/moonshotai/kimi-k3` | 1.0M | | | | | | $3 | $15 |
|
|
216
216
|
| `kilo/morph/morph-v3-fast` | 82K | | | | | | $0.80 | $1 |
|
|
217
217
|
| `kilo/morph/morph-v3-large` | 262K | | | | | | $0.90 | $2 |
|
|
@@ -279,6 +279,8 @@ for await (const chunk of stream) {
|
|
|
279
279
|
| `kilo/openai/gpt-6-luna-pro` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
280
280
|
| `kilo/openai/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
|
|
281
281
|
| `kilo/openai/gpt-6-sol-pro` | 1.1M | | | | | | $2 | $10 |
|
|
282
|
+
| `kilo/openai/gpt-6.1-sol` | 1.1M | | | | | | $2 | $10 |
|
|
283
|
+
| `kilo/openai/gpt-6.1-sol-pro` | 1.1M | | | | | | $2 | $10 |
|
|
282
284
|
| `kilo/openai/gpt-audio` | 128K | | | | | | $3 | $10 |
|
|
283
285
|
| `kilo/openai/gpt-audio-mini` | 128K | | | | | | $0.60 | $2 |
|
|
284
286
|
| `kilo/openai/gpt-chat-latest` | 400K | | | | | | $5 | $30 |
|
|
@@ -319,7 +321,7 @@ for await (const chunk of stream) {
|
|
|
319
321
|
| `kilo/qwen/qwen3-235b-a22b` | 131K | | | | | | $0.46 | $2 |
|
|
320
322
|
| `kilo/qwen/qwen3-235b-a22b-2507` | 262K | | | | | | $0.15 | $0.60 |
|
|
321
323
|
| `kilo/qwen/qwen3-235b-a22b-thinking-2507` | 131K | | | | | | $0.23 | $2 |
|
|
322
|
-
| `kilo/qwen/qwen3-30b-a3b` |
|
|
324
|
+
| `kilo/qwen/qwen3-30b-a3b` | 131K | | | | | | $0.13 | $0.52 |
|
|
323
325
|
| `kilo/qwen/qwen3-30b-a3b-instruct-2507` | 128K | | | | | | $0.13 | $0.52 |
|
|
324
326
|
| `kilo/qwen/qwen3-30b-a3b-thinking-2507` | 82K | | | | | | $0.20 | $2 |
|
|
325
327
|
| `kilo/qwen/qwen3-32b` | 41K | | | | | | $0.08 | $0.28 |
|
|
@@ -387,7 +389,7 @@ for await (const chunk of stream) {
|
|
|
387
389
|
| `kilo/tencent/hy-mt2-1.8b` | 8K | | | | | | $0.04 | $0.18 |
|
|
388
390
|
| `kilo/tencent/hy-mt2-30b-a3b` | 8K | | | | | | $0.07 | $0.29 |
|
|
389
391
|
| `kilo/tencent/hy-mt2-7b` | 8K | | | | | | $0.07 | $0.29 |
|
|
390
|
-
| `kilo/tencent/hy3` | 262K | | | | | | $0.
|
|
392
|
+
| `kilo/tencent/hy3` | 262K | | | | | | $0.13 | $0.53 |
|
|
391
393
|
| `kilo/tencent/hy3-preview` | 262K | | | | | | $0.18 | $0.60 |
|
|
392
394
|
| `kilo/tencent/hy4-preview` | 1.0M | | | | | | $0.83 | $3 |
|
|
393
395
|
| `kilo/thedrummer/cydonia-24b-v4.1` | 131K | | | | | | $0.30 | $0.50 |
|
|
@@ -411,7 +413,7 @@ for await (const chunk of stream) {
|
|
|
411
413
|
| `kilo/x-ai/grok-build-0.1` | 256K | | | | | | $1 | $2 |
|
|
412
414
|
| `kilo/xiaomi/mimo-v2.5` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
413
415
|
| `kilo/xiaomi/mimo-v2.5-pro` | 1.0M | | | | | | $0.43 | $0.87 |
|
|
414
|
-
| `kilo/xiaomi/mimo-v2.6-flash` | 1.0M | | | | | | $0.
|
|
416
|
+
| `kilo/xiaomi/mimo-v2.6-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
415
417
|
| `kilo/xiaomi/mimo-v2.6-pro` | 1.0M | | | | | | $0.43 | $0.87 |
|
|
416
418
|
| `kilo/xiaomi/mimo-v2.6-pro-ultraspeed` | 1.0M | | | | | | $4 | $9 |
|
|
417
419
|
| `kilo/z-ai/glm-4.5` | 131K | | | | | | $0.60 | $2 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# LLM Gateway
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 432 LLM Gateway models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [LLM Gateway documentation](https://llmgateway.io/docs).
|
|
10
10
|
|
|
@@ -118,9 +118,6 @@ for await (const chunk of stream) {
|
|
|
118
118
|
| `llmgateway-providers/azure-anthropic/claude-opus-4-8` | 1.0M | | | | | | $5 | $25 |
|
|
119
119
|
| `llmgateway-providers/azure-anthropic/claude-opus-5` | 1.0M | | | | | | $5 | $25 |
|
|
120
120
|
| `llmgateway-providers/azure-anthropic/claude-sonnet-5` | 1.0M | | | | | | $2 | $10 |
|
|
121
|
-
| `llmgateway-providers/azure/gpt-3.5-turbo` | 16K | | | | | | $0.50 | $2 |
|
|
122
|
-
| `llmgateway-providers/azure/gpt-4` | 8K | | | | | | $30 | $60 |
|
|
123
|
-
| `llmgateway-providers/azure/gpt-4-turbo` | 128K | | | | | | $10 | $30 |
|
|
124
121
|
| `llmgateway-providers/azure/gpt-4.1` | 1.0M | | | | | | $2 | $8 |
|
|
125
122
|
| `llmgateway-providers/azure/gpt-4.1-mini` | 1.0M | | | | | | $0.40 | $2 |
|
|
126
123
|
| `llmgateway-providers/azure/gpt-4.1-nano` | 1.0M | | | | | | $0.10 | $0.40 |
|
|
@@ -133,7 +130,6 @@ for await (const chunk of stream) {
|
|
|
133
130
|
| `llmgateway-providers/azure/gpt-5.1-codex-mini` | 400K | | | | | | $0.25 | $2 |
|
|
134
131
|
| `llmgateway-providers/azure/gpt-5.2` | 400K | | | | | | $2 | $14 |
|
|
135
132
|
| `llmgateway-providers/azure/gpt-5.2-codex` | 400K | | | | | | $2 | $14 |
|
|
136
|
-
| `llmgateway-providers/azure/gpt-5.2-pro` | 400K | | | | | | $21 | $168 |
|
|
137
133
|
| `llmgateway-providers/azure/gpt-5.3-codex` | 400K | | | | | | $2 | $14 |
|
|
138
134
|
| `llmgateway-providers/azure/gpt-5.4` | 1.1M | | | | | | $3 | $15 |
|
|
139
135
|
| `llmgateway-providers/azure/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
|
|
@@ -147,10 +143,6 @@ for await (const chunk of stream) {
|
|
|
147
143
|
| `llmgateway-providers/azure/gpt-6-luna` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
148
144
|
| `llmgateway-providers/azure/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
|
|
149
145
|
| `llmgateway-providers/azure/gpt-oss-120b` | 131K | | | | | | $0.15 | $0.60 |
|
|
150
|
-
| `llmgateway-providers/azure/o1` | 200K | | | | | | $15 | $60 |
|
|
151
|
-
| `llmgateway-providers/azure/o3` | 200K | | | | | | $2 | $8 |
|
|
152
|
-
| `llmgateway-providers/azure/o3-mini` | 200K | | | | | | $1 | $4 |
|
|
153
|
-
| `llmgateway-providers/azure/o4-mini` | 200K | | | | | | $1 | $4 |
|
|
154
146
|
| `llmgateway-providers/baidu/deepseek-v4-flash` | 1.0M | | | | | | $0.44 | $1 |
|
|
155
147
|
| `llmgateway-providers/baidu/deepseek-v4-pro` | 1.0M | | | | | | $1 | $4 |
|
|
156
148
|
| `llmgateway-providers/baidu/deepseek-v4.1-flash` | 1.0M | | | | | | $0.30 | $1 |
|
|
@@ -369,6 +361,7 @@ for await (const chunk of stream) {
|
|
|
369
361
|
| `llmgateway-providers/openai/gpt-6-astra` | 1.1M | | | | | | $10 | $50 |
|
|
370
362
|
| `llmgateway-providers/openai/gpt-6-luna` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
371
363
|
| `llmgateway-providers/openai/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
|
|
364
|
+
| `llmgateway-providers/openai/gpt-6.1-sol` | 1.1M | | | | | | $2 | $10 |
|
|
372
365
|
| `llmgateway-providers/openai/o1` | 200K | | | | | | $15 | $60 |
|
|
373
366
|
| `llmgateway-providers/openai/o3` | 200K | | | | | | $2 | $8 |
|
|
374
367
|
| `llmgateway-providers/openai/o3-mini` | 200K | | | | | | $1 | $4 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# DevPass (LLM Gateway)
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 214 DevPass (LLM Gateway) models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [DevPass (LLM Gateway) documentation](https://llmgateway.io/docs).
|
|
10
10
|
|
|
@@ -133,6 +133,7 @@ for await (const chunk of stream) {
|
|
|
133
133
|
| `llmgateway/gpt-6-astra` | 1.1M | | | | | | $10 | $50 |
|
|
134
134
|
| `llmgateway/gpt-6-luna` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
135
135
|
| `llmgateway/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
|
|
136
|
+
| `llmgateway/gpt-6.1-sol` | 1.1M | | | | | | $2 | $10 |
|
|
136
137
|
| `llmgateway/gpt-oss-120b` | 131K | | | | | | $0.03 | $0.14 |
|
|
137
138
|
| `llmgateway/gpt-oss-20b` | 131K | | | | | | $0.04 | $0.19 |
|
|
138
139
|
| `llmgateway/granite-4.2-8b` | 131K | | | | | | $0.06 | $0.25 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# NanoGPT
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 599 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [NanoGPT documentation](https://docs.nano-gpt.com).
|
|
10
10
|
|
|
@@ -396,6 +396,8 @@ for await (const chunk of stream) {
|
|
|
396
396
|
| `nano-gpt/openai/gpt-6-luna-pro` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
397
397
|
| `nano-gpt/openai/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
|
|
398
398
|
| `nano-gpt/openai/gpt-6-sol-pro` | 1.1M | | | | | | $2 | $10 |
|
|
399
|
+
| `nano-gpt/openai/gpt-6.1-sol` | 1.1M | | | | | | $2 | $10 |
|
|
400
|
+
| `nano-gpt/openai/gpt-6.1-sol-pro` | 1.1M | | | | | | $2 | $10 |
|
|
399
401
|
| `nano-gpt/openai/gpt-astra-latest` | 1.1M | | | | | | $10 | $50 |
|
|
400
402
|
| `nano-gpt/openai/gpt-chat-latest` | 1.1M | | | | | | $2 | $10 |
|
|
401
403
|
| `nano-gpt/openai/gpt-latest` | 1.1M | | | | | | $10 | $50 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# OpenCode Zen
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 114 OpenCode Zen models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [OpenCode Zen documentation](https://opencode.ai/docs/zen).
|
|
10
10
|
|
|
@@ -92,6 +92,7 @@ for await (const chunk of stream) {
|
|
|
92
92
|
| `opencode/gpt-6-astra` | 1.1M | | | | | | $10 | $50 |
|
|
93
93
|
| `opencode/gpt-6-luna` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
94
94
|
| `opencode/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
|
|
95
|
+
| `opencode/gpt-6.1-sol` | 1.1M | | | | | | $2 | $10 |
|
|
95
96
|
| `opencode/grok-4.5` | 500K | | | | | | $2 | $6 |
|
|
96
97
|
| `opencode/grok-4.6` | 500K | | | | | | $2 | $6 |
|
|
97
98
|
| `opencode/grok-4.7` | 500K | | | | | | $2 | $6 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Requesty
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 165 Requesty models through Mastra's model router. Authentication is handled automatically using the `REQUESTY_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Requesty documentation](https://requesty.ai/solution/llm-routing/models).
|
|
10
10
|
|
|
@@ -63,6 +63,8 @@ for await (const chunk of stream) {
|
|
|
63
63
|
| `requesty/claude-sonnet-4-6@eu` | 1.0M | | | | | | $3 | $17 |
|
|
64
64
|
| `requesty/claude-sonnet-4@eu` | 1.0M | | | | | | $3 | $15 |
|
|
65
65
|
| `requesty/claude-sonnet-5` | 1.0M | | | | | | $2 | $10 |
|
|
66
|
+
| `requesty/claude-sonnet-5-5` | 1.0M | | | | | | $2 | $10 |
|
|
67
|
+
| `requesty/claude-sonnet-5-5@eu` | 1.0M | | | | | | $2 | $11 |
|
|
66
68
|
| `requesty/claude-sonnet-5@eu` | 1.0M | | | | | | $2 | $11 |
|
|
67
69
|
| `requesty/deepseek-v4-flash` | 1.0M | | | | | | $0.28 | $0.56 |
|
|
68
70
|
| `requesty/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.28 | $0.56 |
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
4
4
|
|
|
5
|
-
# Tempr
|
|
5
|
+
# Tempr Gateway
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 82 Tempr Gateway models through Mastra's model router. Authentication is handled automatically using the `TEMPR_API_KEY` environment variable.
|
|
8
8
|
|
|
9
|
-
Learn more in the [Tempr documentation](https://temprhq.io/docs/gateway-reference.html).
|
|
9
|
+
Learn more in the [Tempr Gateway documentation](https://temprhq.io/docs/gateway-reference.html).
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
TEMPR_API_KEY=your-api-key
|
|
@@ -32,7 +32,7 @@ for await (const chunk of stream) {
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Tempr documentation](https://temprhq.io/docs/gateway-reference.html) for details.
|
|
35
|
+
> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Tempr Gateway documentation](https://temprhq.io/docs/gateway-reference.html) for details.
|
|
36
36
|
|
|
37
37
|
## Models
|
|
38
38
|
|
|
@@ -54,6 +54,8 @@ for await (const chunk of stream) {
|
|
|
54
54
|
| `tempr/anthropic/claude-sonnet-5` | 1.0M | | | | | | $2 | $10 |
|
|
55
55
|
| `tempr/cerebras/gpt-oss-120b` | 131K | | | | | | $0.35 | $0.75 |
|
|
56
56
|
| `tempr/cerebras/qwen-3.8-27b` | 131K | | | | | | $0.99 | $1 |
|
|
57
|
+
| `tempr/deepseek/deepseek-flash` | 1.0M | | | | | | $0.15 | $0.60 |
|
|
58
|
+
| `tempr/deepseek/deepseek-v4-pro` | 1.0M | | | | | | $0.66 | $2 |
|
|
57
59
|
| `tempr/google/gemini-3-flash-preview` | 1.0M | | | | | | $0.50 | $3 |
|
|
58
60
|
| `tempr/google/gemini-3.1-flash-lite` | 1.0M | | | | | | $0.25 | $2 |
|
|
59
61
|
| `tempr/google/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
@@ -73,6 +75,9 @@ for await (const chunk of stream) {
|
|
|
73
75
|
| `tempr/groq/openai/gpt-oss-120b` | 131K | | | | | | $0.15 | $0.60 |
|
|
74
76
|
| `tempr/groq/openai/gpt-oss-20b` | 131K | | | | | | $0.07 | $0.30 |
|
|
75
77
|
| `tempr/groq/qwen/qwen3.8-27b` | 131K | | | | | | $0.80 | $4 |
|
|
78
|
+
| `tempr/minimax/MiniMax-M2.7` | 205K | | | | | | $0.30 | $1 |
|
|
79
|
+
| `tempr/minimax/MiniMax-M2.7-highspeed` | 205K | | | | | | $0.60 | $2 |
|
|
80
|
+
| `tempr/minimax/MiniMax-M3` | 1.0M | | | | | | $0.30 | $1 |
|
|
76
81
|
| `tempr/mistral/mistral-embed` | 8K | | | | | | $0.10 | — |
|
|
77
82
|
| `tempr/mistral/mistral-large-2512` | 262K | | | | | | $0.50 | $2 |
|
|
78
83
|
| `tempr/mistral/mistral-large-latest` | 262K | | | | | | $0.50 | $2 |
|
|
@@ -83,6 +88,20 @@ for await (const chunk of stream) {
|
|
|
83
88
|
| `tempr/mistral/voxtral-small-latest` | 32K | | | | | | $0.10 | $0.30 |
|
|
84
89
|
| `tempr/mistral/zai-glm-5-2` | 1.0M | | | | | | $1 | $4 |
|
|
85
90
|
| `tempr/mistral/zai-glm-5-3` | 1.0M | | | | | | $1 | $4 |
|
|
91
|
+
| `tempr/moonshot/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
|
|
92
|
+
| `tempr/moonshot/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
|
|
93
|
+
| `tempr/moonshot/kimi-k2.7-code-highspeed` | 262K | | | | | | $2 | $8 |
|
|
94
|
+
| `tempr/moonshot/kimi-k3` | 1.0M | | | | | | $3 | $15 |
|
|
95
|
+
| `tempr/xai/grok-4.20-0309-non-reasoning` | 1.0M | | | | | | $1 | $3 |
|
|
96
|
+
| `tempr/xai/grok-4.20-0309-reasoning` | 1.0M | | | | | | $1 | $3 |
|
|
97
|
+
| `tempr/xai/grok-4.3` | 1.0M | | | | | | $1 | $3 |
|
|
98
|
+
| `tempr/xai/grok-4.5` | 500K | | | | | | $2 | $6 |
|
|
99
|
+
| `tempr/xai/grok-4.6` | 500K | | | | | | $2 | $6 |
|
|
100
|
+
| `tempr/xai/grok-4.7` | 500K | | | | | | $2 | $6 |
|
|
101
|
+
| `tempr/xai/grok-build-0.1` | 256K | | | | | | $1 | $2 |
|
|
102
|
+
| `tempr/xiaomi-mimo/mimo-v2.6-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
103
|
+
| `tempr/xiaomi-mimo/mimo-v2.6-pro` | 1.0M | | | | | | $0.43 | $0.87 |
|
|
104
|
+
| `tempr/xiaomi-mimo/mimo-v2.6-pro-ultraspeed` | 1.0M | | | | | | $4 | $9 |
|
|
86
105
|
| `tempr/zai/glm-4.5` | 131K | | | | | | $0.60 | $2 |
|
|
87
106
|
| `tempr/zai/glm-4.5-air` | 131K | | | | | | $0.20 | $1 |
|
|
88
107
|
| `tempr/zai/glm-4.5-flash` | 131K | | | | | | — | — |
|
|
@@ -175,7 +175,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
175
175
|
- [Subconscious](https://mastra.ai/models/providers/subconscious)
|
|
176
176
|
- [submodel](https://mastra.ai/models/providers/submodel)
|
|
177
177
|
- [Synthetic](https://mastra.ai/models/providers/synthetic)
|
|
178
|
-
- [Tempr](https://mastra.ai/models/providers/tempr)
|
|
178
|
+
- [Tempr Gateway](https://mastra.ai/models/providers/tempr)
|
|
179
179
|
- [Tencent Coding Plan (China)](https://mastra.ai/models/providers/tencent-coding-plan)
|
|
180
180
|
- [Tencent Token Plan](https://mastra.ai/models/providers/tencent-token-plan)
|
|
181
181
|
- [Tencent TokenHub](https://mastra.ai/models/providers/tencent-tokenhub)
|
|
@@ -134,6 +134,8 @@ A message lifecycle starts with the initial message in `message_start`. Compact
|
|
|
134
134
|
|
|
135
135
|
**subagents.forked** (`boolean`): Whether the subagent inherits a cloned parent thread by default.
|
|
136
136
|
|
|
137
|
+
**resolveSubagentModel** (`(modelId: string, options: { requestContext?: RequestContext }) => MastraModelConfig`): Resolves a subagent's model ID into a model config. It receives a copy of the calling run's request context without the parent thread and resource IDs, so tenant credentials and request-scoped providers work for subagents. When unset, the model ID goes to the model gateway router.
|
|
138
|
+
|
|
137
139
|
**gateways** (`MastraModelGatewayInterface[]`): Custom model gateways merged with the built-in gateways.
|
|
138
140
|
|
|
139
141
|
**omConfig** (`AgentControllerOMConfig`): Default observational memory models and thresholds.
|
|
@@ -12,7 +12,7 @@ A classifier only returns evaluation results. Your application decides how to us
|
|
|
12
12
|
|
|
13
13
|
## Basic usage
|
|
14
14
|
|
|
15
|
-
This example uses the [TypeSafe AI provider](https://ai-sdk.dev/providers/ai-sdk-providers/typesafe-ai). To use another provider, see [Evaluation models](#evaluation-models).
|
|
15
|
+
This example uses the [TypeSafe AI provider](https://ai-sdk.dev/providers/ai-sdk-providers/typesafe-ai). Make sure to set the `TYPESAFE_AI_API_KEY` environment variable. To use another provider, see [Evaluation models](#evaluation-models).
|
|
16
16
|
|
|
17
17
|
Install the provider package:
|
|
18
18
|
|
|
@@ -44,13 +44,11 @@ Define questions in the constructor when every evaluation uses the same question
|
|
|
44
44
|
|
|
45
45
|
```typescript
|
|
46
46
|
import { Classifier } from '@mastra/core/classifier'
|
|
47
|
-
import {
|
|
47
|
+
import { typeSafeAi } from '@ai-sdk/typesafe-ai'
|
|
48
48
|
|
|
49
49
|
const classifier = new Classifier({
|
|
50
50
|
id: 'request-classifier',
|
|
51
|
-
model:
|
|
52
|
-
'jev-latest',
|
|
53
|
-
),
|
|
51
|
+
model: typeSafeAi.evaluationModel('jev-latest'),
|
|
54
52
|
questions: {
|
|
55
53
|
route: {
|
|
56
54
|
type: 'choice',
|
|
@@ -84,7 +82,17 @@ The evaluation model receives every question with the same `state`. When a quest
|
|
|
84
82
|
|
|
85
83
|
The examples on this page follow the [TypeSafe AI provider setup](https://ai-sdk.dev/providers/ai-sdk-providers/typesafe-ai#setup) in the AI SDK documentation. Other AI SDK providers, including OpenAI, Anthropic, and Google, also expose an `evaluationModel()` factory. See [provider models](https://ai-sdk.dev/docs/ai-sdk-core/evaluation#provider-models) for the full list, supported model IDs, and how each provider answers questions.
|
|
86
84
|
|
|
87
|
-
Each provider
|
|
85
|
+
Each provider exports a ready-made instance, which is what the examples on this page use. See [AI SDK providers](https://ai-sdk.dev/providers/ai-sdk-providers) for the others.
|
|
86
|
+
|
|
87
|
+
Pass a key explicitly by calling the factory instead:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { createTypeSafeAi } from '@ai-sdk/typesafe-ai'
|
|
91
|
+
|
|
92
|
+
const model = createTypeSafeAi({ apiKey: process.env.TYPESAFE_AI_API_KEY }).evaluationModel(
|
|
93
|
+
'jev-latest',
|
|
94
|
+
)
|
|
95
|
+
```
|
|
88
96
|
|
|
89
97
|
## Constructor
|
|
90
98
|
|
|
@@ -98,7 +106,7 @@ new Classifier(options)
|
|
|
98
106
|
|
|
99
107
|
**questions** (`ClassifierQuestions`): A non-empty record of named questions. Omit this field to supply the questions to each evaluate() call instead.
|
|
100
108
|
|
|
101
|
-
Constructor questions and per-call questions are mutually exclusive. If the constructor includes `questions`, `evaluate()` rejects a `questions` option at compile time. If the constructor omits them, every `evaluate()` call must provide them.
|
|
109
|
+
Constructor questions and per-call questions are mutually exclusive. If the constructor includes `questions`, `evaluate()` rejects a `questions` option at compile time. If the constructor omits them, every `evaluate()` call must provide them. A processor, workflow step, or scorer classifies through a configured classifier, which requires constructor questions.
|
|
102
110
|
|
|
103
111
|
## Question types
|
|
104
112
|
|
|
@@ -190,6 +198,18 @@ const answer = {
|
|
|
190
198
|
}
|
|
191
199
|
```
|
|
192
200
|
|
|
201
|
+
## Designing questions
|
|
202
|
+
|
|
203
|
+
These rules keep a question answerable from the state:
|
|
204
|
+
|
|
205
|
+
- Ask for one judgment. A question that moves when either of two fields changes can't be routed on.
|
|
206
|
+
- Keep criteria exclusive. `strong: 'A good fit'` and `partial: 'Maybe a fit'` leak probability between them.
|
|
207
|
+
- Give a score enough levels to represent intermediate values.
|
|
208
|
+
- Add an escape level when the list isn't closed. Three teams and no `other` forces every input into a team.
|
|
209
|
+
- Put fields in `state`, not in `instructions`. One changed field then moves one answer.
|
|
210
|
+
|
|
211
|
+
To check a question, change one field of the state and confirm one answer moves.
|
|
212
|
+
|
|
193
213
|
## `evaluate(options)`
|
|
194
214
|
|
|
195
215
|
Evaluates all questions against the supplied state.
|
|
@@ -210,11 +230,11 @@ Omit `questions` from the constructor when the question set changes between eval
|
|
|
210
230
|
|
|
211
231
|
```typescript
|
|
212
232
|
import { Classifier } from '@mastra/core/classifier'
|
|
213
|
-
import {
|
|
233
|
+
import { typeSafeAi } from '@ai-sdk/typesafe-ai'
|
|
214
234
|
|
|
215
235
|
const classifier = new Classifier({
|
|
216
236
|
id: 'dynamic-classifier',
|
|
217
|
-
model:
|
|
237
|
+
model: typeSafeAi.evaluationModel('jev-latest'),
|
|
218
238
|
})
|
|
219
239
|
|
|
220
240
|
const result = await classifier.evaluate({
|
|
@@ -298,7 +318,7 @@ import {
|
|
|
298
318
|
MastraEvaluationModel,
|
|
299
319
|
type EvaluationModelResult,
|
|
300
320
|
} from '@mastra/core/classifier'
|
|
301
|
-
import {
|
|
321
|
+
import { typeSafeAi } from '@ai-sdk/typesafe-ai'
|
|
302
322
|
|
|
303
323
|
class NormalizedEvaluationModel extends MastraEvaluationModel {
|
|
304
324
|
protected override transformResult(result: EvaluationModelResult): EvaluationModelResult {
|
|
@@ -312,7 +332,7 @@ class NormalizedEvaluationModel extends MastraEvaluationModel {
|
|
|
312
332
|
const classifier = new Classifier({
|
|
313
333
|
id: 'normalized-classifier',
|
|
314
334
|
model: new NormalizedEvaluationModel(
|
|
315
|
-
|
|
335
|
+
typeSafeAi.evaluationModel('jev-latest'),
|
|
316
336
|
),
|
|
317
337
|
})
|
|
318
338
|
```
|
|
@@ -326,20 +346,20 @@ Register classifiers on the `Mastra` instance to share them across your applicat
|
|
|
326
346
|
```typescript
|
|
327
347
|
import { Mastra } from '@mastra/core'
|
|
328
348
|
import { Classifier } from '@mastra/core/classifier'
|
|
329
|
-
import {
|
|
349
|
+
import { typeSafeAi } from '@ai-sdk/typesafe-ai'
|
|
330
350
|
|
|
331
|
-
export const
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
questions: {
|
|
337
|
-
unsafe: { type: 'boolean' },
|
|
338
|
-
},
|
|
339
|
-
}),
|
|
351
|
+
export const safety = new Classifier({
|
|
352
|
+
id: 'safety',
|
|
353
|
+
model: typeSafeAi.evaluationModel('jev-latest'),
|
|
354
|
+
questions: {
|
|
355
|
+
unsafe: { type: 'boolean' },
|
|
340
356
|
},
|
|
341
357
|
})
|
|
342
358
|
|
|
359
|
+
export const mastra = new Mastra({
|
|
360
|
+
classifiers: { safety },
|
|
361
|
+
})
|
|
362
|
+
|
|
343
363
|
mastra.getClassifier('safety')
|
|
344
364
|
mastra.getClassifierById('safety')
|
|
345
365
|
mastra.listClassifiers()
|
|
@@ -350,20 +370,27 @@ mastra.listClassifiers()
|
|
|
350
370
|
A classifier with constructor-configured questions can be added to a workflow with [`createStep(classifier)`](https://mastra.ai/reference/workflows/step) or [`.classifier()`](https://mastra.ai/reference/workflows/workflow-methods/classifier). Workflow output contains complete typed `answers` and normalized `usage`.
|
|
351
371
|
|
|
352
372
|
```typescript
|
|
373
|
+
import { safety } from '../index'
|
|
374
|
+
|
|
353
375
|
const workflow = createWorkflow({
|
|
354
376
|
id: 'ticket-triage',
|
|
355
377
|
inputSchema: z.object({ message: z.string() }),
|
|
356
378
|
outputSchema: z.any(),
|
|
357
379
|
})
|
|
358
380
|
.map({ message: { initData: true, path: 'message' } })
|
|
359
|
-
.classifier('safety')
|
|
381
|
+
.classifier<typeof safety.questions>('safety')
|
|
360
382
|
.commit()
|
|
361
383
|
```
|
|
362
384
|
|
|
385
|
+
A string reference resolves through the `Mastra` instance at execution time. The ID doesn't carry the question types, so supply them with a type argument to keep the answers typed. In Studio, the workflow graph shows the step as a classifier node.
|
|
386
|
+
|
|
363
387
|
The workflow adapter doesn't include warnings, raw provider responses, headers, or provider metadata in step output. Use direct `evaluate()` calls or classifier observability when you need that provider-level detail.
|
|
364
388
|
|
|
365
389
|
## Related
|
|
366
390
|
|
|
391
|
+
- [ClassifierProcessor](https://mastra.ai/reference/processors/classifier-processor)
|
|
392
|
+
- [ModelSelectionProcessor](https://mastra.ai/reference/processors/model-selection-processor)
|
|
393
|
+
- [createClassifierScorer()](https://mastra.ai/reference/evals/create-classifier-scorer)
|
|
367
394
|
- [Workflow.classifier()](https://mastra.ai/reference/workflows/workflow-methods/classifier)
|
|
368
395
|
- [Step class](https://mastra.ai/reference/workflows/step)
|
|
369
396
|
- [getClassifier()](https://mastra.ai/reference/core/getClassifier)
|
|
@@ -45,7 +45,7 @@ const completeTrace = await mastraClient.getTrace(traces.spans[0].traceId)
|
|
|
45
45
|
|
|
46
46
|
## Listing traces for a list view
|
|
47
47
|
|
|
48
|
-
`listTracesLight()` returns the same rows as a trace list, without the `input`, `output` and `attributes` payloads. Each row carries a short `inputPreview` string instead, so a list can render a preview column without transferring the whole prompt.
|
|
48
|
+
`listTracesLight()` returns the same rows as a trace list, without the `input`, `output` and `attributes` payloads. Each row carries a short `inputPreview` string instead, so a list can render a preview column without transferring the whole prompt, plus `threadId` and `resourceId` for the memory context columns.
|
|
49
49
|
|
|
50
50
|
Prefer it whenever you are rendering many traces at once, and fetch the full record only when a row is opened:
|
|
51
51
|
|
|
@@ -82,7 +82,7 @@ Each default has an explicit opt-out:
|
|
|
82
82
|
| ---------------------- | ------------------------------------------- |
|
|
83
83
|
| Workspace | `workspace: undefined` |
|
|
84
84
|
| Task tracking | Don't configure `memory` on the agent |
|
|
85
|
-
| Error processors | `
|
|
85
|
+
| Error processors | `errorProcessorDefaults: false` |
|
|
86
86
|
| Output processors | `outputProcessors: []` |
|
|
87
87
|
| Processor retry budget | `maxProcessorRetries: 0` |
|
|
88
88
|
| Goal judge prompt | Omit `goal`, or pass your own `goal.prompt` |
|
|
@@ -196,7 +196,7 @@ The default [`StreamErrorRetryProcessor`](https://mastra.ai/reference/processors
|
|
|
196
196
|
- Network resets (`ECONNRESET` / `socket hang up`) retry up to twice with exponential backoff (`1000ms * 2^retryCount`, capped at `30000ms`).
|
|
197
197
|
- Bad-request errors retry once after `2000ms`.
|
|
198
198
|
|
|
199
|
-
Specific network-reset and bad-request policies take precedence over the unknown-error policy. Passing `errorProcessors`
|
|
199
|
+
Specific network-reset and bad-request policies take precedence over the unknown-error policy. Passing `errorProcessors` sets the base list: any of the three shared defaults your list doesn't name by `id` is still added, at the position its `id` gives it. An empty list gets all three. Setting `errorProcessorDefaults: false` keeps your list exactly as given, adding none of the shared defaults. Without a list, the agent then runs no error processors. A `StreamErrorRetryProcessor` added this way uses the shared defaults, so it retries neither unknown errors nor bad-request (HTTP 400) responses. Supply your own instance in the list to keep either policy. `PrefillErrorHandler` and `ProviderHistoryCompat` are also included for provider compatibility: both repair errors caused by the shape of the message history, such as a provider rejecting a conversation that ends with an assistant message.
|
|
200
200
|
|
|
201
201
|
[`CyberRefusalHandler`](https://mastra.ai/reference/processors/cyber-refusal-handler) retries once when an OpenAI or Anthropic cybersecurity safeguard refuses a step, which often happens to ordinary coding work. It runs in both `errorProcessors` (OpenAI refusals are API errors) and `outputProcessors` (Anthropic refusals finish the step). Passing either list replaces that half of the handler.
|
|
202
202
|
|
|
@@ -373,13 +373,11 @@ Visit the [Classifier reference](https://mastra.ai/reference/classifier/classifi
|
|
|
373
373
|
```typescript
|
|
374
374
|
import { Mastra } from '@mastra/core'
|
|
375
375
|
import { Classifier } from '@mastra/core/classifier'
|
|
376
|
-
import {
|
|
376
|
+
import { typeSafeAi } from '@ai-sdk/typesafe-ai'
|
|
377
377
|
|
|
378
378
|
const safety = new Classifier({
|
|
379
379
|
id: 'safety',
|
|
380
|
-
model:
|
|
381
|
-
'jev-latest',
|
|
382
|
-
),
|
|
380
|
+
model: typeSafeAi.evaluationModel('jev-latest'),
|
|
383
381
|
questions: {
|
|
384
382
|
unsafe: {
|
|
385
383
|
type: 'boolean',
|
|
@@ -14,7 +14,7 @@ Agent scorer runs contain message objects that `Classifier.evaluate()` can't acc
|
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
16
|
import { Classifier } from '@mastra/core/classifier'
|
|
17
|
-
import {
|
|
17
|
+
import { typeSafeAi } from '@ai-sdk/typesafe-ai'
|
|
18
18
|
import { createClassifierScorer } from '@mastra/core/evals'
|
|
19
19
|
import {
|
|
20
20
|
getAssistantMessageFromRunOutput,
|
|
@@ -23,9 +23,7 @@ import {
|
|
|
23
23
|
|
|
24
24
|
const responseJudge = new Classifier({
|
|
25
25
|
id: 'response-judge',
|
|
26
|
-
model:
|
|
27
|
-
'jev-latest',
|
|
28
|
-
),
|
|
26
|
+
model: typeSafeAi.evaluationModel('jev-latest'),
|
|
29
27
|
questions: {
|
|
30
28
|
quality: {
|
|
31
29
|
type: 'score',
|
|
@@ -55,7 +55,7 @@ const scorer = createScorer({
|
|
|
55
55
|
|
|
56
56
|
**judge.errorProcessors** (`Processor[]`): Error processors for judge models that use Mastra’s current generation API. These implement processAPIError and can inspect LLM API rejections and signal a retry, e.g. StreamErrorRetryProcessor. Legacy model adapters use generateLegacy() and do not run error processors.
|
|
57
57
|
|
|
58
|
-
**judge.maxProcessorRetries** (`number`): Maximum number of times error processors can retry one judge generation. The runtime defaults to
|
|
58
|
+
**judge.maxProcessorRetries** (`number`): Maximum number of times error processors can retry one judge generation. The runtime defaults to 3 when errorProcessors are configured without this value. Set it explicitly to bound the retry budget.
|
|
59
59
|
|
|
60
60
|
**type** (`string`): Type specification for input/output. Use 'agent' for automatic agent types. For custom types, use the generic approach instead.
|
|
61
61
|
|
|
@@ -793,7 +793,7 @@ Mastra also injects scope-aware usage instructions into the agent's context. For
|
|
|
793
793
|
|
|
794
794
|
**limit** (`number`): Maximum number of items to return per page. (Default: `20`)
|
|
795
795
|
|
|
796
|
-
**detail** (`'low' | 'high'`): Controls how much content is shown per message part. 'low' shows truncated text and tool names with positional indices (\[p0], \[p1]). 'high' shows full content including tool arguments and results, clamped to one part per call with continuation hints. (Default: `'low'`)
|
|
796
|
+
**detail** (`'low' | 'high'`): Controls how much content is shown per message part. 'low' shows truncated text and tool names with positional indices (\[p0], \[p1]). 'high' shows full content including tool arguments and results, clamped to one part per call with continuation hints. Image and file parts show their filename, media type, and stored URL or provider file ID so the agent can reuse the attachment. Inline file data such as base64 or data URIs is omitted. Pass viewAttachment with cursor and partIndex to send inline attachment data to the model. (Default: `'low'`)
|
|
797
797
|
|
|
798
798
|
**partType** (`'text' | 'tool-call' | 'tool-result' | 'reasoning' | 'image' | 'file'`): Filter results to only include message parts of this type. Only applies to mode: "messages".
|
|
799
799
|
|
|
@@ -803,6 +803,8 @@ Mastra also injects scope-aware usage instructions into the agent's context. For
|
|
|
803
803
|
|
|
804
804
|
**charOffset** (`number`): Character position to continue reading a truncated single part. Only applies with cursor and partIndex. When a part is larger than the token budget, the result includes nextCharOffset — pass that exact value here in the next call to read the following chunk. The chunks concatenate to the original part text. (Default: `0`)
|
|
805
805
|
|
|
806
|
+
**viewAttachment** (`boolean`): Show the attachment itself rather than only describing it. Requires cursor and partIndex, and applies when that part is an image or file. Inline data such as base64 or data URIs is sent as a native media part. Attachments stored as remote URLs or provider file IDs, media types outside image/\* and application/pdf, and oversized payloads come back as an explanation instead. (Default: `false`)
|
|
807
|
+
|
|
806
808
|
**before** (`string`): For mode: "threads" only. Filter to threads created before this date. Accepts ISO 8601 format (e.g. "2026-03-15", "2026-03-10T00:00:00Z").
|
|
807
809
|
|
|
808
810
|
**after** (`string`): For mode: "threads" only. Filter to threads created after this date. Accepts ISO 8601 format (e.g. "2026-03-01", "2026-03-10T00:00:00Z").
|
|
@@ -105,7 +105,7 @@ Ends the span and triggers export to configured exporters. Sets the `endTime` an
|
|
|
105
105
|
error(options: ErrorSpanOptions<TType>): void
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
Records an error on the span. Sets the `errorInfo` field and can optionally end the span.
|
|
108
|
+
Records an error on the span. Sets the `errorInfo` field and can optionally end the span. When the error is an AI SDK `APICallError` (or wraps one as `cause`), `errorInfo.details` also carries the HTTP `statusCode`, request `url`, `isRetryable` flag and provider `responseBody`.
|
|
109
109
|
|
|
110
110
|
#### update
|
|
111
111
|
|