diff --git a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/AnthropicChatModelTest.java b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/AnthropicChatModelTest.java index 454fad47b..bbcc055a2 100644 --- a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/AnthropicChatModelTest.java +++ b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/AnthropicChatModelTest.java @@ -28,7 +28,7 @@ public class AnthropicChatModelTest { .baseUrl("https://aihubmix.com") .build()) .defaultOptions(AnthropicChatOptions.builder() - .model(AnthropicApi.ChatModel.CLAUDE_SONNET_4) + .model(AnthropicApi.ChatModel.CLAUDE_SONNET_4_5) .temperature(0.7) .maxTokens(4096) .build()) @@ -70,7 +70,7 @@ public class AnthropicChatModelTest { List messages = new ArrayList<>(); messages.add(new UserMessage("thkinking 下,1+1 为什么等于 2 ")); AnthropicChatOptions options = AnthropicChatOptions.builder() - .model(AnthropicApi.ChatModel.CLAUDE_SONNET_4) + .model(AnthropicApi.ChatModel.CLAUDE_SONNET_4_5) .thinking(AnthropicApi.ThinkingType.ENABLED, 3096) .temperature(1D) .build(); diff --git a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/LlamaChatModelTests.java b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/LlamaChatModelTests.java index 14f32e06e..080146e5a 100644 --- a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/LlamaChatModelTests.java +++ b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/LlamaChatModelTests.java @@ -9,8 +9,8 @@ import org.springframework.ai.chat.model.ChatResponse; import org.springframework.ai.chat.prompt.Prompt; import org.springframework.ai.ollama.OllamaChatModel; import org.springframework.ai.ollama.api.OllamaApi; +import org.springframework.ai.ollama.api.OllamaChatOptions; import org.springframework.ai.ollama.api.OllamaModel; -import org.springframework.ai.ollama.api.OllamaOptions; import reactor.core.publisher.Flux; import java.util.ArrayList; @@ -27,7 +27,7 @@ public class LlamaChatModelTests { .ollamaApi(OllamaApi.builder() .baseUrl("http://127.0.0.1:11434") // Ollama 服务地址 .build()) - .defaultOptions(OllamaOptions.builder() + .defaultOptions(OllamaChatOptions.builder() .model(OllamaModel.LLAMA3.getName()) // 模型 .build()) .build(); @@ -70,7 +70,7 @@ public class LlamaChatModelTests { // 准备参数 List messages = new ArrayList<>(); messages.add(new UserMessage("详细分析下,如何设计一个电商系统?")); - OllamaOptions options = OllamaOptions.builder() + OllamaChatOptions options = OllamaChatOptions.builder() .model("qwen3") .build(); @@ -83,5 +83,4 @@ public class LlamaChatModelTests { }).then().block(); } - } diff --git a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/OllamaChatModelTests.java b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/OllamaChatModelTests.java index d2bf68812..c03a5de15 100644 --- a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/OllamaChatModelTests.java +++ b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/OllamaChatModelTests.java @@ -9,7 +9,7 @@ import org.springframework.ai.chat.model.ChatResponse; import org.springframework.ai.chat.prompt.Prompt; import org.springframework.ai.ollama.OllamaChatModel; import org.springframework.ai.ollama.api.OllamaApi; -import org.springframework.ai.ollama.api.OllamaOptions; +import org.springframework.ai.ollama.api.OllamaChatOptions; import reactor.core.publisher.Flux; import java.util.ArrayList; @@ -26,7 +26,7 @@ public class OllamaChatModelTests { .ollamaApi(OllamaApi.builder() .baseUrl("http://127.0.0.1:11434") // Ollama 服务地址 .build()) - .defaultOptions(OllamaOptions.builder() + .defaultOptions(OllamaChatOptions.builder() // .model("qwen") // 模型(https://ollama.com/library/qwen) .model("deepseek-r1") // 模型(https://ollama.com/library/deepseek-r1) .build()) diff --git a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/ZhiPuAiChatModelTests.java b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/ZhiPuAiChatModelTests.java index 0b0b00693..18c317989 100644 --- a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/ZhiPuAiChatModelTests.java +++ b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/chat/ZhiPuAiChatModelTests.java @@ -23,7 +23,7 @@ import java.util.List; public class ZhiPuAiChatModelTests { private final ZhiPuAiChatModel chatModel = new ZhiPuAiChatModel( - new ZhiPuAiApi("2f35fb6ca4ea41fab898729b7fac086c.6ESSfPcCkxaKEUlR"), // 密钥 + ZhiPuAiApi.builder().apiKey("2f35fb6ca4ea41fab898729b7fac086c.6ESSfPcCkxaKEUlR").build(), // 密钥 ZhiPuAiChatOptions.builder() .model(ZhiPuAiApi.ChatModel.GLM_4.getName()) // 模型 .build() diff --git a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/websearch/AiBoChaWebSearchClientTest.java b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/websearch/AiBoChaWebSearchClientTest.java index 0a02ab589..e947e0fe3 100644 --- a/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/websearch/AiBoChaWebSearchClientTest.java +++ b/yudao-module-ai/yudao-module-ai-server/src/test/java/cn/iocoder/yudao/module/ai/framework/ai/core/websearch/AiBoChaWebSearchClientTest.java @@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.module.ai.framework.ai.core.webserch.AiWebSearchRequest; import cn.iocoder.yudao.module.ai.framework.ai.core.webserch.AiWebSearchResponse; import cn.iocoder.yudao.module.ai.framework.ai.core.webserch.bocha.AiBoChaWebSearchClient; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -17,6 +18,7 @@ public class AiBoChaWebSearchClientTest { "sk-40500e52840f4d24b956d0b1d80d9abe"); @Test + @Disabled public void testSearch() { AiWebSearchRequest request = new AiWebSearchRequest() .setQuery("阿里巴巴")