@mastra/mcp-docs-server 0.0.0-studio-deploy-20260404182525 → 0.0.0-studio-cli-20260504022012
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/adding-voice.md +18 -17
- package/.docs/docs/agents/background-tasks.md +242 -0
- package/.docs/docs/agents/channels.md +2 -1
- package/.docs/docs/agents/overview.md +4 -0
- package/.docs/docs/agents/processors.md +177 -5
- package/.docs/docs/agents/structured-output.md +66 -1
- package/.docs/docs/agents/supervisor-agents.md +65 -0
- package/.docs/docs/agents/using-tools.md +73 -0
- package/.docs/docs/browser/agent-browser.md +78 -0
- package/.docs/docs/browser/browser-viewer.md +144 -0
- package/.docs/docs/browser/overview.md +168 -0
- package/.docs/docs/browser/stagehand.md +129 -0
- package/.docs/docs/deployment/cloud-providers.md +5 -1
- package/.docs/docs/deployment/mastra-server.md +4 -4
- package/.docs/docs/deployment/monorepo.md +3 -3
- package/.docs/docs/deployment/overview.md +11 -8
- package/.docs/docs/editor/overview.md +290 -0
- package/.docs/docs/editor/prompts.md +134 -0
- package/.docs/docs/editor/tools.md +152 -0
- package/.docs/docs/evals/custom-scorers.md +63 -3
- package/.docs/docs/evals/datasets/overview.md +1 -1
- package/.docs/docs/index.md +2 -2
- package/.docs/docs/mastra-platform/configuration.md +36 -0
- package/.docs/docs/mastra-platform/overview.md +78 -0
- package/.docs/docs/mcp/overview.md +17 -0
- package/.docs/docs/memory/memory-processors.md +3 -3
- package/.docs/docs/memory/message-history.md +8 -2
- package/.docs/docs/memory/observational-memory.md +65 -8
- package/.docs/docs/memory/storage.md +1 -2
- package/.docs/docs/memory/working-memory.md +2 -2
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/metrics/overview.md +2 -2
- package/.docs/docs/observability/overview.md +1 -1
- package/.docs/docs/observability/tracing/bridges/datadog.md +217 -0
- package/.docs/docs/observability/tracing/bridges/otel.md +2 -2
- package/.docs/docs/observability/tracing/exporters/arthur.md +163 -0
- package/.docs/docs/observability/tracing/exporters/cloud.md +135 -63
- package/.docs/docs/observability/tracing/exporters/datadog.md +3 -1
- package/.docs/docs/observability/tracing/exporters/default.md +5 -5
- package/.docs/docs/observability/tracing/exporters/laminar.md +22 -14
- package/.docs/docs/observability/tracing/exporters/langfuse.md +50 -33
- package/.docs/docs/observability/tracing/overview.md +87 -20
- package/.docs/docs/server/custom-adapters.md +5 -5
- package/.docs/docs/server/custom-api-routes.md +3 -3
- package/.docs/docs/server/mastra-client.md +2 -2
- package/.docs/docs/server/mastra-server.md +1 -1
- package/.docs/docs/server/middleware.md +46 -42
- package/.docs/docs/server/request-context.md +13 -2
- package/.docs/docs/server/server-adapters.md +91 -8
- package/.docs/docs/streaming/background-task-streaming.md +80 -0
- package/.docs/docs/streaming/overview.md +3 -0
- package/.docs/docs/studio/deployment.md +24 -6
- package/.docs/docs/studio/observability.md +1 -1
- package/.docs/docs/studio/overview.md +4 -4
- package/.docs/docs/voice/overview.md +74 -5
- package/.docs/docs/voice/speech-to-speech.md +45 -1
- package/.docs/docs/voice/speech-to-text.md +7 -7
- package/.docs/docs/voice/text-to-speech.md +10 -10
- package/.docs/docs/workflows/agents-and-tools.md +1 -1
- package/.docs/docs/workflows/overview.md +105 -4
- package/.docs/docs/workflows/scheduled-workflows.md +181 -0
- package/.docs/docs/workspace/filesystem.md +64 -6
- package/.docs/docs/workspace/lsp.md +76 -4
- package/.docs/docs/workspace/overview.md +62 -15
- package/.docs/docs/workspace/sandbox.md +3 -1
- package/.docs/docs/workspace/search.md +41 -2
- package/.docs/docs/workspace/skills.md +19 -19
- package/.docs/guides/agent-frameworks/ai-sdk.md +4 -4
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +56 -9
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/deployment/mastra-platform.md +191 -0
- package/.docs/guides/deployment/netlify.md +16 -1
- package/.docs/guides/getting-started/nestjs.md +238 -0
- package/.docs/guides/getting-started/next-js.md +0 -4
- package/.docs/guides/guide/code-review-bot.md +2 -2
- package/.docs/guides/guide/dev-assistant.md +4 -4
- package/.docs/{docs/mcp → guides/guide}/publishing-mcp-server.md +21 -1
- package/.docs/guides/guide/slack-assistant.md +191 -0
- package/.docs/guides/migrations/mastra-cloud.md +368 -0
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +1 -1
- package/.docs/models/embeddings.md +3 -3
- package/.docs/models/gateways/azure-openai.md +74 -35
- package/.docs/models/gateways/mastra.md +64 -0
- package/.docs/models/gateways/netlify.md +7 -3
- package/.docs/models/gateways/openrouter.md +28 -12
- package/.docs/models/gateways/vercel.md +22 -2
- package/.docs/models/gateways.md +1 -0
- package/.docs/models/index.md +43 -8
- package/.docs/models/providers/302ai.md +37 -4
- package/.docs/models/providers/abliteration-ai.md +71 -0
- package/.docs/models/providers/alibaba-cn.md +8 -2
- package/.docs/models/providers/alibaba-coding-plan-cn.md +3 -2
- package/.docs/models/providers/alibaba-coding-plan.md +3 -2
- package/.docs/models/providers/alibaba.md +8 -1
- package/.docs/models/providers/anthropic.md +18 -5
- package/.docs/models/providers/baseten.md +3 -1
- package/.docs/models/providers/berget.md +10 -12
- package/.docs/models/providers/chutes.md +4 -2
- package/.docs/models/providers/cloudflare-workers-ai.md +14 -48
- package/.docs/models/providers/cortecs.md +22 -2
- package/.docs/models/providers/deepinfra.md +8 -2
- package/.docs/models/providers/deepseek.md +6 -4
- package/.docs/models/providers/digitalocean.md +133 -0
- package/.docs/models/providers/fireworks-ai.md +6 -1
- package/.docs/models/providers/firmware.md +12 -10
- package/.docs/models/providers/friendli.md +6 -7
- package/.docs/models/providers/google.md +9 -3
- package/.docs/models/providers/helicone.md +1 -2
- package/.docs/models/providers/hpc-ai.md +73 -0
- package/.docs/models/providers/huggingface.md +6 -2
- package/.docs/models/providers/inception.md +9 -11
- package/.docs/models/providers/kilo.md +359 -339
- package/.docs/models/providers/kimi-for-coding.md +2 -1
- package/.docs/models/providers/llmgateway.md +67 -77
- package/.docs/models/providers/mistral.md +3 -2
- package/.docs/models/providers/mixlayer.md +75 -0
- package/.docs/models/providers/moonshotai-cn.md +3 -2
- package/.docs/models/providers/moonshotai.md +3 -2
- package/.docs/models/providers/nano-gpt.md +8 -2
- package/.docs/models/providers/neuralwatt.md +84 -0
- package/.docs/models/providers/novita-ai.md +19 -4
- package/.docs/models/providers/nvidia.md +8 -1
- package/.docs/models/providers/ollama-cloud.md +7 -2
- package/.docs/models/providers/openai.md +7 -2
- package/.docs/models/providers/opencode-go.md +21 -13
- package/.docs/models/providers/opencode.md +11 -4
- package/.docs/models/providers/ovhcloud.md +6 -8
- package/.docs/models/providers/poe.md +10 -15
- package/.docs/models/providers/regolo-ai.md +83 -0
- package/.docs/models/providers/siliconflow-cn.md +5 -2
- package/.docs/models/providers/siliconflow.md +6 -3
- package/.docs/models/providers/stepfun.md +8 -7
- package/.docs/models/providers/synthetic.md +5 -2
- package/.docs/models/providers/tencent-token-plan.md +71 -0
- package/.docs/models/providers/tencent-tokenhub.md +71 -0
- package/.docs/models/providers/togetherai.md +8 -7
- package/.docs/models/providers/vivgrid.md +7 -3
- package/.docs/models/providers/vultr.md +7 -6
- package/.docs/models/providers/wafer.ai.md +73 -0
- package/.docs/models/providers/wandb.md +3 -2
- package/.docs/models/providers/xai.md +6 -1
- package/.docs/models/providers/xiaomi-token-plan-ams.md +75 -0
- package/.docs/models/providers/xiaomi-token-plan-cn.md +75 -0
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +75 -0
- package/.docs/models/providers/xiaomi.md +4 -2
- package/.docs/models/providers/zai-coding-plan.md +11 -19
- package/.docs/models/providers/zai.md +2 -1
- package/.docs/models/providers/zenmux.md +17 -6
- package/.docs/models/providers/zhipuai-coding-plan.md +11 -21
- package/.docs/models/providers/zhipuai.md +2 -1
- package/.docs/models/providers.md +11 -0
- package/.docs/reference/agents/agent.md +1 -1
- package/.docs/reference/agents/channels.md +3 -3
- package/.docs/reference/agents/generate.md +88 -6
- package/.docs/reference/agents/generateLegacy.md +1 -1
- package/.docs/reference/ai-sdk/chat-route.md +2 -0
- package/.docs/reference/ai-sdk/handle-chat-stream.md +19 -0
- package/.docs/reference/ai-sdk/handle-network-stream.md +2 -0
- package/.docs/reference/ai-sdk/network-route.md +2 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +95 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +15 -0
- package/.docs/reference/browser/agent-browser.md +375 -0
- package/.docs/reference/browser/browser-viewer.md +228 -0
- package/.docs/reference/browser/mastra-browser.md +286 -0
- package/.docs/reference/browser/stagehand-browser.md +286 -0
- package/.docs/reference/cli/mastra.md +703 -0
- package/.docs/reference/client-js/agents.md +166 -0
- package/.docs/reference/client-js/conversations.md +1 -1
- package/.docs/reference/client-js/mastra-client.md +23 -0
- package/.docs/reference/client-js/observability.md +2 -2
- package/.docs/reference/client-js/responses.md +1 -1
- package/.docs/reference/client-js/workflows.md +62 -1
- package/.docs/reference/configuration.md +67 -1
- package/.docs/reference/core/addGateway.md +5 -5
- package/.docs/reference/core/getEditor.md +35 -0
- package/.docs/reference/core/getGateway.md +5 -5
- package/.docs/reference/core/getGatewayById.md +5 -5
- package/.docs/reference/core/getMCPServer.md +2 -2
- package/.docs/reference/core/getMCPServerById.md +2 -2
- package/.docs/reference/core/getScorer.md +3 -3
- package/.docs/reference/core/getScorerById.md +3 -3
- package/.docs/reference/core/listGateways.md +5 -5
- package/.docs/reference/core/listMCPServers.md +2 -2
- package/.docs/reference/core/listScorers.md +3 -3
- package/.docs/reference/core/mastra-class.md +11 -1
- package/.docs/reference/core/mastra-model-gateway.md +5 -5
- package/.docs/reference/datasets/create.md +4 -4
- package/.docs/reference/datasets/startExperiment.md +28 -2
- package/.docs/reference/datasets/update.md +4 -4
- package/.docs/reference/deployer/cloudflare.md +14 -1
- package/.docs/reference/deployer/netlify.md +50 -2
- package/.docs/reference/editor/mastra-editor.md +168 -0
- package/.docs/reference/editor/tool-provider.md +85 -0
- package/.docs/reference/evals/context-precision.md +3 -3
- package/.docs/reference/evals/context-relevance.md +3 -3
- package/.docs/reference/evals/create-scorer.md +5 -3
- package/.docs/reference/evals/filter-run.md +117 -0
- package/.docs/reference/evals/mastra-scorer.md +4 -4
- package/.docs/reference/evals/noise-sensitivity.md +6 -6
- package/.docs/reference/evals/prompt-alignment.md +12 -12
- package/.docs/reference/evals/run-evals.md +6 -6
- package/.docs/reference/evals/scorer-utils.md +3 -3
- package/.docs/reference/evals/trajectory-accuracy.md +3 -3
- package/.docs/reference/harness/harness-class.md +152 -53
- package/.docs/reference/index.md +25 -0
- package/.docs/reference/logging/pino-logger.md +0 -2
- package/.docs/reference/mastra-platform/api.md +108 -0
- package/.docs/reference/memory/clone-utilities.md +4 -2
- package/.docs/reference/memory/cloneThread.md +4 -2
- package/.docs/reference/memory/observational-memory.md +4 -0
- package/.docs/reference/observability/metrics/automatic-metrics.md +3 -3
- package/.docs/reference/observability/tracing/bridges/datadog.md +211 -0
- package/.docs/reference/observability/tracing/bridges/otel.md +3 -3
- package/.docs/reference/observability/tracing/configuration.md +18 -11
- package/.docs/reference/observability/tracing/exporters/arthur.md +122 -0
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +102 -21
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +8 -8
- package/.docs/reference/observability/tracing/exporters/datadog.md +3 -1
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +8 -8
- package/.docs/reference/observability/tracing/exporters/langfuse.md +25 -32
- package/.docs/reference/observability/tracing/exporters/otel.md +3 -3
- package/.docs/reference/observability/tracing/instances.md +7 -7
- package/.docs/reference/observability/tracing/interfaces.md +23 -6
- package/.docs/reference/observability/tracing/span-filtering.md +95 -0
- package/.docs/reference/observability/tracing/spans.md +6 -6
- package/.docs/reference/processors/prefill-error-handler.md +70 -0
- package/.docs/reference/processors/processor-interface.md +400 -40
- package/.docs/reference/processors/skill-search-processor.md +20 -1
- package/.docs/reference/processors/stream-error-retry-processor.md +54 -0
- package/.docs/reference/processors/tool-call-filter.md +23 -0
- package/.docs/reference/server/create-route.md +3 -3
- package/.docs/reference/server/express-adapter.md +4 -4
- package/.docs/reference/server/fastify-adapter.md +4 -4
- package/.docs/reference/server/hono-adapter.md +4 -4
- package/.docs/reference/server/koa-adapter.md +4 -4
- package/.docs/reference/server/mastra-server.md +3 -3
- package/.docs/reference/server/nestjs-adapter.md +169 -0
- package/.docs/reference/server/register-api-route.md +4 -4
- package/.docs/reference/server/routes.md +11 -10
- package/.docs/reference/storage/clickhouse.md +300 -0
- package/.docs/reference/storage/cloudflare-d1.md +42 -42
- package/.docs/reference/storage/composite.md +5 -3
- package/.docs/reference/storage/duckdb.md +150 -0
- package/.docs/reference/storage/overview.md +1 -1
- package/.docs/reference/storage/redis.md +266 -0
- package/.docs/reference/streaming/ChunkType.md +143 -3
- package/.docs/reference/streaming/agents/MastraModelOutput.md +2 -2
- package/.docs/reference/streaming/agents/stream.md +10 -2
- package/.docs/reference/streaming/agents/streamUntilIdle.md +94 -0
- package/.docs/reference/streaming/workflows/resumeStream.md +2 -0
- package/.docs/reference/templates/overview.md +88 -14
- package/.docs/reference/tools/create-tool.md +107 -5
- package/.docs/reference/tools/mcp-client.md +45 -0
- package/.docs/reference/tools/mcp-server.md +1 -3
- package/.docs/reference/tools/perplexity.md +155 -0
- package/.docs/reference/tools/tavily.md +307 -0
- package/.docs/reference/vectors/mongodb.md +0 -2
- package/.docs/reference/voice/aws-nova-sonic.md +247 -0
- package/.docs/reference/voice/cloudflare.md +3 -3
- package/.docs/reference/voice/sarvam.md +29 -23
- package/.docs/reference/voice/voice.connect.md +4 -4
- package/.docs/reference/voice/voice.listen.md +3 -3
- package/.docs/reference/workflows/run-methods/resume.md +24 -0
- package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
- package/.docs/reference/workflows/step.md +88 -7
- package/.docs/reference/workflows/workflow-methods/foreach.md +14 -1
- package/.docs/reference/workflows/workflow.md +88 -4
- package/.docs/reference/workspace/azure-blob-filesystem.md +219 -0
- package/.docs/reference/workspace/docker-sandbox.md +196 -0
- package/.docs/reference/workspace/gcs-filesystem.md +1 -0
- package/.docs/reference/workspace/google-drive-filesystem.md +185 -0
- package/.docs/reference/workspace/modal-sandbox.md +168 -0
- package/.docs/reference/workspace/process-manager.md +1 -1
- package/.docs/reference/workspace/s3-filesystem.md +80 -5
- package/.docs/reference/workspace/vercel.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +37 -6
- package/CHANGELOG.md +500 -4
- package/dist/stdio.js.map +1 -1
- package/dist/utils.d.ts +1 -4
- package/dist/utils.d.ts.map +1 -1
- package/package.json +11 -11
- package/.docs/docs/mastra-cloud/deployment.md +0 -77
- package/.docs/docs/mastra-cloud/observability.md +0 -38
- package/.docs/docs/mastra-cloud/overview.md +0 -23
- package/.docs/docs/mastra-cloud/setup.md +0 -42
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# Tavily tools
|
|
2
|
+
|
|
3
|
+
**Added in:** `@mastra/tavily@0.1.0-alpha.0`
|
|
4
|
+
|
|
5
|
+
The `@mastra/tavily` package wraps the [Tavily](https://app.tavily.com) API as Mastra-compatible tools. It exposes factory functions for search, extract, crawl, and map — each returning a tool created with [`createTool()`](https://mastra.ai/reference/tools/create-tool) that includes full Zod input/output schemas.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
**npm**:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @mastra/tavily @tavily/core zod
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**pnpm**:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
pnpm add @mastra/tavily @tavily/core zod
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Yarn**:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
yarn add @mastra/tavily @tavily/core zod
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Bun**:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
bun add @mastra/tavily @tavily/core zod
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick start
|
|
34
|
+
|
|
35
|
+
Use `createTavilyTools()` to get all four tools with shared configuration:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { createTavilyTools } from '@mastra/tavily'
|
|
39
|
+
|
|
40
|
+
const tools = createTavilyTools()
|
|
41
|
+
// Or pass an explicit API key:
|
|
42
|
+
// const tools = createTavilyTools({ apiKey: 'tvly-...' })
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Each tool can also be created individually:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { createTavilySearchTool, createTavilyExtractTool } from '@mastra/tavily'
|
|
49
|
+
|
|
50
|
+
const searchTool = createTavilySearchTool()
|
|
51
|
+
const extractTool = createTavilyExtractTool({ apiKey: 'tvly-...' })
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
By default, all tools read `TAVILY_API_KEY` from the environment. You can pass `{ apiKey }` explicitly to override.
|
|
55
|
+
|
|
56
|
+
## Configuration
|
|
57
|
+
|
|
58
|
+
All factory functions accept `TavilyClientOptions` from `@tavily/core`:
|
|
59
|
+
|
|
60
|
+
**apiKey** (`string`): Tavily API key. Falls back to the \`TAVILY\_API\_KEY\` environment variable.
|
|
61
|
+
|
|
62
|
+
**clientSource** (`string`): Attribution string sent with each request. (Default: `'mastra'`)
|
|
63
|
+
|
|
64
|
+
**apiBaseURL** (`string`): Base URL for the Tavily API.
|
|
65
|
+
|
|
66
|
+
**proxies** (`object`): Proxy configuration passed to the underlying HTTP client.
|
|
67
|
+
|
|
68
|
+
**projectId** (`string`): Tavily project ID for request scoping.
|
|
69
|
+
|
|
70
|
+
## `createTavilyTools()`
|
|
71
|
+
|
|
72
|
+
Returns an object containing all four tools with a shared configuration.
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { createTavilyTools } from '@mastra/tavily'
|
|
76
|
+
|
|
77
|
+
const tools = createTavilyTools({ apiKey: 'tvly-...' })
|
|
78
|
+
// tools.tavilySearch, tools.tavilyExtract, tools.tavilyCrawl, tools.tavilyMap
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Returns:** `{ tavilySearch, tavilyExtract, tavilyCrawl, tavilyMap }`
|
|
82
|
+
|
|
83
|
+
## `createTavilySearchTool()`
|
|
84
|
+
|
|
85
|
+
Creates a tool that searches the web using Tavily. Returns relevant results with content snippets, optional AI-generated answers, and images.
|
|
86
|
+
|
|
87
|
+
**Tool ID:** `tavily-search`
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { createTavilySearchTool } from '@mastra/tavily'
|
|
91
|
+
|
|
92
|
+
const searchTool = createTavilySearchTool()
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Input
|
|
96
|
+
|
|
97
|
+
**query** (`string`): The search query.
|
|
98
|
+
|
|
99
|
+
**searchDepth** (`'basic' | 'advanced' | 'fast' | 'ultra-fast'`): Search depth. Use 'basic' for standard results, 'advanced' for more thorough results, or 'fast'/'ultra-fast' for low latency.
|
|
100
|
+
|
|
101
|
+
**maxResults** (`number`): Maximum number of results to return (1-20).
|
|
102
|
+
|
|
103
|
+
**includeAnswer** (`boolean | 'basic' | 'advanced'`): Include an AI-generated answer summary.
|
|
104
|
+
|
|
105
|
+
**includeImages** (`boolean`): Include query-related images in the response.
|
|
106
|
+
|
|
107
|
+
**includeImageDescriptions** (`boolean`): Include descriptions for returned images.
|
|
108
|
+
|
|
109
|
+
**includeRawContent** (`false | 'markdown' | 'text'`): Include cleaned HTML content of each result. Pass false to disable, or 'markdown'/'text' for format.
|
|
110
|
+
|
|
111
|
+
**includeDomains** (`string[]`): Restrict results to these domains.
|
|
112
|
+
|
|
113
|
+
**excludeDomains** (`string[]`): Exclude results from these domains.
|
|
114
|
+
|
|
115
|
+
**timeRange** (`'day' | 'week' | 'month' | 'year'`): Filter results by recency.
|
|
116
|
+
|
|
117
|
+
### Output
|
|
118
|
+
|
|
119
|
+
**query** (`string`): The original search query.
|
|
120
|
+
|
|
121
|
+
**answer** (`string`): AI-generated answer summary.
|
|
122
|
+
|
|
123
|
+
**images** (`{ url: string; description?: string }[]`): Related images.
|
|
124
|
+
|
|
125
|
+
**results** (`SearchResult[]`): Array of search results.
|
|
126
|
+
|
|
127
|
+
**results.title** (`string`): Result title.
|
|
128
|
+
|
|
129
|
+
**results.url** (`string`): Result URL.
|
|
130
|
+
|
|
131
|
+
**results.content** (`string`): Content snippet.
|
|
132
|
+
|
|
133
|
+
**results.score** (`number`): Relevance score.
|
|
134
|
+
|
|
135
|
+
**results.rawContent** (`string`): Full-page content (when requested).
|
|
136
|
+
|
|
137
|
+
**responseTime** (`number`): Server response time in seconds.
|
|
138
|
+
|
|
139
|
+
## `createTavilyExtractTool()`
|
|
140
|
+
|
|
141
|
+
Creates a tool that extracts content from one or more URLs. Returns raw page content in markdown or text format with up to 20 URLs per request.
|
|
142
|
+
|
|
143
|
+
**Tool ID:** `tavily-extract`
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
import { createTavilyExtractTool } from '@mastra/tavily'
|
|
147
|
+
|
|
148
|
+
const extractTool = createTavilyExtractTool()
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Input
|
|
152
|
+
|
|
153
|
+
**urls** (`string[]`): URLs to extract content from (1-20).
|
|
154
|
+
|
|
155
|
+
**extractDepth** (`'basic' | 'advanced'`): Extraction depth. Use 'advanced' to retrieve tables and embedded content.
|
|
156
|
+
|
|
157
|
+
**query** (`string`): User intent for reranking extracted content chunks by relevance.
|
|
158
|
+
|
|
159
|
+
**includeImages** (`boolean`): Include images extracted from the pages.
|
|
160
|
+
|
|
161
|
+
**format** (`'markdown' | 'text'`): Output format for extracted content. (Default: `'markdown'`)
|
|
162
|
+
|
|
163
|
+
### Output
|
|
164
|
+
|
|
165
|
+
**results** (`ExtractResult[]`): Successfully extracted pages.
|
|
166
|
+
|
|
167
|
+
**results.url** (`string`): Page URL.
|
|
168
|
+
|
|
169
|
+
**results.rawContent** (`string`): Extracted page content.
|
|
170
|
+
|
|
171
|
+
**results.images** (`string[]`): Extracted image URLs.
|
|
172
|
+
|
|
173
|
+
**failedResults** (`FailedResult[]`): URLs that failed extraction.
|
|
174
|
+
|
|
175
|
+
**failedResults.url** (`string`): Failed URL.
|
|
176
|
+
|
|
177
|
+
**failedResults.error** (`string`): Error message.
|
|
178
|
+
|
|
179
|
+
**responseTime** (`number`): Server response time in seconds.
|
|
180
|
+
|
|
181
|
+
## `createTavilyCrawlTool()`
|
|
182
|
+
|
|
183
|
+
Creates a tool that crawls a website starting from a URL. Extracts content from discovered pages with configurable depth, breadth, and domain constraints.
|
|
184
|
+
|
|
185
|
+
**Tool ID:** `tavily-crawl`
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
import { createTavilyCrawlTool } from '@mastra/tavily'
|
|
189
|
+
|
|
190
|
+
const crawlTool = createTavilyCrawlTool()
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Input
|
|
194
|
+
|
|
195
|
+
**url** (`string`): The root URL to begin the crawl.
|
|
196
|
+
|
|
197
|
+
**maxDepth** (`number`): Maximum depth of the crawl from the base URL.
|
|
198
|
+
|
|
199
|
+
**maxBreadth** (`number`): Maximum number of links to follow per page.
|
|
200
|
+
|
|
201
|
+
**limit** (`number`): Total number of pages the crawler processes before stopping.
|
|
202
|
+
|
|
203
|
+
**instructions** (`string`): Natural language instructions for the crawler.
|
|
204
|
+
|
|
205
|
+
**selectPaths** (`string[]`): Regex patterns to select specific URL paths.
|
|
206
|
+
|
|
207
|
+
**selectDomains** (`string[]`): Regex patterns to restrict to specific domains.
|
|
208
|
+
|
|
209
|
+
**excludePaths** (`string[]`): Regex patterns to exclude specific URL paths.
|
|
210
|
+
|
|
211
|
+
**excludeDomains** (`string[]`): Regex patterns to exclude specific domains.
|
|
212
|
+
|
|
213
|
+
**allowExternal** (`boolean`): Whether to follow links to external domains.
|
|
214
|
+
|
|
215
|
+
**extractDepth** (`'basic' | 'advanced'`): Extraction depth. Use 'advanced' to retrieve tables and embedded content.
|
|
216
|
+
|
|
217
|
+
**includeImages** (`boolean`): Include images from crawled pages.
|
|
218
|
+
|
|
219
|
+
**format** (`'markdown' | 'text'`): Output format for extracted content. (Default: `'markdown'`)
|
|
220
|
+
|
|
221
|
+
### Output
|
|
222
|
+
|
|
223
|
+
**baseUrl** (`string`): The root URL that was crawled.
|
|
224
|
+
|
|
225
|
+
**results** (`CrawlResult[]`): Content extracted from discovered pages.
|
|
226
|
+
|
|
227
|
+
**results.url** (`string`): Page URL.
|
|
228
|
+
|
|
229
|
+
**results.rawContent** (`string`): Extracted page content.
|
|
230
|
+
|
|
231
|
+
**results.images** (`string[]`): Image URLs found on the page.
|
|
232
|
+
|
|
233
|
+
**responseTime** (`number`): Server response time in seconds.
|
|
234
|
+
|
|
235
|
+
## `createTavilyMapTool()`
|
|
236
|
+
|
|
237
|
+
Creates a tool that maps a website's structure starting from a URL. Discovers and returns a list of URLs without extracting page content. Use this to understand site structure before targeted extraction.
|
|
238
|
+
|
|
239
|
+
**Tool ID:** `tavily-map`
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
import { createTavilyMapTool } from '@mastra/tavily'
|
|
243
|
+
|
|
244
|
+
const mapTool = createTavilyMapTool()
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Input
|
|
248
|
+
|
|
249
|
+
**url** (`string`): The root URL to begin mapping.
|
|
250
|
+
|
|
251
|
+
**maxDepth** (`number`): Maximum depth of the mapping from the base URL.
|
|
252
|
+
|
|
253
|
+
**maxBreadth** (`number`): Maximum number of links to follow per page.
|
|
254
|
+
|
|
255
|
+
**limit** (`number`): Total number of links the mapper processes before stopping.
|
|
256
|
+
|
|
257
|
+
**instructions** (`string`): Natural language instructions for the mapper.
|
|
258
|
+
|
|
259
|
+
**selectPaths** (`string[]`): Regex patterns to select specific URL paths.
|
|
260
|
+
|
|
261
|
+
**selectDomains** (`string[]`): Regex patterns to restrict to specific domains.
|
|
262
|
+
|
|
263
|
+
**excludePaths** (`string[]`): Regex patterns to exclude specific URL paths.
|
|
264
|
+
|
|
265
|
+
**excludeDomains** (`string[]`): Regex patterns to exclude specific domains.
|
|
266
|
+
|
|
267
|
+
**allowExternal** (`boolean`): Whether to include external domain links.
|
|
268
|
+
|
|
269
|
+
### Output
|
|
270
|
+
|
|
271
|
+
**baseUrl** (`string`): The root URL that was mapped.
|
|
272
|
+
|
|
273
|
+
**results** (`string[]`): Discovered URLs.
|
|
274
|
+
|
|
275
|
+
**responseTime** (`number`): Server response time in seconds.
|
|
276
|
+
|
|
277
|
+
## Agent example
|
|
278
|
+
|
|
279
|
+
The following example demonstrates a research agent that combines search and extract:
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
import { Agent } from '@mastra/core/agent'
|
|
283
|
+
import { createTavilySearchTool, createTavilyExtractTool } from '@mastra/tavily'
|
|
284
|
+
|
|
285
|
+
const agent = new Agent({
|
|
286
|
+
id: 'web-search-agent',
|
|
287
|
+
name: 'Web Search Agent',
|
|
288
|
+
model: 'anthropic/claude-sonnet-4-6',
|
|
289
|
+
instructions:
|
|
290
|
+
'You are a web search assistant. Use search tool to find relevant pages, then use extract tool to get full content from the best results.',
|
|
291
|
+
tools: {
|
|
292
|
+
search: createTavilySearchTool(),
|
|
293
|
+
extract: createTavilyExtractTool(),
|
|
294
|
+
},
|
|
295
|
+
})
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Environment variables
|
|
299
|
+
|
|
300
|
+
| Variable | Description |
|
|
301
|
+
| ---------------- | ------------------------------------------------------------------------------------------- |
|
|
302
|
+
| `TAVILY_API_KEY` | Your Tavily API key. Used as the default when `apiKey` is not passed to a factory function. |
|
|
303
|
+
|
|
304
|
+
## Related
|
|
305
|
+
|
|
306
|
+
- [`createTool()`](https://mastra.ai/reference/tools/create-tool)
|
|
307
|
+
- [Tavily API documentation](https://docs.tavily.com)
|
|
@@ -107,8 +107,6 @@ Searches for similar vectors with optional metadata filtering.
|
|
|
107
107
|
|
|
108
108
|
**includeVector** (`boolean`): Whether to include vector data in results (Default: `false`)
|
|
109
109
|
|
|
110
|
-
**minScore** (`number`): Minimum similarity score threshold (Default: `0`)
|
|
111
|
-
|
|
112
110
|
### `describeIndex()`
|
|
113
111
|
|
|
114
112
|
Returns information about the index (collection).
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# AWS Nova Sonic voice
|
|
2
|
+
|
|
3
|
+
The `NovaSonicVoice` class provides real-time speech-to-speech capabilities backed by [AWS Bedrock Nova 2 Sonic](https://docs.aws.amazon.com/nova/latest/userguide/speech.html). It opens a bidirectional stream to the model and emits events for assistant audio, transcribed text, tool calls, turn boundaries, and interruptions.
|
|
4
|
+
|
|
5
|
+
## Usage example
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { NovaSonicVoice } from '@mastra/voice-aws-nova-sonic'
|
|
9
|
+
import { playAudio, getMicrophoneStream } from '@mastra/node-audio'
|
|
10
|
+
|
|
11
|
+
// Initialize using the default AWS credential provider chain
|
|
12
|
+
const voice = new NovaSonicVoice({
|
|
13
|
+
region: 'us-east-1',
|
|
14
|
+
speaker: 'matthew',
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
// Or pass explicit credentials
|
|
18
|
+
const voiceWithCredentials = new NovaSonicVoice({
|
|
19
|
+
region: 'us-east-1',
|
|
20
|
+
speaker: 'tiffany',
|
|
21
|
+
credentials: {
|
|
22
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
|
|
23
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
// Establish the bidirectional stream
|
|
28
|
+
await voice.connect()
|
|
29
|
+
|
|
30
|
+
// Listen for assistant audio (Int16Array PCM)
|
|
31
|
+
voice.on('speaking', ({ audioData }) => {
|
|
32
|
+
if (audioData) playAudio(audioData)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// Listen for transcribed text from the user and assistant
|
|
36
|
+
voice.on('writing', ({ text, role, generationStage }) => {
|
|
37
|
+
console.log(`${role} (${generationStage ?? 'FINAL'}): ${text}`)
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// Stream microphone audio in real time
|
|
41
|
+
const microphoneStream = getMicrophoneStream()
|
|
42
|
+
await voice.send(microphoneStream)
|
|
43
|
+
|
|
44
|
+
// Disconnect when done
|
|
45
|
+
voice.close()
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Authentication
|
|
49
|
+
|
|
50
|
+
`NovaSonicVoice` uses the AWS SDK credential resolution chain when no `credentials` option is passed. Mastra calls `defaultProvider()` from `@aws-sdk/credential-provider-node`, which checks (in order) environment variables, shared credentials files, IAM role for EC2, ECS, EKS, and other standard sources.
|
|
51
|
+
|
|
52
|
+
To use static credentials, pass them on the constructor:
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
new NovaSonicVoice({
|
|
56
|
+
region: 'us-east-1',
|
|
57
|
+
credentials: {
|
|
58
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
|
|
59
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
|
|
60
|
+
sessionToken: process.env.AWS_SESSION_TOKEN,
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The voice provider never logs credential values.
|
|
66
|
+
|
|
67
|
+
## Configuration
|
|
68
|
+
|
|
69
|
+
### Constructor options
|
|
70
|
+
|
|
71
|
+
**region** (`'us-east-1' | 'us-west-2' | 'ap-northeast-1'`): AWS region that hosts the Nova Sonic model. (Default: `'us-east-1'`)
|
|
72
|
+
|
|
73
|
+
**model** (`string`): Bedrock model ID for the bidirectional stream. (Default: `'amazon.nova-2-sonic-v1:0'`)
|
|
74
|
+
|
|
75
|
+
**credentials** (`AwsCredentialIdentity`): Static AWS credentials. When omitted the default AWS credential provider chain is used.
|
|
76
|
+
|
|
77
|
+
**speaker** (`string | NovaSonicVoiceConfigDetails`): Default voice for the assistant. Pass a voice ID string such as 'matthew' or an object that includes a language code and gender. (Default: `'matthew'`)
|
|
78
|
+
|
|
79
|
+
**languageCode** (`NovaSonicLanguageCode`): Language code used for the session. Polyglot voices support all listed languages.
|
|
80
|
+
|
|
81
|
+
**instructions** (`string`): System prompt sent at session start. Equivalent to calling addInstructions() before connect().
|
|
82
|
+
|
|
83
|
+
**tools** (`NovaSonicToolConfig[]`): Tools exposed to the model. When the voice instance is attached to an Agent, the Agent's tools are added automatically.
|
|
84
|
+
|
|
85
|
+
**sessionConfig** (`NovaSonicSessionConfig`): Inference, turn-detection, and tool-choice configuration. See Session configuration below.
|
|
86
|
+
|
|
87
|
+
**debug** (`boolean`): Enable verbose logging for stream events. Sensitive fields are masked. (Default: `false`)
|
|
88
|
+
|
|
89
|
+
### Session configuration
|
|
90
|
+
|
|
91
|
+
`sessionConfig` controls inference parameters and turn-taking behavior. All fields are optional.
|
|
92
|
+
|
|
93
|
+
**inferenceConfiguration** (`object`): Sampling and decoding parameters.
|
|
94
|
+
|
|
95
|
+
**inferenceConfiguration.maxTokens** (`number`): Maximum tokens generated per turn.
|
|
96
|
+
|
|
97
|
+
**inferenceConfiguration.temperature** (`number`): Sampling temperature.
|
|
98
|
+
|
|
99
|
+
**inferenceConfiguration.topP** (`number`): Nucleus sampling probability.
|
|
100
|
+
|
|
101
|
+
**inferenceConfiguration.topK** (`number`): Top-k sampling.
|
|
102
|
+
|
|
103
|
+
**inferenceConfiguration.stopSequences** (`string[]`): Sequences that end generation.
|
|
104
|
+
|
|
105
|
+
**turnDetectionConfiguration** (`object`): Endpointing sensitivity for turn detection.
|
|
106
|
+
|
|
107
|
+
**turnDetectionConfiguration.endpointingSensitivity** (`'HIGH' | 'MEDIUM' | 'LOW'`): Pause duration before the model considers a turn complete. HIGH ends turns fastest (about 1.5s pause), MEDIUM is balanced (about 1.75s), LOW waits longest (about 2s).
|
|
108
|
+
|
|
109
|
+
**toolChoice** (`'auto' | 'any' | { tool: { name: string } }`): How the model decides whether to call a tool.
|
|
110
|
+
|
|
111
|
+
**enableKnowledgeGrounding** (`boolean`): Enable retrieval-augmented grounding against a Bedrock knowledge base.
|
|
112
|
+
|
|
113
|
+
**knowledgeBaseConfig** (`{ knowledgeBaseId?: string; dataSourceId?: string }`): Knowledge base used when knowledge grounding is enabled.
|
|
114
|
+
|
|
115
|
+
## Methods
|
|
116
|
+
|
|
117
|
+
### `connect()`
|
|
118
|
+
|
|
119
|
+
Opens the bidirectional stream to AWS Bedrock and sends the initial session, prompt, and system events. Call this before `speak`, `listen`, or `send`.
|
|
120
|
+
|
|
121
|
+
**options** (`{ requestContext?: RequestContext }`): Optional request context propagated to tool calls made during the session.
|
|
122
|
+
|
|
123
|
+
Returns: `Promise<void>`
|
|
124
|
+
|
|
125
|
+
### `speak()`
|
|
126
|
+
|
|
127
|
+
Synthesizes speech for a text prompt and emits `speaking` events as audio is produced.
|
|
128
|
+
|
|
129
|
+
**input** (`string | NodeJS.ReadableStream`): Text or text stream to synthesize.
|
|
130
|
+
|
|
131
|
+
**options** (`NovaSonicVoiceOptions`): Per-call overrides such as the speaker or language code.
|
|
132
|
+
|
|
133
|
+
Returns: `Promise<void>`
|
|
134
|
+
|
|
135
|
+
### `send()`
|
|
136
|
+
|
|
137
|
+
Streams microphone audio (or any PCM source) to the model. Use this for live, continuous conversation.
|
|
138
|
+
|
|
139
|
+
**audioData** (`NodeJS.ReadableStream | Int16Array`): 16-bit PCM audio to forward to the model.
|
|
140
|
+
|
|
141
|
+
Returns: `Promise<void>`
|
|
142
|
+
|
|
143
|
+
### `listen()`
|
|
144
|
+
|
|
145
|
+
Convenience wrapper that delegates to `send()`. Use it when you want a single transcription pass over a finite audio stream.
|
|
146
|
+
|
|
147
|
+
**audioData** (`NodeJS.ReadableStream`): Audio stream to transcribe.
|
|
148
|
+
|
|
149
|
+
Returns: `Promise<void>`
|
|
150
|
+
|
|
151
|
+
### `endAudioInput()`
|
|
152
|
+
|
|
153
|
+
Signals the end of the current audio turn so the model can finalize its response. Call this when the user stops speaking and the provider is not configured for server-side turn detection.
|
|
154
|
+
|
|
155
|
+
Returns: `Promise<void>`
|
|
156
|
+
|
|
157
|
+
### `addInstructions()`
|
|
158
|
+
|
|
159
|
+
Updates the system prompt for the active session.
|
|
160
|
+
|
|
161
|
+
**instructions** (`string`): System prompt to apply to the session.
|
|
162
|
+
|
|
163
|
+
Returns: `void`
|
|
164
|
+
|
|
165
|
+
### `addTools()`
|
|
166
|
+
|
|
167
|
+
Registers tools with the voice instance. When `NovaSonicVoice` is attached to an Agent, the Agent's tools are added automatically.
|
|
168
|
+
|
|
169
|
+
**tools** (`ToolsInput`): Tools exposed to the model.
|
|
170
|
+
|
|
171
|
+
Returns: `void`
|
|
172
|
+
|
|
173
|
+
### `getSpeakers()`
|
|
174
|
+
|
|
175
|
+
Returns the list of voices supported by Nova 2 Sonic.
|
|
176
|
+
|
|
177
|
+
Returns: `Promise<Array<{ voiceId: string; name: string; language: string; locale: string; gender: 'masculine' | 'feminine'; polyglot: boolean }>>`
|
|
178
|
+
|
|
179
|
+
### `getListener()`
|
|
180
|
+
|
|
181
|
+
Returns whether the voice instance currently holds an open stream.
|
|
182
|
+
|
|
183
|
+
Returns: `Promise<{ enabled: boolean }>`
|
|
184
|
+
|
|
185
|
+
### `close()`
|
|
186
|
+
|
|
187
|
+
Closes the bidirectional stream and destroys the underlying Bedrock client. Call this when the conversation ends.
|
|
188
|
+
|
|
189
|
+
Returns: `void`
|
|
190
|
+
|
|
191
|
+
### `on()` / `off()`
|
|
192
|
+
|
|
193
|
+
Registers and removes event listeners. See [Voice events](https://mastra.ai/reference/voice/voice.events) for the shared event API.
|
|
194
|
+
|
|
195
|
+
## Events
|
|
196
|
+
|
|
197
|
+
`NovaSonicVoice` emits the following events:
|
|
198
|
+
|
|
199
|
+
**speaking** (`event`): Assistant audio chunk. Callback receives { audioData: Int16Array, sampleRate?: number }.
|
|
200
|
+
|
|
201
|
+
**writing** (`event`): Transcribed text from the user or assistant. Callback receives { text: string, role: 'assistant' | 'user', generationStage?: 'SPECULATIVE' | 'FINAL' }.
|
|
202
|
+
|
|
203
|
+
**toolCall** (`event`): Model requested a tool call. Callback receives { name: string, args: Record\<string, any>, id: string }.
|
|
204
|
+
|
|
205
|
+
**interrupt** (`event`): User or model interrupted the current turn. Callback receives { type: 'user' | 'model', timestamp: number }.
|
|
206
|
+
|
|
207
|
+
**turnComplete** (`event`): Model finished its turn. Callback receives { timestamp: number }.
|
|
208
|
+
|
|
209
|
+
**session** (`event`): Session state transition. Callback receives { state: 'connecting' | 'connected' | 'disconnected' | 'disconnecting' | 'error' }.
|
|
210
|
+
|
|
211
|
+
**usage** (`event`): Token usage for the turn. Callback receives { inputTokens: number, outputTokens: number, totalTokens: number }.
|
|
212
|
+
|
|
213
|
+
**error** (`event`): Stream or provider error. Callback receives { message: string, code?: string, details?: unknown }.
|
|
214
|
+
|
|
215
|
+
`generationStage` distinguishes provisional transcripts (`'SPECULATIVE'`) from finalized ones (`'FINAL'`). Use `'FINAL'` text for persistent storage and `'SPECULATIVE'` text for live captions.
|
|
216
|
+
|
|
217
|
+
## Available voices
|
|
218
|
+
|
|
219
|
+
Nova 2 Sonic ships voices in ten locales. Tiffany and Matthew are polyglot and can speak any supported language.
|
|
220
|
+
|
|
221
|
+
| Voice ID | Name | Language | Locale | Gender | Polyglot |
|
|
222
|
+
| ---------- | -------- | ---------- | ------ | --------- | -------- |
|
|
223
|
+
| `tiffany` | Tiffany | English | en-US | feminine | yes |
|
|
224
|
+
| `matthew` | Matthew | English | en-US | masculine | yes |
|
|
225
|
+
| `amy` | Amy | English | en-GB | feminine | no |
|
|
226
|
+
| `olivia` | Olivia | English | en-AU | feminine | no |
|
|
227
|
+
| `kiara` | Kiara | English | en-IN | feminine | no |
|
|
228
|
+
| `arjun` | Arjun | English | en-IN | masculine | no |
|
|
229
|
+
| `ambre` | Ambre | French | fr-FR | feminine | no |
|
|
230
|
+
| `florian` | Florian | French | fr-FR | masculine | no |
|
|
231
|
+
| `beatrice` | Beatrice | Italian | it-IT | feminine | no |
|
|
232
|
+
| `lorenzo` | Lorenzo | Italian | it-IT | masculine | no |
|
|
233
|
+
| `tina` | Tina | German | de-DE | feminine | no |
|
|
234
|
+
| `lennart` | Lennart | German | de-DE | masculine | no |
|
|
235
|
+
| `lupe` | Lupe | Spanish | es-US | feminine | no |
|
|
236
|
+
| `carlos` | Carlos | Spanish | es-US | masculine | no |
|
|
237
|
+
| `carolina` | Carolina | Portuguese | pt-BR | feminine | no |
|
|
238
|
+
| `leo` | Leo | Portuguese | pt-BR | masculine | no |
|
|
239
|
+
| `kiara` | Kiara | Hindi | hi-IN | feminine | no |
|
|
240
|
+
| `arjun` | Arjun | Hindi | hi-IN | masculine | no |
|
|
241
|
+
|
|
242
|
+
## Notes
|
|
243
|
+
|
|
244
|
+
- Audio is streamed as 16-bit PCM. Assistant audio is emitted as `Int16Array` on the `speaking` event.
|
|
245
|
+
- The voice instance must call `connect()` before any other streaming method.
|
|
246
|
+
- `close()` destroys the underlying `BedrockRuntimeClient` to release the HTTP/2 session.
|
|
247
|
+
- Nova 2 Sonic is available in `us-east-1`, `us-west-2`, and `ap-northeast-1`. Other regions throw a configuration error during construction.
|
|
@@ -78,6 +78,6 @@ Returns an array of available voice options, where each node contains:
|
|
|
78
78
|
|
|
79
79
|
If you need speech-to-text capabilities in addition to text-to-speech, consider using one of these providers:
|
|
80
80
|
|
|
81
|
-
- [OpenAI](https://mastra.ai/reference/voice/openai)
|
|
82
|
-
- [Google](https://mastra.ai/reference/voice/google)
|
|
83
|
-
- [Azure](https://mastra.ai/reference/voice/azure)
|
|
81
|
+
- [OpenAI](https://mastra.ai/reference/voice/openai): Provides both TTS and STT
|
|
82
|
+
- [Google](https://mastra.ai/reference/voice/google): Provides both TTS and STT
|
|
83
|
+
- [Azure](https://mastra.ai/reference/voice/azure): Provides both TTS and STT
|