refactor: Abstract ExternalAgentProvider for upstream EVA contribution#12
Merged
jamestwhedbee merged 3 commits intomainfrom Mar 31, 2026
Merged
Conversation
Extract provider-agnostic bridge from Telnyx-specific implementation to enable upstream EVA to support multiple hosted voice agent APIs (ElevenLabs, Deepgram, OpenAI Realtime, etc.) Architecture: - New `eva.assistant.external` package with shared ABCs and generic bridge - `ExternalAgentProvider` ABC: plugin interface for hosted voice APIs (create_transport, setup, teardown, fetch_intended_speech, webhook routes) - `ExternalAgentBridgeServer`: provider-agnostic WebSocket bridge with audio routing, VAD observation, and output persistence - `ExternalAgentConfig` base + `TelnyxExternalAgentConfig` subclass - `TelnyxProvider`: concrete implementation with Call Control transport, assistant manager, DV webhooks, and Conversations API enrichment - Provider factory: `get_provider(config)` with lazy-import registry - Old module paths preserved as thin re-exports for backward compatibility (TelephonyBridgeConfig, TelephonyBridgeServer, etc.) Adding a new provider requires only a new `providers/xxx/` directory with config, transport, and setup — no changes to bridge, worker, runner, or metrics pipeline. Targets upstream roadmap item: 'Extended Leaderboard - native voice agent APIs beyond Pipecat'
Old module paths now raise ImportError with migration guidance. Tests updated to import directly from new locations. No aliases (TelephonyBridgeConfig, TelephonyBridgeServer, etc.).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the Telnyx telephony bridge into a clean provider-based abstraction so that upstream ServiceNow/eva can easily extend EVA to support additional hosted voice agent APIs (ElevenLabs Conversational AI, Deepgram Voice Agent, OpenAI Realtime, etc.).
This is prep for an upstream issue targeting the Extended Leaderboard roadmap item:
Architecture
New
eva.assistant.externalpackageKey abstractions
ExternalAgentProviderABC — plugin interface for hosted voice agent APIs:create_transport()— transport connection to the external agentsetup()/teardown()— run-level lifecycle (e.g., create/restore assistant config)fetch_intended_speech()— post-call enrichment for metricsregister_webhook_routes()— provider-specific webhook endpoints (e.g., DV webhook)get_active_transport()— media stream routingExternalAgentBridgeServer— provider-agnostic bridge handling:ExternalAgentConfigbase +TelnyxExternalAgentConfigsubclass with discriminatorAdding a new provider
Only requires a new
providers/xxx/directory with config, transport, and setup. No changes to bridge, worker, runner, or metrics pipeline.Backward compatibility
TelephonyBridgeConfig→ alias forTelnyxExternalAgentConfigTelephonyBridgeServer→ alias forExternalAgentBridgeServerEVA_MODEL__SIP_URI, etc.) continue to workpipecat_logs.jsonlfilename kept for upstream metrics compat)Context
EVA_FRAMEWORKdirection from PR cleanup: Minimize upstream diff, remove Telnyx refs from core, rewrite docs #14 but at the transport/provider level rather than the Pipecat server level