Fish Audio

Updated

Integrate Fish Audio TTS with the Conversational AI Engine.

Fish Audio provides text-to-speech (TTS) with flexible models and high-quality synthetic voices.

Sample configuration

The following examples show how to configure Fish Audio TTS when starting a conversational AI agent.

from agora_agent import Agent
from agora_agent.agentkit.vendors import FishAudioTTS

# client is your configured Agora client
agent = (
    Agent(client)
    .with_stt(...)  # configure your STT vendor
    .with_llm(...)  # configure your LLM vendor
    .with_tts(FishAudioTTS(
        key='your-fishaudio-key',  # omit key and set credential_mode='managed' to use Agora-managed mode
        reference_id='<voice_model_id>',
        backend='speech-1.5',
    ))
)
import { Agent, FishAudioTTS } from 'agora-agents';

// client is your configured Agora client
const agent = new Agent({ client })
  .withStt(/* configure your STT vendor */)
  .withLlm(/* configure your LLM vendor */)
  .withTts(new FishAudioTTS({
    key: 'your-fishaudio-key', // omit key and set credentialMode: CredentialMode.Managed to use Agora-managed mode
    referenceId: '<voice_model_id>',
    backend: 'speech-1.5',
  }));
import (
    "github.com/AgoraIO/agora-agents-go/v2/agentkit"
    "github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)

// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
  WithLlm(/* configure your LLM vendor */).
  WithTts(
    vendors.NewFishAudioTTS(vendors.FishAudioTTSOptions{
        Key:         "your-fishaudio-key", // omit Key and set CredentialMode: agentkit.CredentialModeManaged to use Agora-managed mode
        ReferenceID: "<voice_model_id>",
        Backend:     "speech-1.5",
    }),
)
  • Managed mode

    To use Fish Audio TTS with Agora-managed credentials, set credential_mode to "managed" in the tts block. When using managed mode, params.api_key is not required. Set params.backend to s2.1-pro. For more information, see Use managed mode.

    "tts": {
      "credential_mode": "managed",
      "vendor": "fishaudio",
      "params": {
        "reference_id": "<voice_model_id>",
        "backend": "s2.1-pro"
      }
    }
  • BYOK

    "tts": {
      "vendor": "fishaudio",
      "params": {
        "api_key": "<fishaudio_key>",
        "reference_id": "<voice_model_id>",
        "backend": "speech-1.5"
      }
    }

Key parameters

The following parameters are required when using your own API key (BYOK). When using managed mode, api_key is not required. For more information, see Use managed mode.

params required
ParameterDescription
api_keystring
optional

The Fish Audio API key used to authenticate requests. Required when using your own API key (BYOK).

reference_idstring
required

The identifier of the voice model to use for speech synthesis.

backendstring
required

The backend model version to use. For example, speech-1.5. For managed mode, use s2.1-pro.

The table extends beyond the current width. Scroll horizontally to view more columns.

Caution

The parameters listed on this page are validated for use with Conversational AI Engine. Required parameters must be provided as documented. Any additional parameters are passed through directly to the underlying vendor without validation. For a full list of supported options, refer to the Fish Audio documentation.

This integration is fully supported for use with Conversational AI Engine. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.