【依赖升级】AI:spring-ai-alibaba-starter 升级到最新,解决流式返回报错的问题
This commit is contained in:
parent
b9e8495712
commit
99d5e7c509
|
@ -49,7 +49,7 @@
|
|||
<!-- 通义千问 -->
|
||||
<groupId>com.alibaba.cloud.ai</groupId>
|
||||
<artifactId>spring-ai-alibaba-starter</artifactId>
|
||||
<version>1.0.0-M5.1</version>
|
||||
<version>${spring-ai.version}.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- 文心一言 -->
|
||||
|
|
|
@ -22,8 +22,7 @@ public class AiUtils {
|
|||
// noinspection EnhancedSwitchMigration
|
||||
switch (platform) {
|
||||
case TONG_YI:
|
||||
// TODO @芋艿:tongyi 暂时没 maxTokens 选项
|
||||
return DashScopeChatOptions.builder().withModel(model).withTemperature(temperature).build();
|
||||
return DashScopeChatOptions.builder().withModel(model).withTemperature(temperature).withMaxToken(maxTokens).build();
|
||||
case YI_YAN:
|
||||
return QianFanChatOptions.builder().model(model).temperature(temperature).maxTokens(maxTokens).build();
|
||||
case ZHI_PU:
|
||||
|
|
|
@ -28,6 +28,7 @@ public class TongYiChatModelTests {
|
|||
.withModel("qwen1.5-72b-chat") // 模型
|
||||
// .withModel("deepseek-r1") // 模型(deepseek-r1)
|
||||
// .withModel("deepseek-v3") // 模型(deepseek-v3)
|
||||
// .withModel("deepseek-r1-distill-qwen-1.5b") // 模型(deepseek-r1-distill-qwen-1.5b)
|
||||
.build());
|
||||
|
||||
@Test
|
||||
|
|
|
@ -3,7 +3,6 @@ package cn.iocoder.yudao.framework.ai.image;
|
|||
import com.alibaba.cloud.ai.dashscope.api.DashScopeImageApi;
|
||||
import com.alibaba.cloud.ai.dashscope.image.DashScopeImageModel;
|
||||
import com.alibaba.cloud.ai.dashscope.image.DashScopeImageOptions;
|
||||
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesis;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.ai.image.ImageOptions;
|
||||
|
@ -25,7 +24,7 @@ public class TongYiImagesModelTest {
|
|||
public void imageCallTest() {
|
||||
// 准备参数
|
||||
ImageOptions options = DashScopeImageOptions.builder()
|
||||
.withModel(ImageSynthesis.Models.WANX_V1)
|
||||
.withModel("wanx-v1")
|
||||
.withHeight(256).withWidth(256)
|
||||
.build();
|
||||
ImagePrompt prompt = new ImagePrompt("中国长城!", options);
|
||||
|
|
Loading…
Reference in New Issue