@mastra/mcp-docs-server 1.2.14-alpha.3 → 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.
Files changed (70) hide show
  1. package/.docs/docs/agents/processors.md +25 -1
  2. package/.docs/docs/workflows/agents-and-tools.md +29 -0
  3. package/.docs/docs/workflows/stored-workflows.md +146 -0
  4. package/.docs/models/environment-variables.md +1 -1
  5. package/.docs/models/gateways/neon.md +71 -0
  6. package/.docs/models/gateways/netlify.md +6 -6
  7. package/.docs/models/gateways/openrouter.md +6 -6
  8. package/.docs/models/gateways/vercel.md +6 -6
  9. package/.docs/models/gateways.md +1 -0
  10. package/.docs/models/index.md +95 -96
  11. package/.docs/models/providers/alibaba-cn.md +23 -25
  12. package/.docs/models/providers/alibaba-token-plan-cn.md +24 -24
  13. package/.docs/models/providers/alibaba-token-plan.md +23 -25
  14. package/.docs/models/providers/alibaba.md +23 -25
  15. package/.docs/models/providers/ambient.md +23 -25
  16. package/.docs/models/providers/baseten.md +23 -25
  17. package/.docs/models/providers/chutes.md +23 -25
  18. package/.docs/models/providers/cortecs.md +23 -25
  19. package/.docs/models/providers/crof.md +23 -25
  20. package/.docs/models/providers/crossmodel.md +23 -25
  21. package/.docs/models/providers/deepinfra.md +22 -24
  22. package/.docs/models/providers/digitalocean.md +23 -25
  23. package/.docs/models/providers/empiriolabs.md +23 -25
  24. package/.docs/models/providers/fireworks-ai.md +24 -24
  25. package/.docs/models/providers/greenpt.md +23 -25
  26. package/.docs/models/providers/groq.md +23 -25
  27. package/.docs/models/providers/huggingface.md +23 -25
  28. package/.docs/models/providers/hyper.md +23 -25
  29. package/.docs/models/providers/impossibl.md +23 -25
  30. package/.docs/models/providers/infomaniak.md +24 -24
  31. package/.docs/models/providers/kilo.md +23 -25
  32. package/.docs/models/providers/llmgateway.md +23 -25
  33. package/.docs/models/providers/mistral.md +23 -25
  34. package/.docs/models/providers/modal.md +23 -25
  35. package/.docs/models/providers/modelis.md +23 -25
  36. package/.docs/models/providers/nano-gpt.md +23 -25
  37. package/.docs/models/providers/neuralwatt.md +23 -25
  38. package/.docs/models/providers/ofox.md +23 -25
  39. package/.docs/models/providers/ollama-cloud.md +23 -25
  40. package/.docs/models/providers/opencode-go.md +23 -25
  41. package/.docs/models/providers/opencode.md +23 -25
  42. package/.docs/models/providers/pioneer.md +23 -25
  43. package/.docs/models/providers/requesty.md +23 -25
  44. package/.docs/models/providers/routing-run.md +23 -25
  45. package/.docs/models/providers/scx.md +23 -25
  46. package/.docs/models/providers/tensorx.md +23 -25
  47. package/.docs/models/providers/togetherai.md +22 -24
  48. package/.docs/models/providers/umans-ai-coding-plan.md +24 -24
  49. package/.docs/models/providers/umans-ai.md +23 -25
  50. package/.docs/models/providers/wandb.md +23 -25
  51. package/.docs/models/providers/xai.md +26 -28
  52. package/.docs/models/providers/zai-coding-plan.md +23 -25
  53. package/.docs/models/providers/zhipuai-coding-plan.md +23 -25
  54. package/.docs/models/providers.md +0 -1
  55. package/.docs/reference/client-js/workflows.md +92 -0
  56. package/.docs/reference/core/addStoredWorkflow.md +62 -0
  57. package/.docs/reference/core/addStoredWorkflows.md +40 -0
  58. package/.docs/reference/index.md +5 -0
  59. package/.docs/reference/processors/processor-interface.md +121 -10
  60. package/.docs/reference/server/routes.md +13 -0
  61. package/.docs/reference/storage/overview.md +9 -8
  62. package/.docs/reference/streaming/workflows/observeStream.md +1 -1
  63. package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
  64. package/.docs/reference/streaming/workflows/stream.md +1 -1
  65. package/.docs/reference/workflows/stored-workflow-definition.md +292 -0
  66. package/.docs/reference/workflows/workflow-methods/agent.md +62 -0
  67. package/.docs/reference/workflows/workflow-methods/tool.md +43 -0
  68. package/CHANGELOG.md +7 -0
  69. package/package.json +5 -5
  70. package/.docs/models/providers/neon.md +0 -109
