Skip to content

feat(tts): add aivis_tts_python (Aivis Cloud, Japanese realtime HTTP streaming) - #2280

Open
Therealratoshen wants to merge 1 commit into
TEN-framework:mainfrom
Therealratoshen:feat/aivis-tts
Open

feat(tts): add aivis_tts_python (Aivis Cloud, Japanese realtime HTTP streaming)#2280
Therealratoshen wants to merge 1 commit into
TEN-framework:mainfrom
Therealratoshen:feat/aivis-tts

Conversation

@Therealratoshen

Copy link
Copy Markdown

Summary

Adds a new TTS extension aivis_tts_python backed by Aivis Cloud API and wires it into the voice-assistant example as voice_assistant_aivis.

Aivis is a Japanese-focused realtime TTS provider with public HTTP API and WAV streaming — fills the regional TTS gap (Supertone sunsets 2026-08-31, signup already closed).

Changes

  • ai_agents/agents/ten_packages/extension/aivis_tts_python/ — new extension modeled on the existing Gradium/Rime HTTP TTS extensions:
    • AsyncTTS2HttpExtension subclass streaming POST /v1/tts/synthesize via httpx.AsyncClient.
    • WavStreamParser strips the WAV header so the first PCM chunk reaches TEN immediately, giving the base class a correct TTFB measurement.
    • 401/403 → INVALID_KEY_ERROR; cancellation → FLUSH; other HTTP errors → ERROR.
    • output_format is forced to wav because TEN needs raw PCM.
  • ai_agents/agents/examples/voice-assistant/tenapp/property.json — appends voice_assistant_aivis (Deepgram ja STT + OpenAI LLM + Aivis TTS + main_control + message_collector).
  • ai_agents/.env.example — documents AIVIS_API_KEY, AIVIS_MODEL_UUID, AIVIS_BASE_URL alongside the other TTS providers.

Test plan

  • tests/test_config.py — 4 unit tests (validation, default param normalization, client-only key stripping, URL construction) pass without TEN runtime.
  • Run tests/bin/start end-to-end in a TEN checkout where the runtime has been built (task install && task build in ai_agents/) — this requires Docker on macOS and so could not be done in this PR's environment. Same prerequisite as every other TTS extension's tests (verified against Gradium).

Notes

  • Default AIVIS_MODEL_UUID points at Aivis's public default model (a59cb814-0083-4369-8542-f51a29e72af7).
  • No secrets in tree; all keys come from environment.
  • License: Apache-2.0 (matches the rest of the repo).

Made with Cursor

- Add aivis_tts_python under ten_packages/extension/ (AsyncTTS2HttpExtension
  subclass that streams Aivis Cloud TTS WAV and yields PCM to TEN).
- Append voice_assistant_aivis graph (Deepgram ja STT + OpenAI LLM + Aivis
  TTS + main_control + message_collector).
- Document AIVIS_API_KEY / AIVIS_MODEL_UUID / AIVIS_BASE_URL in
  .env.example alongside the other TTS providers.
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