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