More screenshots

    Works with the AI Agents you already use

    Realtime Voice Agent (pt-BR)

    by Rafael Prado

    1

    A reusable, open-source (MIT) pipeline for building real-time voice agents in Brazilian Portuguese.

    Free

    Security scanned
    Realtime Voice Agent (pt-BR)

    Realtime Voice Agent (pt-BR)

    Example session with this skill installed

    Using the realtime voice agent skill, set up a Portuguese (pt-BR) voice agent in this project with one tool that returns the current time. Run the offline tests first, then tell me how to start the server and what the WebSocket client has to send.

    • Read your context and instructions
    • Compiled the realtime voice agent

    Summary

    The pipeline is installed and the offline suite passes. One tool (hora_atual) is wired into the example server. Starting it with live audio needs your three API keys; I have not run it against the live APIs.

    1. Install and verify (no keys needed)

    python -m venv .venv && source .venv/bin/activate
    pip install -r requirements.txt -r requirements-dev.txt
    pytest -q
    
    6 passed
    

    The 6 tests cover sentence chunking, a full turn that includes a tool call (with the filler phrase spoken before the tool runs), and barge-in leaving a valid history.

    2. The tool and the wiring (from examples/server.py)

    TOOLS_SCHEMA = [{
        "name": "hora_atual",
        "description": "Devolve a data e a hora atuais do servidor.",
        "input_schema": {"type": "object", "properties": {}},
    }]
    
    class MyTools:
        def run(self, name, args):
            if name == "hora_atual":
                return datetime.now().strftime("%Y-%m-%d %H:%M"), False
            return f"ferramenta desconhecida: {name}", True
    
    session = VoiceSession(
        ws=ws, settings=s,
        agent=Agent(llm, MyTools(), TOOLS_SCHEMA, s.llm_max_tool_rounds),
        system_prompt=SYSTEM_PROMPT, greeting=GREETING,
        stt_factory=lambda: DeepgramSTT(...),
        tts_factory=lambda: ElevenLabsTTS(...),
    )
    

    run() stays synchronous and fast on purpose: the tool_use and tool_result are written to the history together, so a barge-in can never leave an invalid conversation.

    3. Start it

    cp .env.example .env   # add ANTHROPIC_API_KEY, DEEPGRAM_API_KEY, ELEVENLABS_API_KEY
    uvicorn examples.server:app --reload
    

    4. What the WebSocket client sends and receives

    DirectionContent
    Client → serverbinary PCM16 mono 16 kHz frames; JSON {"type":"start"}, {"type":"interrupt"}, {"type":"stop"}
    Server → clientbinary PCM16 24 kHz voice; JSON ready, state, transcript, assistant, tool_call, tool_result, interrupt, metrics, error

    On an interrupt event the client must send "clear" to the player worklet (static/worklets.js) so audio stops immediately.

    Next steps

    1. Swap hora_atual for your own tools and adapt the spoken-style prompt (short sentences, numbers written out).
    2. Use headphones to test barge-in, or set BARGE_IN=false for speakers.
    3. Measure latency yourself: run 20 turns and read endpointing_ms, llm_ttft_ms, tts_first_audio_ms and voice_to_voice_ms from each metrics event. The skill's SKILL.md explains how to compute the median and p95.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A reusable, open-source (MIT) pipeline for building real-time voice agents in Brazilian Portuguese. It extracts the orchestration layer of a working clinic-receptionist demo into a module you can point at your own tools and prompt.

    What it does

    • End-to-end streaming: microphone audio goes over a WebSocket to Deepgram Nova-3, the transcript goes to Claude (streaming, with tool calling), and the answer is spoken by ElevenLabs while it is still being generated.
    • Barge-in: if the user talks over the agent, the LLM call, the TTS stream and the browser player are all cancelled, and the interrupted sentence is kept in the history as interrupted.
    • Sentence chunking: LLM tokens are cut into sentences for incremental TTS. The first chunk may break at a comma to start speaking earlier; abbreviations such as "Dra." and numbers such as "1.500" are handled.
    • Atomic tool rounds: a tool_use and its tool_result are written to the history together, so an interruption never leaves an invalid conversation.
    • Filler phrase: a short "let me check" phrase is spoken while a tool runs.
    • Per-turn metrics: endpointing, first LLM token, first sentence, first TTS audio and voice-to-voice, measured on the audio clock.
    • Swappable providers: Deepgram, Claude and ElevenLabs sit behind small interfaces, so you can replace any of them.

    How to use it

    1. Install the requirements and run pytest -q (offline, no keys needed).
    2. Copy .env.example to .env and add your own Anthropic, Deepgram and ElevenLabs keys.
    3. Implement your tools as an object with run(name, args) and a tool schema in Messages API format, then adapt the voice prompt (see examples/server.py).
    4. Run uvicorn examples.server:app --reload. The WebSocket protocol and the browser audio worklets (static/worklets.js) are documented in SKILL.md.

    Honest status

    The 6 tests run offline with fake providers (sentence chunking, a full turn with a tool call, barge-in). This package has not been benchmarked against the live APIs yet, so the sub-1.5 s voice-to-voice figure is a design target, not a measured result. SKILL.md explains how to measure it on your own setup.

    Requirements

    Python 3.11+, your own API keys for Anthropic, Deepgram and ElevenLabs, and headphones to test barge-in.

    Not included

    SIP/phone-line integration, multi-speaker handling, and the full browser UI of the original demo. Voice quality and latency depend on your network and your providers.

    Not benchmarked against the live APIs; the sub-1.5 s voice-to-voice figure is a design target. Offline tests use fake providers. Requires Python 3.11+ and your own Anthropic, Deepgram and ElevenLabs keys. No SIP/PSTN, no multi-speaker handling, and the full browser UI of the original demo is not included (only the audio worklets and the WebSocket protocol).

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 16 days ago

    • Free with an Agensi account

    Accounts
    Anthropic API keyDeepgram API keyElevenLabs API key
    Software
    Python 3.11+

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files
    Environment Variables

    Network access: WebSocket calls to Deepgram, Anthropic and ElevenLabs. Environment variables / files: reads your own API keys from a local .env. Terminal: pytest and uvicorn. No data leaves your machine except to those three providers.

    Listed16 days ago

    What's inside

    Frequently Asked Questions

    A prompt alone does not handle streaming microphone audio, end-of-turn detection, sentence-by-sentence TTS or interruptions. This module provides that orchestration around the LLM. It does not make the model itself faster or smarter.

    Possibly, but it was built and is documented for pt-BR only and has not been tested in other languages. You would change DEEPGRAM_LANGUAGE, the language_code in providers/elevenlabs_tts.py (currently "pt"), the voice id and the prompt. The sentence chunker's abbreviation list is also Portuguese-specific.

    Your own keys for Anthropic, Deepgram and ElevenLabs, billed by those providers. The offline test suite (pytest -q) needs no keys.

    Yes. You provide an object with a synchronous run(name, args) method and a tool schema in Messages API format. Keep run() fast so the tool_use and tool_result are written to the history atomically. For slow remote calls, SKILL.md describes the asyncio.to_thread plus shield approach.

    No. Under 1.5 s voice-to-voice is a design target, not a measured result, and the package has not been benchmarked against the live APIs. Each turn emits a metrics event, and SKILL.md explains how to measure median and p95 on your own setup.

    No. It streams browser audio over a WebSocket (PCM16, 16 kHz in and 24 kHz out). Telephony would need a bridge that converts the audio format, which is not included.

    New in Agents & Orchestration

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Free