@mastra/mcp-docs-server 1.2.14-alpha.4 → 1.2.14

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 (53) hide show
  1. package/.docs/models/gateways/neon.md +6 -6
  2. package/.docs/models/gateways/netlify.md +6 -6
  3. package/.docs/models/gateways/openrouter.md +6 -6
  4. package/.docs/models/gateways/vercel.md +7 -7
  5. package/.docs/models/index.md +97 -96
  6. package/.docs/models/providers/alibaba-cn.md +25 -23
  7. package/.docs/models/providers/alibaba-token-plan-cn.md +24 -24
  8. package/.docs/models/providers/alibaba-token-plan.md +25 -23
  9. package/.docs/models/providers/alibaba.md +25 -23
  10. package/.docs/models/providers/ambient.md +26 -24
  11. package/.docs/models/providers/baseten.md +25 -23
  12. package/.docs/models/providers/chutes.md +25 -23
  13. package/.docs/models/providers/cortecs.md +133 -85
  14. package/.docs/models/providers/crof.md +25 -23
  15. package/.docs/models/providers/crossmodel.md +25 -23
  16. package/.docs/models/providers/deepinfra.md +24 -22
  17. package/.docs/models/providers/digitalocean.md +25 -23
  18. package/.docs/models/providers/empiriolabs.md +25 -23
  19. package/.docs/models/providers/fireworks-ai.md +24 -24
  20. package/.docs/models/providers/greenpt.md +25 -23
  21. package/.docs/models/providers/groq.md +25 -23
  22. package/.docs/models/providers/huggingface.md +25 -23
  23. package/.docs/models/providers/hyper.md +31 -29
  24. package/.docs/models/providers/impossibl.md +25 -23
  25. package/.docs/models/providers/infomaniak.md +24 -24
  26. package/.docs/models/providers/kilo.md +26 -24
  27. package/.docs/models/providers/llmgateway.md +26 -24
  28. package/.docs/models/providers/minimax.md +23 -25
  29. package/.docs/models/providers/mistral.md +25 -23
  30. package/.docs/models/providers/modal.md +25 -23
  31. package/.docs/models/providers/modelis.md +25 -23
  32. package/.docs/models/providers/nano-gpt.md +26 -24
  33. package/.docs/models/providers/neuralwatt.md +25 -23
  34. package/.docs/models/providers/ofox.md +25 -23
  35. package/.docs/models/providers/ollama-cloud.md +25 -23
  36. package/.docs/models/providers/openai.md +26 -28
  37. package/.docs/models/providers/opencode-go.md +25 -23
  38. package/.docs/models/providers/opencode.md +25 -23
  39. package/.docs/models/providers/perplexity-agent.md +24 -24
  40. package/.docs/models/providers/pioneer.md +25 -23
  41. package/.docs/models/providers/requesty.md +25 -23
  42. package/.docs/models/providers/routing-run.md +25 -23
  43. package/.docs/models/providers/scx.md +25 -23
  44. package/.docs/models/providers/tensorx.md +25 -23
  45. package/.docs/models/providers/togetherai.md +24 -22
  46. package/.docs/models/providers/umans-ai-coding-plan.md +24 -24
  47. package/.docs/models/providers/umans-ai.md +25 -23
  48. package/.docs/models/providers/wandb.md +25 -23
  49. package/.docs/models/providers/xai.md +28 -26
  50. package/.docs/models/providers/zai-coding-plan.md +25 -23
  51. package/.docs/models/providers/zhipuai-coding-plan.md +25 -23
  52. package/CHANGELOG.md +7 -0
  53. package/package.json +6 -6
@@ -11,22 +11,22 @@ ROUTING_RUN_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: 'routing-run/claude-opus-4-8',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "routing-run/claude-opus-4-8"
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
 
