Skip to content

feat(telnyx): add Telnyx assistant server framework#173

Open
lucasassisrosa wants to merge 1 commit into
ServiceNow:mainfrom
team-telnyx:feat/telnyx-framework-provider
Open

feat(telnyx): add Telnyx assistant server framework#173
lucasassisrosa wants to merge 1 commit into
ServiceNow:mainfrom
team-telnyx:feat/telnyx-framework-provider

Conversation

@lucasassisrosa

Copy link
Copy Markdown

Add Telnyx hosted AI Assistant as a first-class EVA framework alongside the existing Pipecat pipeline. The Telnyx provider connects to the Telnyx AI gateway via direct anonymous WebRTC (Verto JSON-RPC over WebSocket), bridges audio between the EVA user simulator (Twilio mulaw frames) and the Telnyx assistant (PCM 16 kHz), and enriches the audit log from the Telnyx Conversations API after the call ends.

New files:

  • src/eva/assistant/base_server.py AbstractAssistantServer: template-method base class that defines the EVA server contract (FastAPI WebSocket endpoint, audio bridging, tool execution via ToolExecutor, audit log, audio recording, save_outputs). Concrete servers implement start() and _shutdown(); the base handles stop(), output saving, and artifact generation.

  • src/eva/assistant/audio_bridge.py Audio format conversion utilities: mulaw 8 kHz ↔ PCM 16-bit 24 kHz resampling (libsoxr), PCM mixing, Twilio FrameSerializer protocol helpers, and framework/metrics log writers.

  • src/eva/assistant/telnyx_server.py TelnyxAssistantServer(AbstractAssistantServer): the main server. - TelnyxAssistantManager: REST CRUD for benchmark assistants. - TelnyxDirectSessionConfig: dataclass for WebRTC session params. - TelnyxVertoJsonRpcClient: Verto JSON-RPC over WebSocket. - TelnyxWebRTCClient: aiortc RTCPeerConnection + media management. - TelnyxAssistantServer: bridges EVA Twilio frames to Telnyx WebRTC, handles conversation events, tool calls, dynamic variables, audit-log enrichment from Conversations API.

  • src/eva/utils/audio_utils.py save_pcm_as_wav() helper shared by all server implementations.

  • tests/unit/assistant/test_telnyx_server.py (20 tests)

  • tests/unit/assistant/test_audio_bridge.py (3 tests)

Modified:

  • src/eva/models/config.py: Add framework field to RunConfig.
  • src/eva/orchestrator/worker.py: Add _get_server_class() dispatch.
  • pyproject.toml: Add aiortc, aiohttp, soxr dependencies.

Addresses VSDK-277 review: adds the missing Python EVA wrapper that subclasses AbstractAssistantServer, registers in worker.py, routes tool calls through ToolExecutor, and produces all required EVA artifacts.

Add Telnyx hosted AI Assistant as a first-class EVA framework alongside
the existing Pipecat pipeline.  The Telnyx provider connects to the Telnyx
AI gateway via direct anonymous WebRTC (Verto JSON-RPC over WebSocket),
bridges audio between the EVA user simulator (Twilio mulaw frames) and the
Telnyx assistant (PCM 16 kHz), and enriches the audit log from the Telnyx
Conversations API after the call ends.

New files:
  - src/eva/assistant/base_server.py
      AbstractAssistantServer: template-method base class that defines the
      EVA server contract (FastAPI WebSocket endpoint, audio bridging, tool
      execution via ToolExecutor, audit log, audio recording, save_outputs).
      Concrete servers implement start() and _shutdown(); the base handles
      stop(), output saving, and artifact generation.

  - src/eva/assistant/audio_bridge.py
      Audio format conversion utilities: mulaw 8 kHz ↔ PCM 16-bit 24 kHz
      resampling (libsoxr), PCM mixing, Twilio FrameSerializer protocol
      helpers, and framework/metrics log writers.

  - src/eva/assistant/telnyx_server.py
      TelnyxAssistantServer(AbstractAssistantServer): the main server.
        - TelnyxAssistantManager: REST CRUD for benchmark assistants.
        - TelnyxDirectSessionConfig: dataclass for WebRTC session params.
        - TelnyxVertoJsonRpcClient: Verto JSON-RPC over WebSocket.
        - TelnyxWebRTCClient: aiortc RTCPeerConnection + media management.
        - TelnyxAssistantServer: bridges EVA Twilio frames to Telnyx WebRTC,
          handles conversation events, tool calls, dynamic variables,
          audit-log enrichment from Conversations API.

  - src/eva/utils/audio_utils.py
      save_pcm_as_wav() helper shared by all server implementations.

  - tests/unit/assistant/test_telnyx_server.py (20 tests)
  - tests/unit/assistant/test_audio_bridge.py (3 tests)

Modified:
  - src/eva/models/config.py: Add framework field to RunConfig.
  - src/eva/orchestrator/worker.py: Add _get_server_class() dispatch.
  - pyproject.toml: Add aiortc, aiohttp, soxr dependencies.

Addresses VSDK-277 review: adds the missing Python EVA wrapper that
subclasses AbstractAssistantServer, registers in worker.py, routes tool
calls through ToolExecutor, and produces all required EVA artifacts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant