BidiAgent (agent/agent.py)

harness-sdk · strands-py/src/strands/bidi/agent/agent.py · python · Apache-2.0
chat

Bidirectional AI agent that streams audio/text with tool execution and barge‑in support.

# Source: https://github.com/strands-agents/harness-sdk | License: Apache-2.0
# Provided via justclaw.it.com; keep this notice with the code.
"""Bidirectional Agent for real-time streaming conversations.

Provides real-time audio and text interaction through persistent streaming connections.
Unlike traditional request-response patterns, this agent maintains long-running
conversations where users can barge in, provide additional input, and receive
continuous responses including audio output.

Key capabilities:

- Persistent conversation connections with concurrent processing
- Real-time audio input/output streaming
- Automatic barge-in detection and tool execution
- Event-driven communication with model providers
"""

import asyncio
import copy
import logging
import threading
import uuid
fr

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key