@@ -11,22 +11,22 @@ AMBIENT_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "ambient/ambient/large"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'ambient/ambient/large',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
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
 
@@ -53,30 +53,28 @@ for await (const chunk of stream) {
53
53
 
54
54
  ```typescript
55
55
  const agent = new Agent({
56
- id: "custom-agent",
57
- name: "custom-agent",
56
+ id: 'custom-agent',
57
+ name: 'custom-agent',
58
58
  model: {
59
- url: "https://api.ambient.xyz/v1",
60
- id: "ambient/ambient/large",
59
+ url: 'https://api.ambient.xyz/v1',
60
+ id: 'ambient/ambient/large',
61
61
  apiKey: process.env.AMBIENT_API_KEY,
62
62
  headers: {
63
- "X-Custom-Header": "value"
64
- }
65
- }
66
- });
63
+ 'X-Custom-Header': 'value',
64
+ },
65
+ },
66
+ })
67
67
  ```
68
68
 
69
69
  ### Dynamic model selection
70
70
 
71
71
  ```typescript
72
72
  const agent = new Agent({
73
- id: "dynamic-agent",
74
- name: "Dynamic Agent",
73
+ id: 'dynamic-agent',
74
+ name: 'Dynamic Agent',
75
75
  model: ({ requestContext }) => {
76
- const useAdvanced = requestContext.task === "complex";
77
- return useAdvanced
78
- ? "ambient/zai-org/GLM-5.2-FP8"
79
- : "ambient/ambient/large";
80
- }
81
- });
76
+ const useAdvanced = requestContext.task === 'complex'
77
+ return useAdvanced ? 'ambient/zai-org/GLM-5.2-FP8' : 'ambient/ambient/large'
78
+ },
79
+ })
82
80
  ```
@@ -11,22 +11,22 @@ BASETEN_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "baseten/MiniMaxAI/MiniMax-M2.5"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'baseten/MiniMaxAI/MiniMax-M2.5',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
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
 
@@ -59,30 +59,28 @@ for await (const chunk of stream) {
59
59
 
60
60
  ```typescript
61
61
  const agent = new Agent({
62
- id: "custom-agent",
63
- name: "custom-agent",
62
+ id: 'custom-agent',
63
+ name: 'custom-agent',
64
64
  model: {
65
- url: "https://inference.baseten.co/v1",
66
- id: "baseten/MiniMaxAI/MiniMax-M2.5",
65
+ url: 'https://inference.baseten.co/v1',
66
+ id: 'baseten/MiniMaxAI/MiniMax-M2.5',
67
67
  apiKey: process.env.BASETEN_API_KEY,
68
68
  headers: {
69
- "X-Custom-Header": "value"
70
- }
71
- }
72
- });
69
+ 'X-Custom-Header': 'value',
70
+ },
71
+ },
72
+ })
73
73
  ```
74
74
 
75
75
  ### Dynamic model selection
76
76
 
77
77
  ```typescript
78
78
  const agent = new Agent({
79
- id: "dynamic-agent",
80
- name: "Dynamic Agent",
79
+ id: 'dynamic-agent',
80
+ name: 'Dynamic Agent',
81
81
  model: ({ requestContext }) => {
82
- const useAdvanced = requestContext.task === "complex";
83
- return useAdvanced
84
- ? "baseten/zai-org/GLM-5.2-Fast"
85
- : "baseten/MiniMaxAI/MiniMax-M2.5";
86
- }
87
- });
82
+ const useAdvanced = requestContext.task === 'complex'
83
+ return useAdvanced ? 'baseten/zai-org/GLM-5.2-Fast' : 'baseten/MiniMaxAI/MiniMax-M2.5'
84
+ },
85
+ })
88
86
  ```
@@ -11,22 +11,22 @@ CHUTES_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "chutes/Nemotron-3-Nano-Omni-30B-TEE"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'chutes/Nemotron-3-Nano-Omni-30B-TEE',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
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,30 +56,28 @@ for await (const chunk of stream) {
56
56
 
57
57
  ```typescript
58
58
  const agent = new Agent({
59
- id: "custom-agent",
60
- name: "custom-agent",
59
+ id: 'custom-agent',
60
+ name: 'custom-agent',
61
61
  model: {
62
- url: "https://llm.chutes.ai/v1",
63
- id: "chutes/Nemotron-3-Nano-Omni-30B-TEE",
62
+ url: 'https://llm.chutes.ai/v1',
63
+ id: 'chutes/Nemotron-3-Nano-Omni-30B-TEE',
64
64
  apiKey: process.env.CHUTES_API_KEY,
65
65
  headers: {
66
- "X-Custom-Header": "value"
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: "dynamic-agent",
77
- name: "Dynamic Agent",
76
+ id: 'dynamic-agent',
77
+ name: 'Dynamic Agent',
78
78
  model: ({ requestContext }) => {
79
- const useAdvanced = requestContext.task === "complex";
80
- return useAdvanced
81
- ? "chutes/zai-org/GLM-5.2-TEE"
82
- : "chutes/Nemotron-3-Nano-Omni-30B-TEE";
83
- }
84
- });
79
+ const useAdvanced = requestContext.task === 'complex'
80
+ return useAdvanced ? 'chutes/zai-org/GLM-5.2-TEE' : 'chutes/Nemotron-3-Nano-Omni-30B-TEE'
81
+ },
82
+ })
85
83
  ```
@@ -11,22 +11,22 @@ CORTECS_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "cortecs/claude-4-5-sonnet"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'cortecs/claude-4-5-sonnet',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
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
 
@@ -102,30 +102,28 @@ for await (const chunk of stream) {
102
102
 
103
103
  ```typescript
104
104
  const agent = new Agent({
105
- id: "custom-agent",
106
- name: "custom-agent",
105
+ id: 'custom-agent',
106
+ name: 'custom-agent',
107
107
  model: {
108
- url: "https://api.cortecs.ai/v1",
109
- id: "cortecs/claude-4-5-sonnet",
108
+ url: 'https://api.cortecs.ai/v1',
109
+ id: 'cortecs/claude-4-5-sonnet',
110
110
  apiKey: process.env.CORTECS_API_KEY,
111
111
  headers: {
112
- "X-Custom-Header": "value"
113
- }
114
- }
115
- });
112
+ 'X-Custom-Header': 'value',
113
+ },
114
+ },
115
+ })
116
116
  ```
117
117
 
118
118
  ### Dynamic model selection
119
119
 
120
120
  ```typescript
121
121
  const agent = new Agent({
122
- id: "dynamic-agent",
123
- name: "Dynamic Agent",
122
+ id: 'dynamic-agent',
123
+ name: 'Dynamic Agent',
124
124
  model: ({ requestContext }) => {
125
- const useAdvanced = requestContext.task === "complex";
126
- return useAdvanced
127
- ? "cortecs/qwen3.5-397b-a17b"
128
- : "cortecs/claude-4-5-sonnet";
129
- }
130
- });
125
+ const useAdvanced = requestContext.task === 'complex'
126
+ return useAdvanced ? 'cortecs/qwen3.5-397b-a17b' : 'cortecs/claude-4-5-sonnet'
127
+ },
128
+ })
131
129
  ```
@@ -11,22 +11,22 @@ CROF_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "crof/deepseek-v3.2"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'crof/deepseek-v3.2',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
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
 
@@ -69,30 +69,28 @@ for await (const chunk of stream) {
69
69
 
70
70
  ```typescript
71
71
  const agent = new Agent({
72
- id: "custom-agent",
73
- name: "custom-agent",
72
+ id: 'custom-agent',
73
+ name: 'custom-agent',
74
74
  model: {
75
- url: "https://crof.ai/v1",
76
- id: "crof/deepseek-v3.2",
75
+ url: 'https://crof.ai/v1',
76
+ id: 'crof/deepseek-v3.2',
77
77
  apiKey: process.env.CROF_API_KEY,
78
78
  headers: {
79
- "X-Custom-Header": "value"
80
- }
81
- }
82
- });
79
+ 'X-Custom-Header': 'value',
80
+ },
81
+ },
82
+ })
83
83
  ```
84
84
 
85
85
  ### Dynamic model selection
86
86
 
87
87
  ```typescript
88
88
  const agent = new Agent({
89
- id: "dynamic-agent",
90
- name: "Dynamic Agent",
89
+ id: 'dynamic-agent',
90
+ name: 'Dynamic Agent',
91
91
  model: ({ requestContext }) => {
92
- const useAdvanced = requestContext.task === "complex";
93
- return useAdvanced
94
- ? "crof/qwen3.6-27b"
95
- : "crof/deepseek-v3.2";
96
- }
97
- });
92
+ const useAdvanced = requestContext.task === 'complex'
93
+ return useAdvanced ? 'crof/qwen3.6-27b' : 'crof/deepseek-v3.2'
94
+ },
95
+ })
98
96
  ```
@@ -11,22 +11,22 @@ CROSSMODEL_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "crossmodel/anthropic/claude-fable-5"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'crossmodel/anthropic/claude-fable-5',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
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
 
@@ -93,30 +93,28 @@ for await (const chunk of stream) {
93
93
 
94
94
  ```typescript
95
95
  const agent = new Agent({
96
- id: "custom-agent",
97
- name: "custom-agent",
96
+ id: 'custom-agent',
97
+ name: 'custom-agent',
98
98
  model: {
99
- url: "https://api.crossmodel.ai/v1",
100
- id: "crossmodel/anthropic/claude-fable-5",
99
+ url: 'https://api.crossmodel.ai/v1',
100
+ id: 'crossmodel/anthropic/claude-fable-5',
101
101
  apiKey: process.env.CROSSMODEL_API_KEY,
102
102
  headers: {
103
- "X-Custom-Header": "value"
104
- }
105
- }
106
- });
103
+ 'X-Custom-Header': 'value',
104
+ },
105
+ },
106
+ })
107
107
  ```
108
108
 
109
109
  ### Dynamic model selection
110
110
 
111
111
  ```typescript
112
112
  const agent = new Agent({
113
- id: "dynamic-agent",
114
- name: "Dynamic Agent",
113
+ id: 'dynamic-agent',
114
+ name: 'Dynamic Agent',
115
115
  model: ({ requestContext }) => {
116
- const useAdvanced = requestContext.task === "complex";
117
- return useAdvanced
118
- ? "crossmodel/z-ai/glm-5.2"
119
- : "crossmodel/anthropic/claude-fable-5";
120
- }
121
- });
116
+ const useAdvanced = requestContext.task === 'complex'
117
+ return useAdvanced ? 'crossmodel/z-ai/glm-5.2' : 'crossmodel/anthropic/claude-fable-5'
118
+ },
119
+ })
122
120
  ```
@@ -11,22 +11,22 @@ DEEPINFRA_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "deepinfra/MiniMaxAI/MiniMax-M2.5"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'deepinfra/MiniMaxAI/MiniMax-M2.5',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
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
 
@@ -86,31 +86,29 @@ for await (const chunk of stream) {
86
86
 
87
87
  ```typescript
88
88
  const agent = new Agent({
89
- id: "custom-agent",
90
- name: "custom-agent",
89
+ id: 'custom-agent',
90
+ name: 'custom-agent',
91
91
  model: {
92
- id: "deepinfra/MiniMaxAI/MiniMax-M2.5",
92
+ id: 'deepinfra/MiniMaxAI/MiniMax-M2.5',
93
93
  apiKey: process.env.DEEPINFRA_API_KEY,
94
94
  headers: {
95
- "X-Custom-Header": "value"
96
- }
97
- }
98
- });
95
+ 'X-Custom-Header': 'value',
96
+ },
97
+ },
98
+ })
99
99
  ```
100
100
 
101
101
  ### Dynamic model selection
102
102
 
103
103
  ```typescript
104
104
  const agent = new Agent({
105
- id: "dynamic-agent",
106
- name: "Dynamic Agent",
105
+ id: 'dynamic-agent',
106
+ name: 'Dynamic Agent',
107
107
  model: ({ requestContext }) => {
108
- const useAdvanced = requestContext.task === "complex";
109
- return useAdvanced
110
- ? "deepinfra/zai-org/GLM-5.2"
111
- : "deepinfra/MiniMaxAI/MiniMax-M2.5";
112
- }
113
- });
108
+ const useAdvanced = requestContext.task === 'complex'
109
+ return useAdvanced ? 'deepinfra/zai-org/GLM-5.2' : 'deepinfra/MiniMaxAI/MiniMax-M2.5'
110
+ },
111
+ })
114
112
  ```
115
113
 
116
114
  ## Direct provider installation
@@ -11,22 +11,22 @@ DIGITALOCEAN_ACCESS_TOKEN=your-api-token
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "digitalocean/alibaba-qwen3-32b"
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("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
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
 
@@ -127,30 +127,28 @@ for await (const chunk of stream) {
127
127
 
128
128
  ```typescript
129
129
  const agent = new Agent({
130
- id: "custom-agent",
131
- name: "custom-agent",
130
+ id: 'custom-agent',
131
+ name: 'custom-agent',
132
132
  model: {
133
- url: "https://inference.do-ai.run/v1",
134
- id: "digitalocean/alibaba-qwen3-32b",
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
- "X-Custom-Header": "value"
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: "dynamic-agent",
148
- name: "Dynamic Agent",
147
+ id: 'dynamic-agent',
148
+ name: 'Dynamic Agent',
149
149
  model: ({ requestContext }) => {
150
- const useAdvanced = requestContext.task === "complex";
151
- return useAdvanced
152
- ? "digitalocean/wan2-2-t2v-a14b"
153
- : "digitalocean/alibaba-qwen3-32b";
154
- }
155
- });
150
+ const useAdvanced = requestContext.task === 'complex'
151
+ return useAdvanced ? 'digitalocean/wan2-2-t2v-a14b' : 'digitalocean/alibaba-qwen3-32b'
152
+ },
153
+ })
156
154
  ```