类 DashScopeTTSModel.Builder

java.lang.Object
io.agentscope.core.model.tts.DashScopeTTSModel.Builder
封闭类:
DashScopeTTSModel

public static class DashScopeTTSModel.Builder extends Object
Builder for constructing DashScopeTTSModel instances.
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • apiKey

      public DashScopeTTSModel.Builder apiKey(String apiKey)
      Sets the API key for DashScope authentication.
      参数:
      apiKey - the API key
      返回:
      this builder
    • modelName

      public DashScopeTTSModel.Builder modelName(String modelName)
      Sets the TTS model name.

      Available models:

      • qwen3-tts-flash - Fast Qwen3 TTS
      • qwen-tts - Standard Qwen TTS
      • sambert-zhimao-v1 - Sambert Chinese voice
      • cosyvoice-v1 - CosyVoice model
      参数:
      modelName - the model name
      返回:
      this builder
    • voice

      public DashScopeTTSModel.Builder voice(String voice)
      Sets the default voice for synthesis.

      Common voices include: Cherry, zhimao, etc.

      参数:
      voice - the voice name
      返回:
      this builder
    • defaultOptions

      public DashScopeTTSModel.Builder defaultOptions(TTSOptions options)
      Sets the default TTS options.
      参数:
      options - default options
      返回:
      this builder
    • baseUrl

      public DashScopeTTSModel.Builder baseUrl(String baseUrl)
      Sets a custom base URL for DashScope API.
      参数:
      baseUrl - the base URL
      返回:
      this builder
    • httpTransport

      public DashScopeTTSModel.Builder httpTransport(HttpTransport transport)
      Sets the HTTP transport to use.
      参数:
      transport - the HTTP transport
      返回:
      this builder
    • build

      public DashScopeTTSModel build()
      Builds the DashScopeTTSModel instance.
      返回:
      a configured DashScopeTTSModel
      抛出:
      IllegalArgumentException - if apiKey is not set