@@ -58,28 +58,30 @@ for await (const chunk of stream) {
58
58
 
59
59
  ```typescript
60
60
  const agent = new Agent({
61
- id: 'custom-agent',
62
- name: 'custom-agent',
61
+ id: "custom-agent",
62
+ name: "custom-agent",
63
63
  model: {
64
- url: 'https://api.routing.run/v1',
65
- id: 'routing-run/claude-opus-4-8',
64
+ url: "https://api.routing.run/v1",
65
+ id: "routing-run/claude-opus-4-8",
66
66
  apiKey: process.env.ROUTING_RUN_API_KEY,
67
67
  headers: {
68
- 'X-Custom-Header': 'value',
69
- },
70
- },
71
- })
68
+ "X-Custom-Header": "value"
69
+ }
70
+ }
71
+ });
72
72
  ```
73
73
 
74
74
  ### Dynamic model selection
75
75
 
76
76
  ```typescript
77
77
  const agent = new Agent({
78
- id: 'dynamic-agent',
79
- name: 'Dynamic Agent',
78
+ id: "dynamic-agent",
79
+ name: "Dynamic Agent",
80
80
  model: ({ requestContext }) => {
81
- const useAdvanced = requestContext.task === 'complex'
82
- return useAdvanced ? 'routing-run/qwen3.5-9b' : 'routing-run/claude-opus-4-8'
83
- },
84
- })
81
+ const useAdvanced = requestContext.task === "complex";
82
+ return useAdvanced
83
+ ? "routing-run/qwen3.5-9b"
84
+ : "routing-run/claude-opus-4-8";
85
+ }
86
+ });
85
87
  ```
@@ -11,22 +11,22 @@ SCX_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: 'scx/MiniMax-M2.7',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "scx/MiniMax-M2.7"
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
 
@@ -45,28 +45,30 @@ for await (const chunk of stream) {
45
45
 
46
46
  ```typescript
47
47
  const agent = new Agent({
48
- id: 'custom-agent',
49
- name: 'custom-agent',
48
+ id: "custom-agent",
49
+ name: "custom-agent",
50
50
  model: {
51
- url: 'https://api.scx.ai/v1',
52
- id: 'scx/MiniMax-M2.7',
51
+ url: "https://api.scx.ai/v1",
52
+ id: "scx/MiniMax-M2.7",
53
53
  apiKey: process.env.SCX_API_KEY,
54
54
  headers: {
55
- 'X-Custom-Header': 'value',
56
- },
57
- },
58
- })
55
+ "X-Custom-Header": "value"
56
+ }
57
+ }
58
+ });
59
59
  ```
60
60
 
61
61
  ### Dynamic model selection
62
62
 
63
63
  ```typescript
64
64
  const agent = new Agent({
65
- id: 'dynamic-agent',
66
- name: 'Dynamic Agent',
65
+ id: "dynamic-agent",
66
+ name: "Dynamic Agent",
67
67
  model: ({ requestContext }) => {
68
- const useAdvanced = requestContext.task === 'complex'
69
- return useAdvanced ? 'scx/gpt-oss-120b' : 'scx/MiniMax-M2.7'
70
- },
71
- })
68
+ const useAdvanced = requestContext.task === "complex";
69
+ return useAdvanced
70
+ ? "scx/gpt-oss-120b"
71
+ : "scx/MiniMax-M2.7";
72
+ }
73
+ });
72
74
  ```
@@ -11,22 +11,22 @@ TENSORX_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: 'tensorx/deepseek/deepseek-chat-v3.1',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "tensorx/deepseek/deepseek-chat-v3.1"
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
 
@@ -68,28 +68,30 @@ for await (const chunk of stream) {
68
68
 
69
69
  ```typescript
70
70
  const agent = new Agent({
71
- id: 'custom-agent',
72
- name: 'custom-agent',
71
+ id: "custom-agent",
72
+ name: "custom-agent",
73
73
  model: {
74
- url: 'https://api.tensorx.ai/v1',
75
- id: 'tensorx/deepseek/deepseek-chat-v3.1',
74
+ url: "https://api.tensorx.ai/v1",
75
+ id: "tensorx/deepseek/deepseek-chat-v3.1",
76
76
  apiKey: process.env.TENSORX_API_KEY,
77
77
  headers: {
78
- 'X-Custom-Header': 'value',
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: 'dynamic-agent',
89
- name: 'Dynamic Agent',
88
+ id: "dynamic-agent",
89
+ name: "Dynamic Agent",
90
90
  model: ({ requestContext }) => {
91
- const useAdvanced = requestContext.task === 'complex'
92
- return useAdvanced ? 'tensorx/z-ai/glm-5v-turbo' : 'tensorx/deepseek/deepseek-chat-v3.1'
93
- },
94
- })
91
+ const useAdvanced = requestContext.task === "complex";
92
+ return useAdvanced
93
+ ? "tensorx/z-ai/glm-5v-turbo"
94
+ : "tensorx/deepseek/deepseek-chat-v3.1";
95
+ }
96
+ });
95
97
  ```
@@ -11,22 +11,22 @@ TOGETHER_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: 'togetherai/LiquidAI/LFM2-24B-A2B',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "togetherai/LiquidAI/LFM2-24B-A2B"
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
 
@@ -64,29 +64,31 @@ for await (const chunk of stream) {
64
64
 
65
65
  ```typescript
66
66
  const agent = new Agent({
67
- id: 'custom-agent',
68
- name: 'custom-agent',
67
+ id: "custom-agent",
68
+ name: "custom-agent",
69
69
  model: {
70
- id: 'togetherai/LiquidAI/LFM2-24B-A2B',
70
+ id: "togetherai/LiquidAI/LFM2-24B-A2B",
71
71
  apiKey: process.env.TOGETHER_API_KEY,
72
72
  headers: {
73
- 'X-Custom-Header': 'value',
74
- },
75
- },
76
- })
73
+ "X-Custom-Header": "value"
74
+ }
75
+ }
76
+ });
77
77
  ```
78
78
 
79
79
  ### Dynamic model selection
80
80
 
81
81
  ```typescript
82
82
  const agent = new Agent({
83
- id: 'dynamic-agent',
84
- name: 'Dynamic Agent',
83
+ id: "dynamic-agent",
84
+ name: "Dynamic Agent",
85
85
  model: ({ requestContext }) => {
86
- const useAdvanced = requestContext.task === 'complex'
87
- return useAdvanced ? 'togetherai/zai-org/GLM-5.2' : 'togetherai/LiquidAI/LFM2-24B-A2B'
88
- },
89
- })
86
+ const useAdvanced = requestContext.task === "complex";
87
+ return useAdvanced
88
+ ? "togetherai/zai-org/GLM-5.2"
89
+ : "togetherai/LiquidAI/LFM2-24B-A2B";
90
+ }
91
+ });
90
92
  ```
91
93
 
92
94
  ## Direct provider installation
@@ -11,22 +11,22 @@ UMANS_AI_CODING_PLAN_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: 'umans-ai-coding-plan/umans-coder',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "umans-ai-coding-plan/umans-coder"
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
 
@@ -51,30 +51,30 @@ for await (const chunk of stream) {
51
51
 
52
52
  ```typescript
53
53
  const agent = new Agent({
54
- id: 'custom-agent',
55
- name: 'custom-agent',
54
+ id: "custom-agent",
55
+ name: "custom-agent",
56
56
  model: {
57
- url: 'https://api.code.umans.ai/v1',
58
- id: 'umans-ai-coding-plan/umans-coder',
57
+ url: "https://api.code.umans.ai/v1",
58
+ id: "umans-ai-coding-plan/umans-coder",
59
59
  apiKey: process.env.UMANS_AI_CODING_PLAN_API_KEY,
60
60
  headers: {
61
- 'X-Custom-Header': 'value',
62
- },
63
- },
64
- })
61
+ "X-Custom-Header": "value"
62
+ }
63
+ }
64
+ });
65
65
  ```
66
66
 
67
67
  ### Dynamic model selection
68
68
 
69
69
  ```typescript
70
70
  const agent = new Agent({
71
- id: 'dynamic-agent',
72
- name: 'Dynamic Agent',
71
+ id: "dynamic-agent",
72
+ name: "Dynamic Agent",
73
73
  model: ({ requestContext }) => {
74
- const useAdvanced = requestContext.task === 'complex'
74
+ const useAdvanced = requestContext.task === "complex";
75
75
  return useAdvanced
76
- ? 'umans-ai-coding-plan/umans-qwen3.6-35b-a3b'
77
- : 'umans-ai-coding-plan/umans-coder'
78
- },
79
- })
76
+ ? "umans-ai-coding-plan/umans-qwen3.6-35b-a3b"
77
+ : "umans-ai-coding-plan/umans-coder";
78
+ }
79
+ });
80
80
  ```
@@ -11,22 +11,22 @@ UMANS_AI_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: 'umans-ai/umans-coder',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "umans-ai/umans-coder"
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
 
@@ -50,28 +50,30 @@ for await (const chunk of stream) {
50
50
 
51
51
  ```typescript
52
52
  const agent = new Agent({
53
- id: 'custom-agent',
54
- name: 'custom-agent',
53
+ id: "custom-agent",
54
+ name: "custom-agent",
55
55
  model: {
56
- url: 'https://api.code.umans.ai/v1',
57
- id: 'umans-ai/umans-coder',
56
+ url: "https://api.code.umans.ai/v1",
57
+ id: "umans-ai/umans-coder",
58
58
  apiKey: process.env.UMANS_AI_API_KEY,
59
59
  headers: {
60
- 'X-Custom-Header': 'value',
61
- },
62
- },
63
- })
60
+ "X-Custom-Header": "value"
61
+ }
62
+ }
63
+ });
64
64
  ```
65
65
 
66
66
  ### Dynamic model selection
67
67
 
68
68
  ```typescript
69
69
  const agent = new Agent({
70
- id: 'dynamic-agent',
71
- name: 'Dynamic Agent',
70
+ id: "dynamic-agent",
71
+ name: "Dynamic Agent",
72
72
  model: ({ requestContext }) => {
73
- const useAdvanced = requestContext.task === 'complex'
74
- return useAdvanced ? 'umans-ai/umans-kimi-k3' : 'umans-ai/umans-coder'
75
- },
76
- })
73
+ const useAdvanced = requestContext.task === "complex";
74
+ return useAdvanced
75
+ ? "umans-ai/umans-kimi-k3"
76
+ : "umans-ai/umans-coder";
77
+ }
78
+ });
77
79
  ```
@@ -11,22 +11,22 @@ WANDB_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: 'wandb/JetBrains/Mellum2-12B-A2.5B-Instruct',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct"
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
 
@@ -70,28 +70,30 @@ for await (const chunk of stream) {
70
70
 
71
71
  ```typescript
72
72
  const agent = new Agent({
73
- id: 'custom-agent',
74
- name: 'custom-agent',
73
+ id: "custom-agent",
74
+ name: "custom-agent",
75
75
  model: {
76
- url: 'https://api.inference.wandb.ai/v1',
77
- id: 'wandb/JetBrains/Mellum2-12B-A2.5B-Instruct',
76
+ url: "https://api.inference.wandb.ai/v1",
77
+ id: "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct",
78
78
  apiKey: process.env.WANDB_API_KEY,
79
79
  headers: {
80
- 'X-Custom-Header': 'value',
81
- },
82
- },
83
- })
80
+ "X-Custom-Header": "value"
81
+ }
82
+ }
83
+ });
84
84
  ```
85
85
 
86
86
  ### Dynamic model selection
87
87
 
88
88
  ```typescript
89
89
  const agent = new Agent({
90
- id: 'dynamic-agent',
91
- name: 'Dynamic Agent',
90
+ id: "dynamic-agent",
91
+ name: "Dynamic Agent",
92
92
  model: ({ requestContext }) => {
93
- const useAdvanced = requestContext.task === 'complex'
94
- return useAdvanced ? 'wandb/zai-org/GLM-5.2' : 'wandb/JetBrains/Mellum2-12B-A2.5B-Instruct'
95
- },
96
- })
93
+ const useAdvanced = requestContext.task === "complex";
94
+ return useAdvanced
95
+ ? "wandb/zai-org/GLM-5.2"
96
+ : "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct";
97
+ }
98
+ });
97
99
  ```
@@ -11,22 +11,22 @@ XAI_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: 'xai/grok-4.20-0309-non-reasoning',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "xai/grok-4.20-0309-non-reasoning"
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
 
@@ -51,29 +51,31 @@ for await (const chunk of stream) {
51
51
 
52
52
  ```typescript
53
53
  const agent = new Agent({
54
- id: 'custom-agent',
55
- name: 'custom-agent',
54
+ id: "custom-agent",
55
+ name: "custom-agent",
56
56
  model: {
57
- id: 'xai/grok-4.20-0309-non-reasoning',
57
+ id: "xai/grok-4.20-0309-non-reasoning",
58
58
  apiKey: process.env.XAI_API_KEY,
59
59
  headers: {
60
- 'X-Custom-Header': 'value',
61
- },
62
- },
63
- })
60
+ "X-Custom-Header": "value"
61
+ }
62
+ }
63
+ });
64
64
  ```
65
65
 
66
66
  ### Dynamic model selection
67
67
 
68
68
  ```typescript
69
69
  const agent = new Agent({
70
- id: 'dynamic-agent',
71
- name: 'Dynamic Agent',
70
+ id: "dynamic-agent",
71
+ name: "Dynamic Agent",
72
72
  model: ({ requestContext }) => {
73
- const useAdvanced = requestContext.task === 'complex'
74
- return useAdvanced ? 'xai/grok-imagine-video-1.5' : 'xai/grok-4.20-0309-non-reasoning'
75
- },
76
- })
73
+ const useAdvanced = requestContext.task === "complex";
74
+ return useAdvanced
75
+ ? "xai/grok-imagine-video-1.5"
76
+ : "xai/grok-4.20-0309-non-reasoning";
77
+ }
78
+ });
77
79
  ```
78
80
 
79
81
  ## Provider Options
@@ -81,13 +83,13 @@ const agent = new Agent({
81
83
  xAI supports the following provider-specific options via the `providerOptions` parameter:
82
84
 
83
85
  ```typescript
84
- const response = await agent.generate('Hello!', {
86
+ const response = await agent.generate("Hello!", {
85
87
  providerOptions: {
86
88
  xai: {
87
89
  // See available options in the table below
88
- },
89
- },
90
- })
90
+ }
91
+ }
92
+ });
91
93
  ```
92
94
 
93
95
  ### Available Options