(improvement)(chat) Support large models qianfan, zhipu, Azure, LocalAi, Dashscope, and handle the apiKey configuration as hidden. (#1552)

This commit is contained in:
lexluo09
2024-08-11 23:28:24 +08:00
committed by GitHub
parent 2f2f493d17
commit 8b01dac8d4
12 changed files with 315 additions and 184 deletions

View File

@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
@Service
public class DashscopeModelFactory implements ModelFactory, InitializingBean {
public static final String PROVIDER = "DASHSCOPE";
public static final String DEFAULT_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1";
@Override
public ChatLanguageModel createChatModel(ChatModelConfig modelConfig) {
@@ -21,6 +22,7 @@ public class DashscopeModelFactory implements ModelFactory, InitializingBean {
.modelName(modelConfig.getModelName())
.temperature(modelConfig.getTemperature() == null ? 0L :
modelConfig.getTemperature().floatValue())
.topP(modelConfig.getTopP())
.build();
}