mirror of
https://gitee.com/zhijiantianya/ruoyi-vue-pro.git
synced 2026-03-22 05:07:17 +08:00
fixup! 支持 GROK
This commit is contained in:
@@ -309,6 +309,5 @@ public class AiAutoConfiguration {
|
||||
.toolCallingManager(getToolCallingManager())
|
||||
.build();
|
||||
return new DouBaoChatModel(openAiChatModel);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,6 @@ public class YudaoAiProperties {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class WebSearch {
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@ public class GrokChatModel implements ChatModel {
|
||||
|
||||
public static final String BASE_URL = "https://api.x.ai";
|
||||
public static final String COMPLETE_PATH = "/v1/chat/completions";
|
||||
|
||||
public static final String MODEL_DEFAULT = "grok-4-fast-reasoning\n";
|
||||
public static final String MODEL_DEFAULT = "grok-4-fast-reasoning";
|
||||
|
||||
/**
|
||||
* 兼容 OpenAI 接口,进行复用
|
||||
|
||||
@@ -65,7 +65,6 @@ public class AiUtils {
|
||||
case MOONSHOT:
|
||||
return MoonshotChatOptions.builder().model(model).temperature(temperature).maxTokens(maxTokens)
|
||||
.toolCallbacks(toolCallbacks).toolContext(toolContext).build();
|
||||
case GROK:
|
||||
case OPENAI:
|
||||
case GEMINI: // 复用 OpenAI 客户端
|
||||
case BAI_CHUAN: // 复用 OpenAI 客户端
|
||||
@@ -80,6 +79,9 @@ public class AiUtils {
|
||||
case OLLAMA:
|
||||
return OllamaOptions.builder().model(model).temperature(temperature).numPredict(maxTokens)
|
||||
.toolCallbacks(toolCallbacks).toolContext(toolContext).build();
|
||||
case GROK:
|
||||
return OpenAiChatOptions.builder().model(model).temperature(temperature).maxTokens(maxTokens)
|
||||
.toolCallbacks(toolCallbacks).toolContext(toolContext).build();
|
||||
default:
|
||||
throw new IllegalArgumentException(StrUtil.format("未知平台({})", platform));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user