diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/autoconfigure/dashscope/DashScopeAutoConfiguration.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/autoconfigure/dashscope/DashScopeAutoConfiguration.java index 0c5f3d73..4aa52327 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/autoconfigure/dashscope/DashScopeAutoConfiguration.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/autoconfigure/dashscope/DashScopeAutoConfiguration.java @@ -23,6 +23,7 @@ import java.util.Objects; import com.alibaba.cloud.ai.dashscope.api.DashScopeAgentApi; +import com.alibaba.cloud.ai.dashscope.api.DashScopeAudioApi; import com.alibaba.cloud.ai.dashscope.api.DashScopeImageApi; import com.alibaba.cloud.ai.dashscope.embedding.DashScopeEmbeddingModel; import com.alibaba.cloud.ai.dashscope.api.DashScopeApi; diff --git a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/dashscope/DashscopeAiTestConfiguration.java b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/dashscope/DashscopeAiTestConfiguration.java index 244509f5..cae334d6 100755 --- a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/dashscope/DashscopeAiTestConfiguration.java +++ b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/dashscope/DashscopeAiTestConfiguration.java @@ -1,6 +1,7 @@ package com.alibaba.cloud.ai.dashscope; import com.alibaba.cloud.ai.dashscope.api.DashScopeApi; +import com.alibaba.cloud.ai.dashscope.api.DashScopeAudioApi; import com.alibaba.cloud.ai.dashscope.api.DashScopeImageApi; import com.alibaba.cloud.ai.dashscope.audio.DashScopeAudioSpeechModelOpenAPI; import com.alibaba.cloud.ai.dashscope.audio.DashScopeAudioSpeechOptions; @@ -36,6 +37,11 @@ public DashScopeApi dashscopeApi() { return newDashScopeApi(getApiKey()); } + @Bean + public DashScopeAudioApi dashScopeAudioApi() { + return newDashScopeAudioApi(getApiKey()); + } + @Bean public DashScopeApi dashscopeChatApi() { return newDashScopeChatApi(getApiKey()); @@ -49,6 +55,10 @@ private DashScopeApi newDashScopeApi(String apiKey) { return new DashScopeApi(apiKey); } + private DashScopeAudioApi newDashScopeAudioApi(String apiKey) { + return new DashScopeAudioApi(apiKey); + } + private DashScopeImageApi newDashScopeImageApi(String apiKey) { return new DashScopeImageApi(apiKey); } @@ -79,14 +89,16 @@ public DashScopeImageModel dashscopeImageModel(DashScopeImageApi dashscopeImageA } @Bean - public DashScopeAudioSpeechModelOpenAPI dashscopeAudioSpeechModel(SpeechSynthesizer speechSynthesizer) { - return new DashScopeAudioSpeechModelOpenAPI(null, + public DashScopeAudioSpeechModelOpenAPI dashscopeAudioSpeechModel(DashScopeAudioApi dashScopeAudioApi, + SpeechSynthesizer speechSynthesizer) { + return new DashScopeAudioSpeechModelOpenAPI(dashScopeAudioApi, DashScopeAudioSpeechOptions.builder().withModel("sambert-zhichu-v1").build()); } @Bean - public DashScopeAudioTranscriptionModelOpenAPI dashscopeAudioTranscriptionModel(Transcription transcription) { - return new DashScopeAudioTranscriptionModelOpenAPI(null, + public DashScopeAudioTranscriptionModelOpenAPI dashscopeAudioTranscriptionModel(DashScopeAudioApi dashScopeAudioApi, + Transcription transcription) { + return new DashScopeAudioTranscriptionModelOpenAPI(dashScopeAudioApi, DashScopeAudioTranscriptionOptions.builder().withModel("paraformer-v2").build()); } diff --git a/spring-ai-alibaba-examples/playground-flight-booking/pom.xml b/spring-ai-alibaba-examples/playground-flight-booking/pom.xml index 4d14a533..b611b3a2 100644 --- a/spring-ai-alibaba-examples/playground-flight-booking/pom.xml +++ b/spring-ai-alibaba-examples/playground-flight-booking/pom.xml @@ -52,7 +52,7 @@ spring-boot-starter-validation - + org.springframework.boot spring-boot-starter-webflux