mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 21:17:08 +00:00
(improvement)(chat) Support embedding store configuration. (#1363)
This commit is contained in:
@@ -13,15 +13,16 @@ import java.time.Duration;
|
||||
|
||||
@Service
|
||||
public class AzureModelFactory implements ModelFactory, InitializingBean {
|
||||
public static final String PROVIDER = "AZURE";
|
||||
|
||||
@Override
|
||||
public ChatLanguageModel createChatModel(ChatModelConfig chatModel) {
|
||||
public ChatLanguageModel createChatModel(ChatModelConfig modelConfig) {
|
||||
AzureOpenAiChatModel.Builder builder = AzureOpenAiChatModel.builder()
|
||||
.endpoint(chatModel.getBaseUrl())
|
||||
.apiKey(chatModel.getApiKey())
|
||||
.deploymentName(chatModel.getModelName())
|
||||
.temperature(chatModel.getTemperature())
|
||||
.timeout(Duration.ofSeconds(chatModel.getTimeOut() == null ? 0L : chatModel.getTimeOut()));
|
||||
.endpoint(modelConfig.getBaseUrl())
|
||||
.apiKey(modelConfig.getApiKey())
|
||||
.deploymentName(modelConfig.getModelName())
|
||||
.temperature(modelConfig.getTemperature())
|
||||
.timeout(Duration.ofSeconds(modelConfig.getTimeOut() == null ? 0L : modelConfig.getTimeOut()));
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
@@ -39,6 +40,6 @@ public class AzureModelFactory implements ModelFactory, InitializingBean {
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
ModelProvider.add(Provider.AZURE, this);
|
||||
ModelProvider.add(PROVIDER, this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user