HTTP Adapter¶
HTTP agent adapter — sends audio to an API endpoint.
http
¶
HTTP agent adapter — sends audio to an API endpoint.
HttpAgent
¶
HttpAgent(*, url: str, parser: ResponseParser | None = None, method: str = 'POST', headers: dict[str, str] | None = None, audio_field: str = 'audio', format_field: str = 'format', timeout: float = 60.0)
Agent adapter that sends audio to an HTTP endpoint.
Sends audio as base64-encoded JSON and parses the response using an optional ResponseParser.
Usage
agent = HttpAgent( url="http://localhost:8000/voice-agent", parser=russo.parsers.GeminiResponseParser(), ) response = await agent.run(audio)
Source code in src/russo/adapters/http.py
run
async
¶
run(audio: Audio) -> AgentResponse
Send audio to the HTTP endpoint and parse the response.