Skip to content

[Suggestion] Voice agent with per-turn dynamic tool availability control (Python) #581

Description

@deepgram-robot

What to build

A voice agent recipe that demonstrates dynamically controlling which tools/functions are available on each conversation turn based on the current conversation state — enabling phased workflows where tool access is granted or revoked as the conversation progresses.

Why this matters

Developers building complex voice agent workflows need fine-grained control over tool availability. For example, a banking voice agent should only offer transfer tools after identity verification, or a support agent should restrict escalation tools until troubleshooting steps are exhausted. Static tool configuration at connection time is insufficient for production agents with multi-phase conversations. This recipe shows how to manage tool availability dynamically during a live conversation using the Voice Agent API.

Suggested scope

  • Language: Python
  • Deepgram APIs: Voice Agent API (WebSocket)
  • Complexity: Intermediate
  • What to include:
    • State machine tracking conversation phases (e.g., greeting → verification → authorized actions)
    • Dynamic tool registration/deregistration based on phase transitions
    • Example scenario: customer service agent with phased tool access
    • Per-phase system prompt adjustments reflecting available tools
    • Logging of tool availability changes for debugging

Acceptance criteria

  • Runnable with minimal setup (clone, add API key, run)
  • README explains the pattern clearly
  • Uses current SDK version
  • Demonstrates at least 3 distinct conversation phases with different tool sets
  • Shows how tool availability changes are communicated to the LLM context

Raised by the DX intelligence system.


Queued by PM — Engineer will pick this up as a priority:user recipe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    action:generateQueue action: generate code examplespriority:userUser-submitted request — prioritizetype:queueIssue is in the automation queue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions