@mastra/mcp-docs-server 1.1.8 → 1.1.9-alpha.0
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/agent-memory.md +2 -2
- package/.docs/docs/agents/guardrails.md +3 -3
- package/.docs/docs/agents/network-approval.md +4 -1
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +1 -1
- package/.docs/docs/agents/processors.md +35 -17
- package/.docs/docs/agents/structured-output.md +1 -1
- package/.docs/docs/agents/using-tools.md +2 -2
- package/.docs/docs/build-with-ai/mcp-docs-server.md +4 -4
- package/.docs/docs/build-with-ai/skills.md +1 -1
- package/.docs/docs/community/discord.md +1 -1
- package/.docs/docs/community/licensing.md +1 -1
- package/.docs/docs/deployment/mastra-server.md +1 -1
- package/.docs/docs/deployment/studio.md +2 -2
- package/.docs/docs/deployment/web-framework.md +1 -1
- package/.docs/docs/evals/overview.md +1 -1
- package/.docs/docs/getting-started/build-with-ai.md +1 -1
- package/.docs/docs/getting-started/project-structure.md +1 -1
- package/.docs/docs/index.md +62 -16
- package/.docs/docs/mastra-cloud/deployment.md +1 -1
- package/.docs/docs/mastra-cloud/studio.md +1 -1
- package/.docs/docs/mcp/publishing-mcp-server.md +1 -1
- package/.docs/docs/memory/memory-processors.md +1 -1
- package/.docs/docs/memory/message-history.md +2 -2
- package/.docs/docs/memory/observational-memory.md +6 -2
- package/.docs/docs/memory/semantic-recall.md +2 -2
- package/.docs/docs/memory/storage.md +1 -1
- package/.docs/docs/memory/working-memory.md +6 -6
- package/.docs/docs/observability/tracing/bridges/otel.md +2 -2
- package/.docs/docs/observability/tracing/exporters/default.md +1 -1
- package/.docs/docs/observability/tracing/overview.md +4 -4
- package/.docs/docs/observability/tracing/processors/sensitive-data-filter.md +2 -2
- package/.docs/docs/rag/chunking-and-embedding.md +1 -1
- package/.docs/docs/rag/vector-databases.md +2 -2
- package/.docs/docs/server/auth/auth0.md +1 -1
- package/.docs/docs/server/auth/firebase.md +1 -1
- package/.docs/docs/server/auth/simple-auth.md +1 -1
- package/.docs/docs/server/auth.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/mastra-server.md +1 -1
- package/.docs/docs/server/server-adapters.md +2 -2
- package/.docs/docs/streaming/events.md +1 -1
- package/.docs/docs/streaming/overview.md +1 -1
- package/.docs/docs/streaming/tool-streaming.md +44 -30
- package/.docs/docs/streaming/workflow-streaming.md +1 -1
- package/.docs/docs/workflows/control-flow.md +44 -2
- package/.docs/docs/workflows/error-handling.md +1 -1
- package/.docs/docs/workflows/overview.md +3 -3
- package/.docs/docs/workflows/snapshots.md +1 -1
- package/.docs/docs/workflows/time-travel.md +2 -2
- package/.docs/docs/workspace/filesystem.md +2 -2
- package/.docs/docs/workspace/overview.md +52 -7
- package/.docs/docs/workspace/sandbox.md +72 -13
- package/.docs/docs/workspace/skills.md +2 -2
- package/.docs/guides/build-your-ui/copilotkit.md +1 -1
- package/.docs/guides/deployment/inngest.md +4 -4
- package/.docs/guides/guide/ai-recruiter.md +1 -1
- package/.docs/guides/guide/github-actions-pr-description.md +2 -2
- package/.docs/guides/guide/notes-mcp-server.md +1 -1
- package/.docs/guides/guide/stock-agent.md +2 -2
- package/.docs/guides/migrations/agentnetwork.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/client.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/deployment.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/memory.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/storage.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/tools.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/workflows.md +5 -5
- package/.docs/guides/migrations/vnext-to-standard-apis.md +2 -2
- package/.docs/models/gateways/netlify.md +1 -2
- package/.docs/models/gateways/openrouter.md +8 -1
- package/.docs/models/gateways/vercel.md +3 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/abacus.md +21 -11
- package/.docs/models/providers/aihubmix.md +7 -2
- package/.docs/models/providers/alibaba-cn.md +80 -71
- package/.docs/models/providers/alibaba-coding-plan-cn.md +78 -0
- package/.docs/models/providers/alibaba-coding-plan.md +78 -0
- package/.docs/models/providers/chutes.md +1 -1
- package/.docs/models/providers/clarifai.md +81 -0
- package/.docs/models/providers/cloudferro-sherlock.md +5 -4
- package/.docs/models/providers/cloudflare-workers-ai.md +3 -2
- package/.docs/models/providers/cortecs.md +7 -5
- package/.docs/models/providers/deepinfra.md +7 -2
- package/.docs/models/providers/deepseek.md +1 -1
- package/.docs/models/providers/drun.md +73 -0
- package/.docs/models/providers/firmware.md +28 -20
- package/.docs/models/providers/google.md +3 -1
- package/.docs/models/providers/inception.md +4 -2
- package/.docs/models/providers/kilo.md +3 -1
- package/.docs/models/providers/nano-gpt.md +519 -40
- package/.docs/models/providers/nebius.md +34 -34
- package/.docs/models/providers/nvidia.md +4 -2
- package/.docs/models/providers/ollama-cloud.md +1 -2
- package/.docs/models/providers/openai.md +3 -1
- package/.docs/models/providers/opencode.md +36 -33
- package/.docs/models/providers/poe.md +8 -2
- package/.docs/models/providers/qiniu-ai.md +20 -5
- package/.docs/models/providers/requesty.md +17 -1
- package/.docs/models/providers/siliconflow-cn.md +7 -1
- package/.docs/models/providers/togetherai.md +1 -3
- package/.docs/models/providers/xai.md +28 -25
- package/.docs/models/providers/xiaomi.md +1 -1
- package/.docs/models/providers/zenmux.md +3 -1
- package/.docs/models/providers.md +4 -0
- package/.docs/reference/agents/getDefaultGenerateOptions.md +1 -1
- package/.docs/reference/agents/getDefaultOptions.md +1 -1
- package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
- package/.docs/reference/agents/getDescription.md +1 -1
- package/.docs/reference/agents/network.md +3 -1
- package/.docs/reference/ai-sdk/handle-chat-stream.md +2 -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-v4-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
- package/.docs/reference/auth/auth0.md +3 -3
- package/.docs/reference/auth/firebase.md +1 -1
- package/.docs/reference/auth/workos.md +2 -2
- package/.docs/reference/cli/mastra.md +4 -4
- package/.docs/reference/client-js/mastra-client.md +1 -1
- package/.docs/reference/configuration.md +62 -6
- package/.docs/reference/core/getDeployer.md +1 -1
- package/.docs/reference/core/getLogger.md +1 -1
- package/.docs/reference/core/getScorer.md +2 -2
- package/.docs/reference/core/getServer.md +1 -1
- package/.docs/reference/core/getStorage.md +1 -1
- package/.docs/reference/core/getStoredAgentById.md +1 -1
- package/.docs/reference/core/getTelemetry.md +1 -1
- package/.docs/reference/core/getWorkflow.md +1 -1
- package/.docs/reference/core/listAgents.md +1 -1
- package/.docs/reference/core/listMCPServers.md +1 -1
- package/.docs/reference/core/listStoredAgents.md +1 -1
- package/.docs/reference/core/listVectors.md +1 -1
- package/.docs/reference/core/mastra-class.md +1 -1
- package/.docs/reference/core/setLogger.md +1 -1
- package/.docs/reference/core/setStorage.md +1 -1
- package/.docs/reference/datasets/dataset.md +1 -1
- package/.docs/reference/datasets/datasets-manager.md +1 -1
- package/.docs/reference/datasets/get.md +2 -2
- package/.docs/reference/datasets/getDetails.md +1 -1
- package/.docs/reference/datasets/listItems.md +1 -1
- package/.docs/reference/deployer/vercel.md +1 -1
- package/.docs/reference/evals/answer-relevancy.md +1 -1
- package/.docs/reference/evals/completeness.md +1 -1
- package/.docs/reference/evals/context-precision.md +3 -3
- package/.docs/reference/evals/context-relevance.md +1 -1
- package/.docs/reference/evals/hallucination.md +3 -9
- package/.docs/reference/evals/keyword-coverage.md +1 -1
- package/.docs/reference/evals/mastra-scorer.md +1 -1
- package/.docs/reference/evals/noise-sensitivity.md +2 -2
- package/.docs/reference/evals/textual-difference.md +1 -1
- package/.docs/reference/evals/tone-consistency.md +1 -1
- package/.docs/reference/evals/tool-call-accuracy.md +1 -1
- package/.docs/reference/harness/harness-class.md +4 -2
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/memory/cloneThread.md +1 -1
- package/.docs/reference/memory/observational-memory.md +7 -5
- package/.docs/reference/observability/tracing/bridges/otel.md +1 -1
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +1 -1
- package/.docs/reference/observability/tracing/spans.md +2 -0
- package/.docs/reference/processors/message-history-processor.md +1 -1
- package/.docs/reference/processors/processor-interface.md +6 -2
- package/.docs/reference/processors/token-limiter-processor.md +2 -2
- package/.docs/reference/rag/metadata-filters.md +10 -10
- package/.docs/reference/server/create-route.md +2 -0
- package/.docs/reference/server/koa-adapter.md +1 -1
- package/.docs/reference/server/register-api-route.md +2 -2
- package/.docs/reference/storage/cloudflare-d1.md +3 -3
- package/.docs/reference/storage/cloudflare.md +1 -1
- package/.docs/reference/storage/convex.md +1 -1
- package/.docs/reference/storage/dynamodb.md +2 -2
- package/.docs/reference/storage/lance.md +2 -2
- package/.docs/reference/storage/mongodb.md +1 -1
- package/.docs/reference/storage/mssql.md +1 -1
- package/.docs/reference/storage/postgresql.md +2 -2
- package/.docs/reference/storage/upstash.md +1 -1
- package/.docs/reference/streaming/workflows/observeStream.md +1 -1
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/create-tool.md +1 -1
- package/.docs/reference/tools/mcp-server.md +4 -4
- package/.docs/reference/vectors/chroma.md +2 -2
- package/.docs/reference/vectors/couchbase.md +6 -6
- package/.docs/reference/vectors/pg.md +2 -0
- package/.docs/reference/vectors/s3vectors.md +5 -5
- package/.docs/reference/voice/azure.md +4 -2
- package/.docs/reference/voice/cloudflare.md +4 -2
- package/.docs/reference/voice/elevenlabs.md +1 -1
- package/.docs/reference/voice/google-gemini-live.md +2 -2
- package/.docs/reference/voice/google.md +3 -3
- package/.docs/reference/voice/mastra-voice.md +1 -1
- package/.docs/reference/voice/murf.md +2 -2
- package/.docs/reference/voice/openai-realtime.md +3 -1
- package/.docs/reference/voice/openai.md +7 -3
- package/.docs/reference/voice/playai.md +4 -2
- package/.docs/reference/voice/sarvam.md +3 -1
- package/.docs/reference/voice/speechify.md +6 -4
- package/.docs/reference/voice/voice.addInstructions.md +2 -2
- package/.docs/reference/voice/voice.addTools.md +1 -1
- package/.docs/reference/voice/voice.close.md +2 -2
- package/.docs/reference/voice/voice.connect.md +4 -2
- package/.docs/reference/voice/voice.events.md +2 -2
- package/.docs/reference/voice/voice.getSpeakers.md +1 -1
- package/.docs/reference/voice/voice.listen.md +11 -5
- package/.docs/reference/voice/voice.off.md +2 -2
- package/.docs/reference/voice/voice.on.md +2 -2
- package/.docs/reference/voice/voice.speak.md +14 -4
- package/.docs/reference/voice/voice.updateConfig.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workspace/blaxel-sandbox.md +164 -0
- package/.docs/reference/workspace/daytona-sandbox.md +48 -139
- package/.docs/reference/workspace/e2b-sandbox.md +39 -75
- package/.docs/reference/workspace/filesystem.md +24 -10
- package/.docs/reference/workspace/gcs-filesystem.md +20 -0
- package/.docs/reference/workspace/local-filesystem.md +23 -9
- package/.docs/reference/workspace/local-sandbox.md +23 -98
- package/.docs/reference/workspace/process-manager.md +296 -0
- package/.docs/reference/workspace/s3-filesystem.md +20 -0
- package/.docs/reference/workspace/sandbox.md +9 -1
- package/.docs/reference/workspace/workspace-class.md +93 -25
- package/CHANGELOG.md +8 -0
- package/dist/tools/course.d.ts +7 -27
- package/dist/tools/course.d.ts.map +1 -1
- package/dist/tools/docs.d.ts +6 -18
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/embedded-docs.d.ts +12 -112
- package/dist/tools/embedded-docs.d.ts.map +1 -1
- package/dist/tools/migration.d.ts +6 -26
- package/dist/tools/migration.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -85,7 +85,7 @@ Creates a new vector index in Couchbase.
|
|
|
85
85
|
|
|
86
86
|
Adds or updates vectors and their metadata in the collection.
|
|
87
87
|
|
|
88
|
-
> **Note:** You can upsert data before or after creating the index. The `upsert` method
|
|
88
|
+
> **Note:** You can upsert data before or after creating the index. The `upsert` method doesn't require the index to exist. Couchbase allows multiple Search indexes over the same collection.
|
|
89
89
|
|
|
90
90
|
**indexName** (`string`): Name of the index to insert into
|
|
91
91
|
|
|
@@ -99,7 +99,7 @@ Adds or updates vectors and their metadata in the collection.
|
|
|
99
99
|
|
|
100
100
|
Searches for similar vectors.
|
|
101
101
|
|
|
102
|
-
> **Warning:** The `filter` and `includeVector` parameters
|
|
102
|
+
> **Warning:** The `filter` and `includeVector` parameters aren't currently supported. Filtering must be performed client-side after retrieving results, or by using the Couchbase SDK's Search capabilities directly. To retrieve the vector embedding, fetch the full document by ID using the Couchbase SDK.
|
|
103
103
|
|
|
104
104
|
**indexName** (`string`): Name of the index to search in
|
|
105
105
|
|
|
@@ -143,7 +143,7 @@ Returns: `Promise<string[]>`
|
|
|
143
143
|
|
|
144
144
|
### updateVector()
|
|
145
145
|
|
|
146
|
-
Updates a specific vector entry by its ID with new vector data and/or metadata. **Note:** Filter-based updates
|
|
146
|
+
Updates a specific vector entry by its ID with new vector data and/or metadata. **Note:** Filter-based updates aren't yet implemented for Couchbase.
|
|
147
147
|
|
|
148
148
|
**indexName** (`string`): Name of the index containing the vector
|
|
149
149
|
|
|
@@ -161,7 +161,7 @@ Deletes a single vector by its ID from the index.
|
|
|
161
161
|
|
|
162
162
|
### deleteVectors()
|
|
163
163
|
|
|
164
|
-
Deletes multiple vectors by their IDs. **Note:** Filter-based deletion
|
|
164
|
+
Deletes multiple vectors by their IDs. **Note:** Filter-based deletion isn't yet implemented for Couchbase.
|
|
165
165
|
|
|
166
166
|
**indexName** (`string`): Name of the index containing the vectors to delete
|
|
167
167
|
|
|
@@ -210,7 +210,7 @@ try {
|
|
|
210
210
|
|
|
211
211
|
## Notes
|
|
212
212
|
|
|
213
|
-
- **Index Deletion Caveat:** Deleting a Search index
|
|
213
|
+
- **Index Deletion Caveat:** Deleting a Search index doesn't delete the vectors/documents in the associated Couchbase collection. Data remains unless explicitly removed.
|
|
214
214
|
- **Required Permissions:** The Couchbase user must have permissions to connect, read/write documents in the target collection (`kv` role), and manage Search Indexes (`search_admin` role on the relevant bucket/scope).
|
|
215
215
|
- **Index Definition Details & Document Structure:** The `createIndex` method constructs a Search Index definition that indexes the `embedding` field (as type `vector`) and the `content` field (as type `text`), targeting documents within the specified `scopeName.collectionName`. Each document stores the vector in the `embedding` field and metadata in the `metadata` field. If `metadata` contains a `text` property, its value is also copied to a top-level `content` field, which is indexed for text search.
|
|
216
216
|
- **Replication & Durability:** Consider using Couchbase's built-in replication and persistence features for data durability. Monitor index statistics regularly to ensure efficient search.
|
|
@@ -219,7 +219,7 @@ try {
|
|
|
219
219
|
|
|
220
220
|
- Index creation delays may impact immediate querying after creation.
|
|
221
221
|
- No hard enforcement of vector dimension at ingest time (dimension mismatches will error at query time).
|
|
222
|
-
- Vector insertion and index updates are eventually consistent; strong consistency
|
|
222
|
+
- Vector insertion and index updates are eventually consistent; strong consistency isn't guaranteed immediately after writes.
|
|
223
223
|
|
|
224
224
|
## Related
|
|
225
225
|
|
|
@@ -82,6 +82,8 @@ const vectorStore = new PgVector({
|
|
|
82
82
|
|
|
83
83
|
**buildIndex** (`boolean`): Whether to build the index (Default: `true`)
|
|
84
84
|
|
|
85
|
+
**metadataIndexes** (`string[]`): Array of metadata field names to create btree indexes on. Improves query performance when filtering by these metadata fields.
|
|
86
|
+
|
|
85
87
|
#### IndexConfig
|
|
86
88
|
|
|
87
89
|
**type** (`'flat' | 'hnsw' | 'ivfflat'`): Index type (Default: `ivfflat`)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The `S3Vectors` class provides vector search using [Amazon S3 Vectors (Preview)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors.html). It stores vectors in **vector buckets** and performs similarity search in **vector indexes**, with JSON-based metadata filters.
|
|
4
4
|
|
|
5
|
-
> **Warning:** Amazon S3 Vectors is a Preview service. Preview features may change or be removed without notice and
|
|
5
|
+
> **Warning:** Amazon S3 Vectors is a Preview service. Preview features may change or be removed without notice and aren't covered by AWS SLAs. Behavior, limits, and regional availability can change at any time. This library may introduce breaking changes to stay aligned with AWS.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -104,7 +104,7 @@ Creates a new vector index in the configured vector bucket. If the index already
|
|
|
104
104
|
|
|
105
105
|
### upsert()
|
|
106
106
|
|
|
107
|
-
Adds or replaces vectors (full-record put). If `ids`
|
|
107
|
+
Adds or replaces vectors (full-record put). If `ids` aren't provided, UUIDs are generated.
|
|
108
108
|
|
|
109
109
|
**indexName** (`string`): Name of the index to upsert into
|
|
110
110
|
|
|
@@ -204,7 +204,7 @@ S3 Vectors supports a strict subset of operators and value types. The Mastra fil
|
|
|
204
204
|
- **Canonicalizes implicit AND**: `{a:1,b:2}` → `{ $and: [{a:1},{b:2}] }`.
|
|
205
205
|
- **Normalizes Date values** to epoch ms for numeric comparisons and array elements.
|
|
206
206
|
- **Disallows Date** in equality positions (`field: value` or `$eq/$ne`); equality values must be **string | number | boolean**.
|
|
207
|
-
- **Rejects** null/undefined for equality; **array equality**
|
|
207
|
+
- **Rejects** null/undefined for equality; **array equality** isn't supported (use `$in`/`$nin`).
|
|
208
208
|
- Only **`$and` / `$or`** are allowed as top-level logical operators.
|
|
209
209
|
- Logical operators must contain **field conditions** (not direct operators).
|
|
210
210
|
|
|
@@ -236,7 +236,7 @@ S3 Vectors supports a strict subset of operators and value types. The Mastra fil
|
|
|
236
236
|
{ timestamp: { $gt: new Date("2024-01-01T00:00:00Z") } }
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
> **Note:** If you set `nonFilterableMetadataKeys` at index creation, those keys are stored but **
|
|
239
|
+
> **Note:** If you set `nonFilterableMetadataKeys` at index creation, those keys are stored but **can't** be used in filters.
|
|
240
240
|
|
|
241
241
|
## Error Handling
|
|
242
242
|
|
|
@@ -266,7 +266,7 @@ Typical environment variables when wiring your app:
|
|
|
266
266
|
|
|
267
267
|
## Best Practices
|
|
268
268
|
|
|
269
|
-
- Choose the metric (`cosine` or `euclidean`) to match your embedding model; `dotproduct`
|
|
269
|
+
- Choose the metric (`cosine` or `euclidean`) to match your embedding model; `dotproduct` isn't supported.
|
|
270
270
|
- Keep **filterable** metadata small and structured (string/number/boolean). Store large text (e.g., `content`) as **non-filterable**.
|
|
271
271
|
- Use **dotted paths** for nested metadata and explicit `$and`/`$or` for complex logic.
|
|
272
272
|
- Avoid calling `describeIndex()` on hot paths—`count` is computed with paginated `ListVectors` (**O(n)**).
|
|
@@ -67,7 +67,9 @@ Converts text to speech using Azure's neural text-to-speech service.
|
|
|
67
67
|
|
|
68
68
|
**input** (`string | NodeJS.ReadableStream`): Text or text stream to convert to speech.
|
|
69
69
|
|
|
70
|
-
**options
|
|
70
|
+
**options** (`Options`): Configuration options.
|
|
71
|
+
|
|
72
|
+
**options.speaker** (`string`): Voice ID to use for speech synthesis (e.g., 'en-US-JennyNeural'). Overrides the default voice.
|
|
71
73
|
|
|
72
74
|
Returns: `Promise<NodeJS.ReadableStream>` - Audio stream in WAV format
|
|
73
75
|
|
|
@@ -99,7 +101,7 @@ Returns: `Promise<Array<{ voiceId: string; language: string; region: string; }>>
|
|
|
99
101
|
|
|
100
102
|
**⚠️ Critical:** This package uses **Azure Speech Services**, which is different from **Azure OpenAI Services**.
|
|
101
103
|
|
|
102
|
-
- **
|
|
104
|
+
- **DON'T** use your `AZURE_OPENAI_API_KEY` for this package
|
|
103
105
|
- **DO** use an Azure Speech Services subscription key (obtain from Azure Portal under "Speech Services")
|
|
104
106
|
- These are separate Azure resources with different API keys and endpoints
|
|
105
107
|
|
|
@@ -49,9 +49,11 @@ Converts text to speech using Cloudflare's text-to-speech service.
|
|
|
49
49
|
|
|
50
50
|
**input** (`string | NodeJS.ReadableStream`): Text or text stream to convert to speech.
|
|
51
51
|
|
|
52
|
-
**options
|
|
52
|
+
**options** (`Options`): Configuration options.
|
|
53
53
|
|
|
54
|
-
**options.
|
|
54
|
+
**options.speaker** (`string`): Voice ID to use for speech synthesis.
|
|
55
|
+
|
|
56
|
+
**options.format** (`string`): Output audio format.
|
|
55
57
|
|
|
56
58
|
Returns: `Promise<NodeJS.ReadableStream>`
|
|
57
59
|
|
|
@@ -92,5 +92,5 @@ Returns: `Promise<string>` - A Promise that resolves to the transcribed text
|
|
|
92
92
|
|
|
93
93
|
1. An ElevenLabs API key is required. Set it via the `ELEVENLABS_API_KEY` environment variable or pass it in the constructor.
|
|
94
94
|
2. The default speaker is set to Aria (ID: '9BWtsMINqrJLrRacOk9x').
|
|
95
|
-
3. Speech-to-text functionality
|
|
95
|
+
3. Speech-to-text functionality isn't supported by ElevenLabs.
|
|
96
96
|
4. Available speakers can be retrieved using the `getSpeakers()` method, which returns detailed information about each voice including language and gender.
|
|
@@ -138,11 +138,11 @@ Converts text to speech and sends it to the model. Can accept either a string or
|
|
|
138
138
|
|
|
139
139
|
**options** (`GeminiLiveVoiceOptions`): Optional speech configuration.
|
|
140
140
|
|
|
141
|
-
**options.speaker** (`GeminiVoiceName`): Voice ID to use for this specific speech request.
|
|
141
|
+
**options.speaker** (`GeminiVoiceName`): Voice ID to use for this specific speech request.
|
|
142
142
|
|
|
143
143
|
**options.languageCode** (`string`): Language code for the response.
|
|
144
144
|
|
|
145
|
-
**options.responseModalities** (`('AUDIO' | 'TEXT')[]`): Response modalities to receive from the model.
|
|
145
|
+
**options.responseModalities** (`('AUDIO' | 'TEXT')[]`): Response modalities to receive from the model.
|
|
146
146
|
|
|
147
147
|
Returns: `Promise<void>` (responses are emitted via `speaker` and `writing` events)
|
|
148
148
|
|
|
@@ -70,7 +70,7 @@ Converts text to speech using Google Cloud Text-to-Speech service.
|
|
|
70
70
|
|
|
71
71
|
**options.languageCode** (`string`): Language code for the voice (e.g., 'en-US'). Defaults to the language code from the speaker ID or 'en-US'
|
|
72
72
|
|
|
73
|
-
**options.audioConfig** (`ISynthesizeSpeechRequest['audioConfig']`): Audio configuration options from Google Cloud Text-to-Speech API
|
|
73
|
+
**options.audioConfig** (`ISynthesizeSpeechRequest['audioConfig']`): Audio configuration options from Google Cloud Text-to-Speech API
|
|
74
74
|
|
|
75
75
|
Returns: `Promise<NodeJS.ReadableStream>`
|
|
76
76
|
|
|
@@ -84,7 +84,7 @@ Converts speech to text using Google Cloud Speech-to-Text service.
|
|
|
84
84
|
|
|
85
85
|
**options.stream** (`boolean`): Whether to use streaming recognition
|
|
86
86
|
|
|
87
|
-
**options.config** (`IRecognitionConfig`): Recognition configuration from Google Cloud Speech-to-Text API
|
|
87
|
+
**options.config** (`IRecognitionConfig`): Recognition configuration from Google Cloud Speech-to-Text API
|
|
88
88
|
|
|
89
89
|
Returns: `Promise<string>`
|
|
90
90
|
|
|
@@ -120,7 +120,7 @@ The Google Voice provider supports two authentication methods:
|
|
|
120
120
|
|
|
121
121
|
### Standard Mode (API Key)
|
|
122
122
|
|
|
123
|
-
Uses a Google Cloud API key for authentication. Suitable for development and
|
|
123
|
+
Uses a Google Cloud API key for authentication. Suitable for development and basic use cases.
|
|
124
124
|
|
|
125
125
|
```typescript
|
|
126
126
|
// Using environment variable (GOOGLE_API_KEY)
|
|
@@ -303,7 +303,7 @@ MastraVoice includes built-in telemetry support through the `traced` method, whi
|
|
|
303
303
|
|
|
304
304
|
## Notes
|
|
305
305
|
|
|
306
|
-
- MastraVoice is an abstract class and
|
|
306
|
+
- MastraVoice is an abstract class and can't be instantiated directly
|
|
307
307
|
- Implementations must provide concrete implementations for all abstract methods
|
|
308
308
|
- The class provides a consistent interface across different voice service providers
|
|
309
309
|
- Speech-to-speech capabilities are optional and provider-specific
|
|
@@ -107,7 +107,7 @@ Returns an array of available voice options, where each node contains:
|
|
|
107
107
|
|
|
108
108
|
### listen()
|
|
109
109
|
|
|
110
|
-
This method
|
|
110
|
+
This method isn't supported by Murf and will throw an error. Murf doesn't provide speech-to-text functionality.
|
|
111
111
|
|
|
112
112
|
## Important Notes
|
|
113
113
|
|
|
@@ -115,4 +115,4 @@ This method is not supported by Murf and will throw an error. Murf does not prov
|
|
|
115
115
|
2. The service uses GEN2 as the default model version.
|
|
116
116
|
3. Speech properties can be set at the constructor level and overridden per request.
|
|
117
117
|
4. The service supports extensive audio customization through properties like format, sample rate, and channel type.
|
|
118
|
-
5. Speech-to-text functionality
|
|
118
|
+
5. Speech-to-text functionality isn't supported.
|
|
@@ -87,7 +87,9 @@ Emits a speaking event using the configured voice model. Can accept either a str
|
|
|
87
87
|
|
|
88
88
|
**input** (`string | NodeJS.ReadableStream`): Text or text stream to convert to speech.
|
|
89
89
|
|
|
90
|
-
**options
|
|
90
|
+
**options** (`Options`): Configuration options.
|
|
91
|
+
|
|
92
|
+
**options.speaker** (`string`): Voice ID to use for this specific speech request.
|
|
91
93
|
|
|
92
94
|
Returns: `Promise<void>`
|
|
93
95
|
|
|
@@ -61,9 +61,11 @@ Converts text to speech using OpenAI's text-to-speech models.
|
|
|
61
61
|
|
|
62
62
|
**input** (`string | NodeJS.ReadableStream`): Text or text stream to convert to speech.
|
|
63
63
|
|
|
64
|
-
**options
|
|
64
|
+
**options** (`Options`): Configuration options.
|
|
65
65
|
|
|
66
|
-
**options.
|
|
66
|
+
**options.speaker** (`OpenAIVoiceId`): Voice ID to use for speech synthesis.
|
|
67
|
+
|
|
68
|
+
**options.speed** (`number`): Speech speed multiplier.
|
|
67
69
|
|
|
68
70
|
Returns: `Promise<NodeJS.ReadableStream>`
|
|
69
71
|
|
|
@@ -73,7 +75,9 @@ Transcribes audio using OpenAI's Whisper model.
|
|
|
73
75
|
|
|
74
76
|
**audioStream** (`NodeJS.ReadableStream`): Audio stream to transcribe.
|
|
75
77
|
|
|
76
|
-
**options
|
|
78
|
+
**options** (`Options`): Configuration options.
|
|
79
|
+
|
|
80
|
+
**options.filetype** (`string`): Audio format of the input stream.
|
|
77
81
|
|
|
78
82
|
Returns: `Promise<string>`
|
|
79
83
|
|
|
@@ -47,7 +47,9 @@ Converts text to speech using the configured speech model and voice.
|
|
|
47
47
|
|
|
48
48
|
**input** (`string | NodeJS.ReadableStream`): Text to convert to speech. If a stream is provided, it will be converted to text first.
|
|
49
49
|
|
|
50
|
-
**options
|
|
50
|
+
**options** (`Options`): Configuration options.
|
|
51
|
+
|
|
52
|
+
**options.speaker** (`string`): Override the default speaker for this request
|
|
51
53
|
|
|
52
54
|
Returns: `Promise<NodeJS.ReadableStream>`.
|
|
53
55
|
|
|
@@ -69,7 +71,7 @@ Returns an array of available voice options, where each node contains:
|
|
|
69
71
|
|
|
70
72
|
### listen()
|
|
71
73
|
|
|
72
|
-
This method
|
|
74
|
+
This method isn't supported by PlayAI and will throw an error. PlayAI doesn't provide speech-to-text functionality.
|
|
73
75
|
|
|
74
76
|
## Notes
|
|
75
77
|
|
|
@@ -93,7 +93,9 @@ Converts text to speech using Sarvam's text-to-speech models.
|
|
|
93
93
|
|
|
94
94
|
**input** (`string | NodeJS.ReadableStream`): Text or text stream to convert to speech.
|
|
95
95
|
|
|
96
|
-
**options
|
|
96
|
+
**options** (`Options`): Configuration options.
|
|
97
|
+
|
|
98
|
+
**options.speaker** (`SarvamVoiceId`): Voice ID to use for speech synthesis.
|
|
97
99
|
|
|
98
100
|
Returns: `Promise<NodeJS.ReadableStream>`
|
|
99
101
|
|
|
@@ -43,9 +43,11 @@ Converts text to speech using the configured speech model and voice.
|
|
|
43
43
|
|
|
44
44
|
**input** (`string | NodeJS.ReadableStream`): Text to convert to speech. If a stream is provided, it will be converted to text first.
|
|
45
45
|
|
|
46
|
-
**options
|
|
46
|
+
**options** (`Options`): Configuration options.
|
|
47
47
|
|
|
48
|
-
**options.
|
|
48
|
+
**options.speaker** (`string`): Override the default speaker for this request
|
|
49
|
+
|
|
50
|
+
**options.model** (`VoiceModelName`): Override the default model for this request
|
|
49
51
|
|
|
50
52
|
Returns: `Promise<NodeJS.ReadableStream>`
|
|
51
53
|
|
|
@@ -63,11 +65,11 @@ Returns an array of available voice options, where each node contains:
|
|
|
63
65
|
|
|
64
66
|
### listen()
|
|
65
67
|
|
|
66
|
-
This method
|
|
68
|
+
This method isn't supported by Speechify and will throw an error. Speechify doesn't provide speech-to-text functionality.
|
|
67
69
|
|
|
68
70
|
## Notes
|
|
69
71
|
|
|
70
72
|
- Speechify requires an API key for authentication
|
|
71
73
|
- The default model is 'simba-english'
|
|
72
|
-
- Speech-to-text functionality
|
|
74
|
+
- Speech-to-text functionality isn't supported
|
|
73
75
|
- Additional audio stream options can be passed through the speak() method's options parameter
|
|
@@ -43,11 +43,11 @@ await voice.connect()
|
|
|
43
43
|
|
|
44
44
|
## Return Value
|
|
45
45
|
|
|
46
|
-
This method
|
|
46
|
+
This method doesn't return a value.
|
|
47
47
|
|
|
48
48
|
## Notes
|
|
49
49
|
|
|
50
|
-
- Instructions are most effective when they
|
|
50
|
+
- Instructions are most effective when they're clear, specific, and relevant to the voice interaction
|
|
51
51
|
- This method is primarily used with real-time voice providers that maintain conversation context
|
|
52
52
|
- If called on a voice provider that doesn't support instructions, it will log a warning and do nothing
|
|
53
53
|
- Instructions added with this method are typically combined with any instructions provided by an associated Agent
|
|
@@ -36,11 +36,11 @@ setTimeout(() => {
|
|
|
36
36
|
|
|
37
37
|
## Parameters
|
|
38
38
|
|
|
39
|
-
This method
|
|
39
|
+
This method doesn't accept any parameters.
|
|
40
40
|
|
|
41
41
|
## Return Value
|
|
42
42
|
|
|
43
|
-
This method
|
|
43
|
+
This method doesn't return a value.
|
|
44
44
|
|
|
45
45
|
## Notes
|
|
46
46
|
|
|
@@ -58,9 +58,11 @@ Each real-time voice provider may support different options for the `connect()`
|
|
|
58
58
|
|
|
59
59
|
### OpenAI Realtime
|
|
60
60
|
|
|
61
|
-
**options
|
|
61
|
+
**options** (`Options`): Configuration options.
|
|
62
62
|
|
|
63
|
-
**options.
|
|
63
|
+
**options.timeout** (`number`): Connection timeout in milliseconds
|
|
64
|
+
|
|
65
|
+
**options.reconnect** (`boolean`): Whether to automatically reconnect on connection loss
|
|
64
66
|
|
|
65
67
|
## Using with CompositeVoice
|
|
66
68
|
|
|
@@ -32,6 +32,6 @@ These events are commonly implemented across real-time voice providers:
|
|
|
32
32
|
|
|
33
33
|
- Not all events are supported by all voice providers
|
|
34
34
|
- The exact payload structure may vary between providers
|
|
35
|
-
- For non-real-time providers, most of these events
|
|
35
|
+
- For non-real-time providers, most of these events won't be emitted
|
|
36
36
|
- Events are useful for building interactive UIs that respond to the conversation state
|
|
37
|
-
- Consider using the [voice.off()](https://mastra.ai/reference/voice/voice.off) method to remove event listeners when they
|
|
37
|
+
- Consider using the [voice.off()](https://mastra.ai/reference/voice/voice.off) method to remove event listeners when they're no longer needed
|
|
@@ -22,7 +22,9 @@ Each voice provider may support additional options specific to their implementat
|
|
|
22
22
|
|
|
23
23
|
### OpenAI
|
|
24
24
|
|
|
25
|
-
**options
|
|
25
|
+
**options** (`Options`): Configuration options.
|
|
26
|
+
|
|
27
|
+
**options.filetype** (`string`): Audio file format (e.g., 'mp3', 'wav', 'm4a')
|
|
26
28
|
|
|
27
29
|
**options.prompt** (`string`): Text to guide the model's transcription
|
|
28
30
|
|
|
@@ -30,15 +32,19 @@ Each voice provider may support additional options specific to their implementat
|
|
|
30
32
|
|
|
31
33
|
### Google
|
|
32
34
|
|
|
33
|
-
**options
|
|
35
|
+
**options** (`Options`): Configuration options.
|
|
36
|
+
|
|
37
|
+
**options.stream** (`boolean`): Whether to use streaming recognition
|
|
34
38
|
|
|
35
|
-
**options.config** (`object`): Recognition configuration from Google Cloud Speech-to-Text API
|
|
39
|
+
**options.config** (`object`): Recognition configuration from Google Cloud Speech-to-Text API
|
|
36
40
|
|
|
37
41
|
### Deepgram
|
|
38
42
|
|
|
39
|
-
**options
|
|
43
|
+
**options** (`Options`): Configuration options.
|
|
44
|
+
|
|
45
|
+
**options.model** (`string`): Deepgram model to use for transcription
|
|
40
46
|
|
|
41
|
-
**options.language** (`string`): Language code for transcription
|
|
47
|
+
**options.language** (`string`): Language code for transcription
|
|
42
48
|
|
|
43
49
|
## Usage Example
|
|
44
50
|
|
|
@@ -43,12 +43,12 @@ voice.off('writing', writingCallback)
|
|
|
43
43
|
|
|
44
44
|
## Return Value
|
|
45
45
|
|
|
46
|
-
This method
|
|
46
|
+
This method doesn't return a value.
|
|
47
47
|
|
|
48
48
|
## Notes
|
|
49
49
|
|
|
50
50
|
- The callback passed to `off()` must be the same function reference that was passed to `on()`
|
|
51
|
-
- If the callback
|
|
51
|
+
- If the callback isn't found, the method will have no effect
|
|
52
52
|
- This method is primarily used with real-time voice providers that support event-based communication
|
|
53
53
|
- If called on a voice provider that doesn't support events, it will log a warning and do nothing
|
|
54
54
|
- Removing event listeners is important for preventing memory leaks in long-running applications
|
|
@@ -54,7 +54,7 @@ voice.on('error', ({ message, code, details }) => {
|
|
|
54
54
|
|
|
55
55
|
## Return Value
|
|
56
56
|
|
|
57
|
-
This method
|
|
57
|
+
This method doesn't return a value.
|
|
58
58
|
|
|
59
59
|
## Events
|
|
60
60
|
|
|
@@ -108,4 +108,4 @@ voice.on('speaker', stream => {
|
|
|
108
108
|
- To remove an event listener, use the [voice.off()](https://mastra.ai/reference/voice/voice.off) method with the same event name and callback function
|
|
109
109
|
- Multiple listeners can be registered for the same event
|
|
110
110
|
- The callback function will receive different data depending on the event type (see [Voice Events](https://mastra.ai/reference/voice/voice.events))
|
|
111
|
-
- For best performance, consider removing event listeners when they
|
|
111
|
+
- For best performance, consider removing event listeners when they're no longer needed
|
|
@@ -23,22 +23,32 @@ Each voice provider may support additional options specific to their implementat
|
|
|
23
23
|
|
|
24
24
|
### OpenAI
|
|
25
25
|
|
|
26
|
-
**options
|
|
26
|
+
**options** (`Options`): Configuration options.
|
|
27
|
+
|
|
28
|
+
**options.speed** (`number`): Speech speed multiplier. Values between 0.25 and 4.0 are supported.
|
|
27
29
|
|
|
28
30
|
### ElevenLabs
|
|
29
31
|
|
|
30
|
-
**options
|
|
32
|
+
**options** (`Options`): Configuration options.
|
|
33
|
+
|
|
34
|
+
**options.stability** (`number`): Voice stability. Higher values result in more stable, less expressive speech.
|
|
31
35
|
|
|
32
|
-
**options.similarity\_boost** (`number`): Voice clarity and similarity to the original voice.
|
|
36
|
+
**options.similarity\_boost** (`number`): Voice clarity and similarity to the original voice.
|
|
33
37
|
|
|
34
38
|
### Google
|
|
35
39
|
|
|
40
|
+
**options** (`Options`): Configuration options.
|
|
41
|
+
|
|
36
42
|
**options.languageCode** (`string`): Language code for the voice (e.g., 'en-US').
|
|
37
43
|
|
|
38
|
-
**options.audioConfig** (`object`): Audio configuration options from Google Cloud Text-to-Speech API.
|
|
44
|
+
**options.audioConfig** (`object`): Audio configuration options from Google Cloud Text-to-Speech API.
|
|
39
45
|
|
|
40
46
|
### Murf
|
|
41
47
|
|
|
48
|
+
**options** (`Options`): Configuration options.
|
|
49
|
+
|
|
50
|
+
**options.properties** (`object`): properties configuration.
|
|
51
|
+
|
|
42
52
|
**options.properties.rate** (`number`): Speech rate multiplier.
|
|
43
53
|
|
|
44
54
|
**options.properties.pitch** (`number`): Voice pitch adjustment.
|
|
@@ -147,7 +147,7 @@ const result = await run.timeTravel({
|
|
|
147
147
|
- Step results before the target step are reconstructed from the snapshot or provided context
|
|
148
148
|
- Execution begins from the specified step with the provided or reconstructed input data
|
|
149
149
|
- The workflow continues to completion from that point forward
|
|
150
|
-
- Time travel can be used on workflows that
|
|
150
|
+
- Time travel can be used on workflows that haven't been run yet by providing custom context or input data for the step to start from.
|
|
151
151
|
|
|
152
152
|
## Related
|
|
153
153
|
|