Back to Prompt Library
implementation

Voice Interface with Sarvam AI and Document Interaction

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: SkillProof Document Agent

Format
Code-aware
Lines
19
Sections
5
Linked challenge
SkillProof Document Agent

Prompt source

Original prompt text with formatting preserved for inspection.

19 lines
5 sections
No variables
1 code block
Integrate Sarvam AI's speech-to-text capabilities to allow users to verbally provide their `skill_description` and `name` to the 'SkillProofAgent'. The agent should then process this voice input to populate the document fields. Describe how Sarvam AI would convert speech to text and how your Mastra AI agent would then interpret and act upon this text input to start generating a SkillProof document. Provide a conceptual flow.

```typescript
// Conceptual integration with Sarvam AI and Mastra Agent
// import SarvamClient from 'sarvam-ai-sdk'; // Hypothetical SDK

// const sarvam = new SarvamClient({ apiKey: 'YOUR_SARVAM_API_KEY' });

// async function processVoiceInput(audioData: Buffer) {
//   const transcription = await sarvam.speechToText(audioData); // Use Sarvam ASR
//   // Then, send transcription to Mastra AI agent
//   // const agentResponse = await agent.run(transcription);
//   // Agent's turn handler would parse transcription, extract intent (e.g., 'create_skill_proof'),
//   // and update the SkillProofDocument state based on extracted skillDescription and name.
//   return 'SkillProof document started based on your voice input.';
// }

// Mastra AI agent would have a handler that understands intents from natural language:
// agent.onIntent('create_skill_proof', async ({ payload, state }) => {
//   state.set('skillProofDocument', { skillName: payload.skill, descriptionGenerated: '', ... });
//   return 'Got it. Generating your skill proof.';
// });
```

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.