@mastra/mcp-docs-server 1.0.0-beta.4 → 1.0.0-beta.6
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/organized/changelogs/%40internal%2Fstorage-test-utils.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +29 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +411 -211
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +42 -0
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +52 -0
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Flance.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Frag.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Freact.md +89 -1
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +42 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +92 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +67 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +201 -1
- package/.docs/organized/changelogs/create-mastra.md +201 -1
- package/.docs/organized/changelogs/mastra.md +201 -1
- package/.docs/organized/code-examples/agui.md +1 -0
- package/.docs/organized/code-examples/ai-sdk-v5.md +1 -0
- package/.docs/organized/code-examples/mcp-server-adapters.md +721 -0
- package/.docs/organized/code-examples/memory-with-processors.md +1 -1
- package/.docs/organized/code-examples/quick-start.md +1 -1
- package/.docs/organized/code-examples/server-app-access.md +342 -0
- package/.docs/raw/agents/adding-voice.mdx +7 -10
- package/.docs/raw/agents/agent-approval.mdx +189 -0
- package/.docs/raw/agents/guardrails.mdx +26 -23
- package/.docs/raw/agents/networks.mdx +2 -2
- package/.docs/raw/agents/overview.mdx +27 -62
- package/.docs/raw/agents/processors.mdx +279 -0
- package/.docs/raw/agents/using-tools.mdx +4 -5
- package/.docs/raw/course/01-first-agent/05-running-playground.md +5 -5
- package/.docs/raw/course/01-first-agent/09-testing-your-agent.md +3 -3
- package/.docs/raw/course/01-first-agent/13-testing-your-tool.md +3 -3
- package/.docs/raw/course/01-first-agent/17-testing-memory.md +2 -2
- package/.docs/raw/course/04-workflows/07-using-playground.md +1 -1
- package/.docs/raw/deployment/building-mastra.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/index.mdx +20 -27
- package/.docs/raw/deployment/cloud-providers/netlify-deployer.mdx +44 -13
- package/.docs/raw/deployment/mastra-cloud/observability.mdx +19 -17
- package/.docs/raw/deployment/mastra-cloud/setting-up.mdx +1 -1
- package/.docs/raw/deployment/overview.mdx +2 -2
- package/.docs/raw/deployment/web-framework.mdx +5 -5
- package/.docs/raw/evals/custom-scorers.mdx +3 -5
- package/.docs/raw/evals/overview.mdx +2 -3
- package/.docs/raw/evals/running-in-ci.mdx +0 -2
- package/.docs/raw/{guides/guide → getting-started}/manual-install.mdx +2 -2
- package/.docs/raw/getting-started/project-structure.mdx +1 -1
- package/.docs/raw/getting-started/start.mdx +72 -0
- package/.docs/raw/getting-started/studio.mdx +1 -1
- package/.docs/raw/{frameworks/agentic-uis/ai-sdk.mdx → guides/build-your-ui/ai-sdk-ui.mdx} +113 -11
- package/.docs/raw/{frameworks/web-frameworks → guides/getting-started}/astro.mdx +23 -25
- package/.docs/raw/{frameworks/servers → guides/getting-started}/express.mdx +3 -4
- package/.docs/raw/guides/{quickstarts/nextjs.mdx → getting-started/next-js.mdx} +11 -11
- package/.docs/raw/guides/{quickstarts/standalone-server.mdx → getting-started/quickstart.mdx} +7 -7
- package/.docs/raw/{frameworks/web-frameworks → guides/getting-started}/sveltekit.mdx +23 -25
- package/.docs/raw/{frameworks/web-frameworks → guides/getting-started}/vite-react.mdx +7 -7
- package/.docs/raw/guides/guide/ai-recruiter.mdx +2 -3
- package/.docs/raw/guides/guide/chef-michel.mdx +2 -3
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +2 -2
- package/.docs/raw/guides/guide/research-assistant.mdx +7 -8
- package/.docs/raw/guides/guide/stock-agent.mdx +4 -6
- package/.docs/raw/guides/guide/web-search.mdx +12 -10
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +421 -0
- package/.docs/raw/guides/index.mdx +3 -35
- package/.docs/raw/guides/migrations/agentnetwork.mdx +4 -4
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +40 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +5 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +51 -0
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +2 -2
- package/.docs/raw/index.mdx +2 -2
- package/.docs/raw/mcp/overview.mdx +3 -5
- package/.docs/raw/memory/memory-processors.mdx +264 -79
- package/.docs/raw/memory/semantic-recall.mdx +7 -7
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +2 -4
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +2 -4
- package/.docs/raw/memory/storage/memory-with-pg.mdx +2 -4
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +2 -4
- package/.docs/raw/memory/threads-and-resources.mdx +3 -3
- package/.docs/raw/memory/working-memory.mdx +14 -7
- package/.docs/raw/{logging.mdx → observability/logging.mdx} +1 -1
- package/.docs/raw/observability/overview.mdx +2 -3
- package/.docs/raw/observability/tracing/bridges/otel.mdx +176 -0
- package/.docs/raw/observability/tracing/exporters/arize.mdx +17 -0
- package/.docs/raw/observability/tracing/exporters/braintrust.mdx +19 -0
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +20 -0
- package/.docs/raw/observability/tracing/exporters/langsmith.mdx +12 -0
- package/.docs/raw/observability/tracing/exporters/otel.mdx +25 -5
- package/.docs/raw/observability/tracing/exporters/posthog.mdx +107 -0
- package/.docs/raw/observability/tracing/overview.mdx +74 -8
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +0 -1
- package/.docs/raw/rag/chunking-and-embedding.mdx +16 -17
- package/.docs/raw/rag/overview.mdx +3 -2
- package/.docs/raw/rag/retrieval.mdx +43 -38
- package/.docs/raw/rag/vector-databases.mdx +93 -2
- package/.docs/raw/reference/agents/agent.mdx +7 -10
- package/.docs/raw/reference/agents/generate.mdx +55 -6
- package/.docs/raw/reference/agents/generateLegacy.mdx +2 -2
- package/.docs/raw/reference/agents/getLLM.mdx +1 -1
- package/.docs/raw/reference/agents/network.mdx +46 -3
- package/.docs/raw/reference/cli/mastra.mdx +2 -1
- package/.docs/raw/reference/client-js/agents.mdx +3 -3
- package/.docs/raw/reference/client-js/memory.mdx +43 -0
- package/.docs/raw/reference/client-js/workflows.mdx +92 -63
- package/.docs/raw/reference/core/getLogger.mdx +1 -1
- package/.docs/raw/reference/core/listLogs.mdx +1 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
- package/.docs/raw/reference/core/mastra-model-gateway.mdx +5 -19
- package/.docs/raw/reference/core/setLogger.mdx +1 -1
- package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
- package/.docs/raw/reference/deployer/netlify.mdx +1 -2
- package/.docs/raw/reference/evals/answer-relevancy.mdx +28 -98
- package/.docs/raw/reference/evals/answer-similarity.mdx +12 -258
- package/.docs/raw/reference/evals/bias.mdx +29 -87
- package/.docs/raw/reference/evals/completeness.mdx +31 -90
- package/.docs/raw/reference/evals/content-similarity.mdx +28 -88
- package/.docs/raw/reference/evals/context-precision.mdx +28 -130
- package/.docs/raw/reference/evals/context-relevance.mdx +11 -11
- package/.docs/raw/reference/evals/faithfulness.mdx +28 -101
- package/.docs/raw/reference/evals/hallucination.mdx +28 -103
- package/.docs/raw/reference/evals/keyword-coverage.mdx +28 -107
- package/.docs/raw/reference/evals/noise-sensitivity.mdx +11 -11
- package/.docs/raw/reference/evals/prompt-alignment.mdx +15 -15
- package/.docs/raw/reference/evals/scorer-utils.mdx +362 -0
- package/.docs/raw/reference/evals/textual-difference.mdx +27 -100
- package/.docs/raw/reference/evals/tone-consistency.mdx +25 -98
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +7 -7
- package/.docs/raw/reference/evals/toxicity.mdx +29 -92
- package/.docs/raw/reference/index.mdx +1 -0
- package/.docs/raw/reference/memory/memory-class.mdx +5 -7
- package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +150 -0
- package/.docs/raw/reference/observability/tracing/configuration.mdx +0 -4
- package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +4 -0
- package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +17 -1
- package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +6 -0
- package/.docs/raw/reference/observability/tracing/exporters/posthog.mdx +132 -0
- package/.docs/raw/reference/observability/tracing/instances.mdx +0 -4
- package/.docs/raw/reference/observability/tracing/interfaces.mdx +29 -4
- package/.docs/raw/reference/observability/tracing/spans.mdx +0 -4
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +1 -1
- package/.docs/raw/reference/processors/language-detector.mdx +10 -3
- package/.docs/raw/reference/processors/message-history-processor.mdx +131 -0
- package/.docs/raw/reference/processors/moderation-processor.mdx +12 -5
- package/.docs/raw/reference/processors/pii-detector.mdx +12 -5
- package/.docs/raw/reference/processors/processor-interface.mdx +502 -0
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +10 -3
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +197 -0
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +3 -4
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +2 -2
- package/.docs/raw/reference/processors/tool-call-filter.mdx +125 -0
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +1 -1
- package/.docs/raw/reference/processors/working-memory-processor.mdx +221 -0
- package/.docs/raw/reference/rag/embeddings.mdx +5 -5
- package/.docs/raw/reference/rag/rerank.mdx +1 -2
- package/.docs/raw/reference/rag/rerankWithScorer.mdx +0 -1
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +37 -0
- package/.docs/raw/reference/storage/convex.mdx +164 -0
- package/.docs/raw/reference/storage/lance.mdx +33 -0
- package/.docs/raw/reference/storage/libsql.mdx +37 -0
- package/.docs/raw/reference/storage/mongodb.mdx +39 -0
- package/.docs/raw/reference/storage/mssql.mdx +37 -0
- package/.docs/raw/reference/storage/postgresql.mdx +37 -0
- package/.docs/raw/reference/streaming/ChunkType.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/stream.mdx +64 -2
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +7 -9
- package/.docs/raw/reference/streaming/workflows/{resumeStreamVNext.mdx → resumeStream.mdx} +51 -11
- package/.docs/raw/reference/streaming/workflows/stream.mdx +83 -24
- package/.docs/raw/reference/templates/overview.mdx +1 -4
- package/.docs/raw/reference/tools/client.mdx +1 -2
- package/.docs/raw/reference/tools/create-tool.mdx +132 -0
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +5 -5
- package/.docs/raw/reference/tools/mcp-client.mdx +76 -21
- package/.docs/raw/reference/tools/mcp-server.mdx +1 -2
- package/.docs/raw/reference/tools/vector-query-tool.mdx +14 -15
- package/.docs/raw/reference/vectors/chroma.mdx +81 -1
- package/.docs/raw/reference/vectors/convex.mdx +429 -0
- package/.docs/raw/reference/vectors/couchbase.mdx +24 -17
- package/.docs/raw/reference/vectors/duckdb.mdx +462 -0
- package/.docs/raw/reference/vectors/elasticsearch.mdx +310 -0
- package/.docs/raw/reference/vectors/lance.mdx +38 -22
- package/.docs/raw/reference/vectors/libsql.mdx +35 -2
- package/.docs/raw/reference/vectors/mongodb.mdx +35 -2
- package/.docs/raw/reference/vectors/opensearch.mdx +37 -16
- package/.docs/raw/reference/vectors/pg.mdx +43 -36
- package/.docs/raw/reference/vectors/pinecone.mdx +48 -1
- package/.docs/raw/reference/vectors/qdrant.mdx +36 -1
- package/.docs/raw/reference/vectors/turbopuffer.mdx +74 -0
- package/.docs/raw/reference/voice/google.mdx +159 -20
- package/.docs/raw/reference/voice/openai-realtime.mdx +2 -2
- package/.docs/raw/reference/voice/voice.addInstructions.mdx +2 -3
- package/.docs/raw/reference/voice/voice.addTools.mdx +1 -1
- package/.docs/raw/reference/voice/voice.answer.mdx +1 -1
- package/.docs/raw/reference/voice/voice.close.mdx +1 -1
- package/.docs/raw/reference/voice/voice.connect.mdx +1 -1
- package/.docs/raw/reference/voice/voice.off.mdx +1 -1
- package/.docs/raw/reference/voice/voice.on.mdx +1 -1
- package/.docs/raw/reference/voice/voice.send.mdx +1 -1
- package/.docs/raw/reference/voice/voice.updateConfig.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +142 -0
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +44 -0
- package/.docs/raw/reference/workflows/run-methods/start.mdx +44 -0
- package/.docs/raw/reference/workflows/run.mdx +13 -5
- package/.docs/raw/reference/workflows/step.mdx +13 -0
- package/.docs/raw/reference/workflows/workflow.mdx +19 -0
- package/.docs/raw/server-db/mastra-client.mdx +1 -2
- package/.docs/raw/server-db/mastra-server.mdx +30 -1
- package/.docs/raw/server-db/request-context.mdx +0 -1
- package/.docs/raw/server-db/storage.mdx +11 -0
- package/.docs/raw/streaming/overview.mdx +26 -15
- package/.docs/raw/streaming/tool-streaming.mdx +48 -5
- package/.docs/raw/streaming/workflow-streaming.mdx +5 -11
- package/.docs/raw/tools-mcp/advanced-usage.mdx +1 -2
- package/.docs/raw/tools-mcp/mcp-overview.mdx +3 -5
- package/.docs/raw/voice/overview.mdx +21 -41
- package/.docs/raw/voice/speech-to-speech.mdx +4 -4
- package/.docs/raw/voice/speech-to-text.mdx +1 -2
- package/.docs/raw/voice/text-to-speech.mdx +1 -2
- package/.docs/raw/workflows/control-flow.mdx +180 -0
- package/.docs/raw/workflows/error-handling.mdx +1 -0
- package/.docs/raw/workflows/human-in-the-loop.mdx +4 -4
- package/.docs/raw/workflows/overview.mdx +56 -44
- package/.docs/raw/workflows/snapshots.mdx +1 -0
- package/.docs/raw/workflows/suspend-and-resume.mdx +85 -16
- package/.docs/raw/workflows/time-travel.mdx +313 -0
- package/.docs/raw/workflows/workflow-state.mdx +191 -0
- package/CHANGELOG.md +18 -0
- package/dist/{chunk-5NJC7NRO.js → chunk-4CM2BQNP.js} +24 -4
- package/dist/prepare-docs/package-changes.d.ts.map +1 -1
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +7 -7
- package/.docs/raw/agents/human-in-the-loop-with-tools.mdx +0 -90
- package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +0 -102
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +0 -179
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +0 -379
- package/.docs/raw/getting-started/quickstart.mdx +0 -27
- package/.docs/raw/getting-started/templates.mdx +0 -73
- package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +0 -47
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +0 -153
- /package/.docs/raw/{frameworks/agentic-uis → guides/build-your-ui}/assistant-ui.mdx +0 -0
- /package/.docs/raw/{frameworks/agentic-uis → guides/build-your-ui}/copilotkit.mdx +0 -0
|
@@ -403,6 +403,8 @@ interface PGIndexStats {
|
|
|
403
403
|
|
|
404
404
|
### updateVector()
|
|
405
405
|
|
|
406
|
+
Update a single vector by ID or by metadata filter. Either `id` or `filter` must be provided, but not both.
|
|
407
|
+
|
|
406
408
|
<PropertiesTable
|
|
407
409
|
content={[
|
|
408
410
|
{
|
|
@@ -413,63 +415,42 @@ interface PGIndexStats {
|
|
|
413
415
|
{
|
|
414
416
|
name: "id",
|
|
415
417
|
type: "string",
|
|
416
|
-
|
|
418
|
+
isOptional: true,
|
|
419
|
+
description: "ID of the vector to update (mutually exclusive with filter)",
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "filter",
|
|
423
|
+
type: "Record<string, any>",
|
|
424
|
+
isOptional: true,
|
|
425
|
+
description: "Metadata filter to identify vector(s) to update (mutually exclusive with id)",
|
|
417
426
|
},
|
|
418
427
|
{
|
|
419
428
|
name: "update",
|
|
420
|
-
type: "
|
|
421
|
-
description: "
|
|
422
|
-
properties: [
|
|
423
|
-
{
|
|
424
|
-
type: "object",
|
|
425
|
-
parameters: [
|
|
426
|
-
{
|
|
427
|
-
name: "vector",
|
|
428
|
-
type: "number[]",
|
|
429
|
-
description: "New vector values",
|
|
430
|
-
isOptional: true,
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
name: "metadata",
|
|
434
|
-
type: "Record<string, any>",
|
|
435
|
-
description: "New metadata values",
|
|
436
|
-
isOptional: true,
|
|
437
|
-
},
|
|
438
|
-
],
|
|
439
|
-
},
|
|
440
|
-
],
|
|
429
|
+
type: "{ vector?: number[]; metadata?: Record<string, any>; }",
|
|
430
|
+
description: "Object containing the vector and/or metadata to update",
|
|
441
431
|
},
|
|
442
432
|
]}
|
|
443
433
|
/>
|
|
444
434
|
|
|
445
|
-
Updates an existing vector by ID. At least one of vector or metadata must be provided.
|
|
435
|
+
Updates an existing vector by ID or filter. At least one of vector or metadata must be provided in the update object.
|
|
446
436
|
|
|
447
437
|
```typescript copy
|
|
448
|
-
// Update
|
|
438
|
+
// Update by ID
|
|
449
439
|
await pgVector.updateVector({
|
|
450
440
|
indexName: "my_vectors",
|
|
451
441
|
id: "vector123",
|
|
452
442
|
update: {
|
|
453
443
|
vector: [0.1, 0.2, 0.3],
|
|
454
|
-
},
|
|
455
|
-
});
|
|
456
|
-
|
|
457
|
-
// Update just the metadata
|
|
458
|
-
await pgVector.updateVector({
|
|
459
|
-
indexName: "my_vectors",
|
|
460
|
-
id: "vector123",
|
|
461
|
-
update: {
|
|
462
444
|
metadata: { label: "updated" },
|
|
463
445
|
},
|
|
464
446
|
});
|
|
465
447
|
|
|
466
|
-
// Update
|
|
448
|
+
// Update by filter
|
|
467
449
|
await pgVector.updateVector({
|
|
468
450
|
indexName: "my_vectors",
|
|
469
|
-
|
|
451
|
+
filter: { category: "product" },
|
|
470
452
|
update: {
|
|
471
|
-
|
|
472
|
-
metadata: { label: "updated" },
|
|
453
|
+
metadata: { status: "reviewed" },
|
|
473
454
|
},
|
|
474
455
|
});
|
|
475
456
|
```
|
|
@@ -497,6 +478,32 @@ Deletes a single vector by ID from the specified index.
|
|
|
497
478
|
await pgVector.deleteVector({ indexName: "my_vectors", id: "vector123" });
|
|
498
479
|
```
|
|
499
480
|
|
|
481
|
+
### deleteVectors()
|
|
482
|
+
|
|
483
|
+
Delete multiple vectors by IDs or by metadata filter. Either `ids` or `filter` must be provided, but not both.
|
|
484
|
+
|
|
485
|
+
<PropertiesTable
|
|
486
|
+
content={[
|
|
487
|
+
{
|
|
488
|
+
name: "indexName",
|
|
489
|
+
type: "string",
|
|
490
|
+
description: "Name of the index containing the vectors to delete",
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: "ids",
|
|
494
|
+
type: "string[]",
|
|
495
|
+
isOptional: true,
|
|
496
|
+
description: "Array of vector IDs to delete (mutually exclusive with filter)",
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: "filter",
|
|
500
|
+
type: "Record<string, any>",
|
|
501
|
+
isOptional: true,
|
|
502
|
+
description: "Metadata filter to identify vectors to delete (mutually exclusive with ids)",
|
|
503
|
+
},
|
|
504
|
+
]}
|
|
505
|
+
/>
|
|
506
|
+
|
|
500
507
|
### disconnect()
|
|
501
508
|
|
|
502
509
|
Closes the database connection pool. Should be called when done using the store.
|
|
@@ -206,6 +206,8 @@ interface IndexStats {
|
|
|
206
206
|
|
|
207
207
|
### updateVector()
|
|
208
208
|
|
|
209
|
+
Update a single vector by ID or by metadata filter. Either `id` or `filter` must be provided, but not both.
|
|
210
|
+
|
|
209
211
|
<PropertiesTable
|
|
210
212
|
content={[
|
|
211
213
|
{
|
|
@@ -216,7 +218,20 @@ interface IndexStats {
|
|
|
216
218
|
{
|
|
217
219
|
name: "id",
|
|
218
220
|
type: "string",
|
|
219
|
-
|
|
221
|
+
isOptional: true,
|
|
222
|
+
description: "ID of the vector to update (mutually exclusive with filter)",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "filter",
|
|
226
|
+
type: "Record<string, any>",
|
|
227
|
+
isOptional: true,
|
|
228
|
+
description: "Metadata filter to identify vector(s) to update (mutually exclusive with id)",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: "namespace",
|
|
232
|
+
type: "string",
|
|
233
|
+
isOptional: true,
|
|
234
|
+
description: "Optional namespace for the update operation",
|
|
220
235
|
},
|
|
221
236
|
{
|
|
222
237
|
name: "update",
|
|
@@ -255,6 +270,38 @@ interface IndexStats {
|
|
|
255
270
|
]}
|
|
256
271
|
/>
|
|
257
272
|
|
|
273
|
+
### deleteVectors()
|
|
274
|
+
|
|
275
|
+
Delete multiple vectors by IDs or by metadata filter. Either `ids` or `filter` must be provided, but not both.
|
|
276
|
+
|
|
277
|
+
<PropertiesTable
|
|
278
|
+
content={[
|
|
279
|
+
{
|
|
280
|
+
name: "indexName",
|
|
281
|
+
type: "string",
|
|
282
|
+
description: "Name of the index containing the vectors to delete",
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "ids",
|
|
286
|
+
type: "string[]",
|
|
287
|
+
isOptional: true,
|
|
288
|
+
description: "Array of vector IDs to delete (mutually exclusive with filter)",
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: "filter",
|
|
292
|
+
type: "Record<string, any>",
|
|
293
|
+
isOptional: true,
|
|
294
|
+
description: "Metadata filter to identify vectors to delete (mutually exclusive with ids)",
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
name: "namespace",
|
|
298
|
+
type: "string",
|
|
299
|
+
isOptional: true,
|
|
300
|
+
description: "Optional namespace for the deletion operation",
|
|
301
|
+
},
|
|
302
|
+
]}
|
|
303
|
+
/>
|
|
304
|
+
|
|
258
305
|
## Response Types
|
|
259
306
|
|
|
260
307
|
Query results are returned in this format:
|
|
@@ -159,6 +159,8 @@ interface IndexStats {
|
|
|
159
159
|
|
|
160
160
|
### updateVector()
|
|
161
161
|
|
|
162
|
+
Update a single vector by ID or by metadata filter. Either `id` or `filter` must be provided, but not both.
|
|
163
|
+
|
|
162
164
|
<PropertiesTable
|
|
163
165
|
content={[
|
|
164
166
|
{
|
|
@@ -169,7 +171,14 @@ interface IndexStats {
|
|
|
169
171
|
{
|
|
170
172
|
name: "id",
|
|
171
173
|
type: "string",
|
|
172
|
-
|
|
174
|
+
isOptional: true,
|
|
175
|
+
description: "ID of the vector to update (mutually exclusive with filter)",
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: "filter",
|
|
179
|
+
type: "Record<string, any>",
|
|
180
|
+
isOptional: true,
|
|
181
|
+
description: "Metadata filter to identify vector(s) to update (mutually exclusive with id)",
|
|
173
182
|
},
|
|
174
183
|
{
|
|
175
184
|
name: "update",
|
|
@@ -200,6 +209,32 @@ Updates a vector and/or its metadata in the specified index. If both vector and
|
|
|
200
209
|
|
|
201
210
|
Deletes a vector from the specified index by its ID.
|
|
202
211
|
|
|
212
|
+
### deleteVectors()
|
|
213
|
+
|
|
214
|
+
Delete multiple vectors by IDs or by metadata filter. Either `ids` or `filter` must be provided, but not both.
|
|
215
|
+
|
|
216
|
+
<PropertiesTable
|
|
217
|
+
content={[
|
|
218
|
+
{
|
|
219
|
+
name: "indexName",
|
|
220
|
+
type: "string",
|
|
221
|
+
description: "Name of the index containing the vectors to delete",
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "ids",
|
|
225
|
+
type: "string[]",
|
|
226
|
+
isOptional: true,
|
|
227
|
+
description: "Array of vector IDs to delete (mutually exclusive with filter)",
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "filter",
|
|
231
|
+
type: "Record<string, any>",
|
|
232
|
+
isOptional: true,
|
|
233
|
+
description: "Metadata filter to identify vectors to delete (mutually exclusive with ids)",
|
|
234
|
+
},
|
|
235
|
+
]}
|
|
236
|
+
/>
|
|
237
|
+
|
|
203
238
|
## Response Types
|
|
204
239
|
|
|
205
240
|
Query results are returned in this format:
|
|
@@ -190,6 +190,80 @@ interface IndexStats {
|
|
|
190
190
|
]}
|
|
191
191
|
/>
|
|
192
192
|
|
|
193
|
+
### updateVector()
|
|
194
|
+
|
|
195
|
+
Update a single vector by ID or by metadata filter. Either `id` or `filter` must be provided, but not both.
|
|
196
|
+
|
|
197
|
+
<PropertiesTable
|
|
198
|
+
content={[
|
|
199
|
+
{
|
|
200
|
+
name: "indexName",
|
|
201
|
+
type: "string",
|
|
202
|
+
description: "Name of the index containing the vector",
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "id",
|
|
206
|
+
type: "string",
|
|
207
|
+
isOptional: true,
|
|
208
|
+
description: "ID of the vector to update (mutually exclusive with filter)",
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "filter",
|
|
212
|
+
type: "Record<string, any>",
|
|
213
|
+
isOptional: true,
|
|
214
|
+
description: "Metadata filter to identify vector(s) to update (mutually exclusive with id)",
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "update",
|
|
218
|
+
type: "{ vector?: number[]; metadata?: Record<string, any>; }",
|
|
219
|
+
description: "Object containing the vector and/or metadata to update",
|
|
220
|
+
},
|
|
221
|
+
]}
|
|
222
|
+
/>
|
|
223
|
+
|
|
224
|
+
### deleteVector()
|
|
225
|
+
|
|
226
|
+
<PropertiesTable
|
|
227
|
+
content={[
|
|
228
|
+
{
|
|
229
|
+
name: "indexName",
|
|
230
|
+
type: "string",
|
|
231
|
+
description: "Name of the index containing the vector",
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "id",
|
|
235
|
+
type: "string",
|
|
236
|
+
description: "ID of the vector to delete",
|
|
237
|
+
},
|
|
238
|
+
]}
|
|
239
|
+
/>
|
|
240
|
+
|
|
241
|
+
### deleteVectors()
|
|
242
|
+
|
|
243
|
+
Delete multiple vectors by IDs or by metadata filter. Either `ids` or `filter` must be provided, but not both.
|
|
244
|
+
|
|
245
|
+
<PropertiesTable
|
|
246
|
+
content={[
|
|
247
|
+
{
|
|
248
|
+
name: "indexName",
|
|
249
|
+
type: "string",
|
|
250
|
+
description: "Name of the index containing the vectors to delete",
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: "ids",
|
|
254
|
+
type: "string[]",
|
|
255
|
+
isOptional: true,
|
|
256
|
+
description: "Array of vector IDs to delete (mutually exclusive with filter)",
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: "filter",
|
|
260
|
+
type: "Record<string, any>",
|
|
261
|
+
isOptional: true,
|
|
262
|
+
description: "Metadata filter to identify vectors to delete (mutually exclusive with ids)",
|
|
263
|
+
},
|
|
264
|
+
]}
|
|
265
|
+
/>
|
|
266
|
+
|
|
193
267
|
## Response Types
|
|
194
268
|
|
|
195
269
|
Query results are returned in this format:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Reference: Google | Voice"
|
|
3
|
-
description: "Documentation for the Google Voice implementation, providing text-to-speech and speech-to-text capabilities."
|
|
3
|
+
description: "Documentation for the Google Voice implementation, providing text-to-speech and speech-to-text capabilities with support for both API key and Vertex AI authentication."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Google
|
|
7
7
|
|
|
8
|
-
The Google Voice implementation in Mastra provides both text-to-speech (TTS) and speech-to-text (STT) capabilities using Google Cloud services. It supports multiple voices, languages,
|
|
8
|
+
The Google Voice implementation in Mastra provides both text-to-speech (TTS) and speech-to-text (STT) capabilities using Google Cloud services. It supports multiple voices, languages, advanced audio configuration options, and both standard API key authentication and Vertex AI mode for enterprise deployments.
|
|
9
9
|
|
|
10
10
|
## Usage Example
|
|
11
11
|
|
|
@@ -15,17 +15,6 @@ import { GoogleVoice } from "@mastra/voice-google";
|
|
|
15
15
|
// Initialize with default configuration (uses GOOGLE_API_KEY environment variable)
|
|
16
16
|
const voice = new GoogleVoice();
|
|
17
17
|
|
|
18
|
-
// Initialize with custom configuration
|
|
19
|
-
const voice = new GoogleVoice({
|
|
20
|
-
speechModel: {
|
|
21
|
-
apiKey: "your-speech-api-key",
|
|
22
|
-
},
|
|
23
|
-
listeningModel: {
|
|
24
|
-
apiKey: "your-listening-api-key",
|
|
25
|
-
},
|
|
26
|
-
speaker: "en-US-Casual-K",
|
|
27
|
-
});
|
|
28
|
-
|
|
29
18
|
// Text-to-Speech
|
|
30
19
|
const audioStream = await voice.speak("Hello, world!", {
|
|
31
20
|
languageCode: "en-US",
|
|
@@ -71,6 +60,29 @@ const voices = await voice.getSpeakers({ languageCode: "en-US" });
|
|
|
71
60
|
isOptional: true,
|
|
72
61
|
defaultValue: "'en-US-Casual-K'",
|
|
73
62
|
},
|
|
63
|
+
{
|
|
64
|
+
name: "vertexAI",
|
|
65
|
+
type: "boolean",
|
|
66
|
+
description:
|
|
67
|
+
"Enable Vertex AI mode for enterprise deployments. Uses project-based authentication instead of API keys. Requires 'project' to be set.",
|
|
68
|
+
isOptional: true,
|
|
69
|
+
defaultValue: "false",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "project",
|
|
73
|
+
type: "string",
|
|
74
|
+
description:
|
|
75
|
+
"Google Cloud project ID (required when vertexAI is true). Falls back to GOOGLE_CLOUD_PROJECT environment variable.",
|
|
76
|
+
isOptional: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "location",
|
|
80
|
+
type: "string",
|
|
81
|
+
description:
|
|
82
|
+
"Google Cloud region for Vertex AI. Falls back to GOOGLE_CLOUD_LOCATION environment variable.",
|
|
83
|
+
isOptional: true,
|
|
84
|
+
defaultValue: "'us-central1'",
|
|
85
|
+
},
|
|
74
86
|
]}
|
|
75
87
|
/>
|
|
76
88
|
|
|
@@ -82,7 +94,21 @@ const voices = await voice.getSpeakers({ languageCode: "en-US" });
|
|
|
82
94
|
name: "apiKey",
|
|
83
95
|
type: "string",
|
|
84
96
|
description:
|
|
85
|
-
"Google Cloud API key. Falls back to GOOGLE_API_KEY environment variable",
|
|
97
|
+
"Google Cloud API key. Falls back to GOOGLE_API_KEY environment variable. Not used when vertexAI is true.",
|
|
98
|
+
isOptional: true,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "keyFilename",
|
|
102
|
+
type: "string",
|
|
103
|
+
description:
|
|
104
|
+
"Path to service account JSON key file. Falls back to GOOGLE_APPLICATION_CREDENTIALS environment variable.",
|
|
105
|
+
isOptional: true,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "credentials",
|
|
109
|
+
type: "object",
|
|
110
|
+
description:
|
|
111
|
+
"In-memory service account credentials object with client_email and private_key properties.",
|
|
86
112
|
isOptional: true,
|
|
87
113
|
},
|
|
88
114
|
]}
|
|
@@ -193,11 +219,124 @@ Returns an array of available voice options, where each node contains:
|
|
|
193
219
|
]}
|
|
194
220
|
/>
|
|
195
221
|
|
|
222
|
+
### isUsingVertexAI()
|
|
223
|
+
|
|
224
|
+
Checks if Vertex AI mode is enabled.
|
|
225
|
+
|
|
226
|
+
Returns: `boolean` - `true` if using Vertex AI, `false` otherwise
|
|
227
|
+
|
|
228
|
+
### getProject()
|
|
229
|
+
|
|
230
|
+
Gets the configured Google Cloud project ID.
|
|
231
|
+
|
|
232
|
+
Returns: `string | undefined` - The project ID or `undefined` if not set
|
|
233
|
+
|
|
234
|
+
### getLocation()
|
|
235
|
+
|
|
236
|
+
Gets the configured Google Cloud location/region.
|
|
237
|
+
|
|
238
|
+
Returns: `string` - The location (default: `'us-central1'`)
|
|
239
|
+
|
|
240
|
+
## Authentication
|
|
241
|
+
|
|
242
|
+
The Google Voice provider supports two authentication methods:
|
|
243
|
+
|
|
244
|
+
### Standard Mode (API Key)
|
|
245
|
+
|
|
246
|
+
Uses a Google Cloud API key for authentication. Suitable for development and simple use cases.
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
// Using environment variable (GOOGLE_API_KEY)
|
|
250
|
+
const voice = new GoogleVoice();
|
|
251
|
+
|
|
252
|
+
// Using explicit API key
|
|
253
|
+
const voice = new GoogleVoice({
|
|
254
|
+
speechModel: { apiKey: "your-api-key" },
|
|
255
|
+
listeningModel: { apiKey: "your-api-key" },
|
|
256
|
+
speaker: "en-US-Casual-K",
|
|
257
|
+
});
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Vertex AI Mode (Service Account)
|
|
261
|
+
|
|
262
|
+
Uses Google Cloud project-based authentication with service accounts. Recommended for production and enterprise deployments.
|
|
263
|
+
|
|
264
|
+
**Benefits:**
|
|
265
|
+
- Better security (no API keys in code)
|
|
266
|
+
- IAM-based access control
|
|
267
|
+
- Project-level billing and quotas
|
|
268
|
+
- Audit logging
|
|
269
|
+
- Enterprise features
|
|
270
|
+
|
|
271
|
+
**Configuration Options:**
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
// Using Application Default Credentials (ADC)
|
|
275
|
+
// Set GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT env vars
|
|
276
|
+
const voice = new GoogleVoice({
|
|
277
|
+
vertexAI: true,
|
|
278
|
+
project: "your-gcp-project",
|
|
279
|
+
location: "us-central1", // Optional, defaults to 'us-central1'
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// Using service account key file
|
|
283
|
+
const voice = new GoogleVoice({
|
|
284
|
+
vertexAI: true,
|
|
285
|
+
project: "your-gcp-project",
|
|
286
|
+
speechModel: {
|
|
287
|
+
keyFilename: "/path/to/service-account.json",
|
|
288
|
+
},
|
|
289
|
+
listeningModel: {
|
|
290
|
+
keyFilename: "/path/to/service-account.json",
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
// Using in-memory credentials
|
|
295
|
+
const voice = new GoogleVoice({
|
|
296
|
+
vertexAI: true,
|
|
297
|
+
project: "your-gcp-project",
|
|
298
|
+
speechModel: {
|
|
299
|
+
credentials: {
|
|
300
|
+
client_email: "service-account@project.iam.gserviceaccount.com",
|
|
301
|
+
private_key: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----",
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**Required Permissions:**
|
|
308
|
+
|
|
309
|
+
**IAM Roles:**
|
|
310
|
+
|
|
311
|
+
For Text-to-Speech:
|
|
312
|
+
- `roles/texttospeech.admin` - Text-to-Speech Admin (full access)
|
|
313
|
+
- `roles/texttospeech.editor` - Text-to-Speech Editor (create and manage)
|
|
314
|
+
- `roles/texttospeech.viewer` - Text-to-Speech Viewer (read-only)
|
|
315
|
+
|
|
316
|
+
For Speech-to-Text:
|
|
317
|
+
- `roles/speech.client` - Speech-to-Text Client
|
|
318
|
+
|
|
319
|
+
**OAuth Scopes:**
|
|
320
|
+
|
|
321
|
+
For synchronous Text-to-Speech synthesis:
|
|
322
|
+
- `https://www.googleapis.com/auth/cloud-platform` - Full access to Google Cloud Platform services
|
|
323
|
+
|
|
324
|
+
For long-audio Text-to-Speech operations:
|
|
325
|
+
- `locations.longAudioSynthesize` - Create long-audio synthesis operations
|
|
326
|
+
- `operations.get` - Get operation status
|
|
327
|
+
- `operations.list` - List operations
|
|
328
|
+
|
|
196
329
|
## Important Notes
|
|
197
330
|
|
|
198
|
-
1.
|
|
199
|
-
2.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
331
|
+
1. **Authentication**: Either a Google Cloud API key (standard mode) or service account credentials (Vertex AI mode) is required.
|
|
332
|
+
2. **Environment Variables**:
|
|
333
|
+
- `GOOGLE_API_KEY` - API key for standard mode
|
|
334
|
+
- `GOOGLE_CLOUD_PROJECT` - Project ID for Vertex AI mode
|
|
335
|
+
- `GOOGLE_CLOUD_LOCATION` - Location for Vertex AI mode (defaults to 'us-central1')
|
|
336
|
+
- `GOOGLE_APPLICATION_CREDENTIALS` - Path to service account key file
|
|
337
|
+
3. The default voice is set to `'en-US-Casual-K'`.
|
|
338
|
+
4. Both text-to-speech and speech-to-text services use LINEAR16 as the default audio encoding.
|
|
339
|
+
5. The `speak()` method supports advanced audio configuration through the Google Cloud Text-to-Speech API.
|
|
340
|
+
6. The `listen()` method supports various recognition configurations through the Google Cloud Speech-to-Text API.
|
|
341
|
+
7. Available voices can be filtered by language code using the `getSpeakers()` method.
|
|
342
|
+
8. Vertex AI mode provides enterprise features including IAM control, audit logs, and project-level billing.
|
|
@@ -19,7 +19,7 @@ const voice = new OpenAIRealtimeVoice();
|
|
|
19
19
|
// Or initialize with specific configuration
|
|
20
20
|
const voiceWithConfig = new OpenAIRealtimeVoice({
|
|
21
21
|
apiKey: "your-openai-api-key",
|
|
22
|
-
model: "gpt-
|
|
22
|
+
model: "gpt-5.1-realtime-preview-2024-12-17",
|
|
23
23
|
speaker: "alloy", // Default voice
|
|
24
24
|
});
|
|
25
25
|
|
|
@@ -69,7 +69,7 @@ voice.connect();
|
|
|
69
69
|
type: "string",
|
|
70
70
|
description: "The model ID to use for real-time voice interactions.",
|
|
71
71
|
isOptional: true,
|
|
72
|
-
defaultValue: "'gpt-
|
|
72
|
+
defaultValue: "'gpt-5.1-realtime-preview-2024-12-17'",
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
name: "apiKey",
|
|
@@ -12,12 +12,11 @@ The `addInstructions()` method equips a voice provider with instructions that gu
|
|
|
12
12
|
```typescript
|
|
13
13
|
import { OpenAIRealtimeVoice } from "@mastra/voice-openai-realtime";
|
|
14
14
|
import { Agent } from "@mastra/core/agent";
|
|
15
|
-
import { openai } from "@ai-sdk/openai";
|
|
16
15
|
|
|
17
16
|
// Initialize a real-time voice provider
|
|
18
17
|
const voice = new OpenAIRealtimeVoice({
|
|
19
18
|
realtimeConfig: {
|
|
20
|
-
model: "gpt-
|
|
19
|
+
model: "gpt-5.1-realtime",
|
|
21
20
|
apiKey: process.env.OPENAI_API_KEY,
|
|
22
21
|
},
|
|
23
22
|
});
|
|
@@ -27,7 +26,7 @@ const agent = new Agent({
|
|
|
27
26
|
name: "Customer Support Agent",
|
|
28
27
|
instructions:
|
|
29
28
|
"You are a helpful customer support agent for a software company.",
|
|
30
|
-
model: openai
|
|
29
|
+
model: "openai/gpt-5.1",
|
|
31
30
|
voice,
|
|
32
31
|
});
|
|
33
32
|
|
|
@@ -23,7 +23,7 @@ const speaker = new Speaker({
|
|
|
23
23
|
// Initialize a real-time voice provider
|
|
24
24
|
const voice = new OpenAIRealtimeVoice({
|
|
25
25
|
realtimeConfig: {
|
|
26
|
-
model: "gpt-
|
|
26
|
+
model: "gpt-5.1",
|
|
27
27
|
apiKey: process.env.OPENAI_API_KEY,
|
|
28
28
|
},
|
|
29
29
|
speaker: "alloy", // Default voice
|
|
@@ -16,7 +16,7 @@ import { getMicrophoneStream } from "@mastra/node-audio";
|
|
|
16
16
|
// Initialize a real-time voice provider
|
|
17
17
|
const voice = new OpenAIRealtimeVoice({
|
|
18
18
|
realtimeConfig: {
|
|
19
|
-
model: "gpt-
|
|
19
|
+
model: "gpt-5.1-realtime",
|
|
20
20
|
apiKey: process.env.OPENAI_API_KEY,
|
|
21
21
|
},
|
|
22
22
|
});
|
|
@@ -22,7 +22,7 @@ const speaker = new Speaker({
|
|
|
22
22
|
// Initialize a real-time voice provider
|
|
23
23
|
const voice = new OpenAIRealtimeVoice({
|
|
24
24
|
realtimeConfig: {
|
|
25
|
-
model: "gpt-
|
|
25
|
+
model: "gpt-5.1-realtime",
|
|
26
26
|
apiKey: process.env.OPENAI_API_KEY,
|
|
27
27
|
options: {
|
|
28
28
|
sessionConfig: {
|
|
@@ -15,7 +15,7 @@ import { OpenAIRealtimeVoice } from "@mastra/voice-openai-realtime";
|
|
|
15
15
|
// Initialize a real-time voice provider
|
|
16
16
|
const voice = new OpenAIRealtimeVoice({
|
|
17
17
|
realtimeConfig: {
|
|
18
|
-
model: "gpt-
|
|
18
|
+
model: "gpt-5.1-realtime",
|
|
19
19
|
apiKey: process.env.OPENAI_API_KEY,
|
|
20
20
|
},
|
|
21
21
|
speaker: "alloy",
|