(improvement)(chat) Modify the default URL and model of zhipu, and enable search support for qwen. (#1578)

This commit is contained in:
lexluo09
2024-08-17 23:12:48 +08:00
committed by GitHub
parent 898c7100ba
commit 115cf19078
8 changed files with 40 additions and 17 deletions

View File

@@ -1,6 +1,5 @@
package dev.langchain4j.model.zhipu;
import dev.ai4j.openai4j.chat.ChatCompletionModel;
import dev.langchain4j.agent.tool.ToolSpecification;
import dev.langchain4j.data.message.AiMessage;
import dev.langchain4j.data.message.ChatMessage;
@@ -55,7 +54,7 @@ public class ZhipuAiChatModel implements ChatLanguageModel {
this.baseUrl = getOrDefault(baseUrl, "https://open.bigmodel.cn/");
this.temperature = getOrDefault(temperature, 0.7);
this.topP = topP;
this.model = getOrDefault(model, ChatCompletionModel.GPT_4.toString());
this.model = getOrDefault(model, ChatCompletionModel.GLM_4.toString());
this.maxRetries = getOrDefault(maxRetries, 3);
this.maxToken = getOrDefault(maxToken, 512);
this.client = ZhipuAiClient.builder()