mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
[fix][chat]Model provider is case sensitive.#1739
This commit is contained in:
@@ -25,7 +25,7 @@ public class ChatModelParameters {
|
||||
"", "string", MODULE_NAME, null, getModelNameDependency());
|
||||
|
||||
public static final Parameter CHAT_MODEL_API_KEY =
|
||||
new Parameter("apiKey", ModelProvider.DEMO_CHAT_MODEL.getApiKey(), "ApiKey", "",
|
||||
new Parameter("apiKey", "", "ApiKey", "",
|
||||
"password", MODULE_NAME, null, getApiKeyDependency());
|
||||
|
||||
public static final Parameter CHAT_MODEL_ENDPOINT = new Parameter("endpoint", "llama_2_70b",
|
||||
|
||||
@@ -123,7 +123,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentDOMapper, AgentDO> implem
|
||||
}
|
||||
try {
|
||||
chatQueryService.parseAndExecute(ChatParseReq.builder().chatId(-1)
|
||||
.agentId(agent.getId()).queryText(example).build());
|
||||
.agentId(agent.getId()).queryText(example).user(User.getDefaultUser()).build());
|
||||
} catch (Exception e) {
|
||||
log.warn("agent:{} example execute failed:{}", agent.getName(), example);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Map;
|
||||
public class ModelProvider {
|
||||
|
||||
public static final ChatModelConfig DEMO_CHAT_MODEL =
|
||||
ChatModelConfig.builder().provider("open_ai").baseUrl("https://api.openai.com/v1")
|
||||
ChatModelConfig.builder().provider("OPEN_AI").baseUrl("https://api.openai.com/v1")
|
||||
.apiKey("demo").modelName("gpt-4o-mini").temperature(0.0).timeOut(60L).build();
|
||||
|
||||
private static final Map<String, ModelFactory> factories = new HashMap<>();
|
||||
|
||||
@@ -65,11 +65,11 @@ public class LLMConfigUtils {
|
||||
|
||||
ChatModelConfig chatModelConfig;
|
||||
if (type.isOllam) {
|
||||
chatModelConfig = ChatModelConfig.builder().provider("ollama").baseUrl(baseUrl)
|
||||
chatModelConfig = ChatModelConfig.builder().provider("OLLAMA").baseUrl(baseUrl)
|
||||
.modelName(modelName).temperature(temperature).timeOut(60000L).build();
|
||||
} else {
|
||||
chatModelConfig =
|
||||
ChatModelConfig.builder().provider("open_ai").baseUrl(baseUrl).apiKey(apiKey)
|
||||
ChatModelConfig.builder().provider("OPEN_AI").baseUrl(baseUrl).apiKey(apiKey)
|
||||
.modelName(modelName).temperature(temperature).timeOut(60000L).build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user