Aggiungi supporto per il modello AzureOpenAI-Preview in ScenarioExecutionService
This commit is contained in:
@@ -323,6 +323,20 @@ public class ScenarioExecutionService {
|
|||||||
logger.info("AI model used: " + aiModel.getModel());
|
logger.info("AI model used: " + aiModel.getModel());
|
||||||
return azureOpenaichatModel;
|
return azureOpenaichatModel;
|
||||||
|
|
||||||
|
case "AzureOpenAI-Preview":
|
||||||
|
OpenAIClient openAIClient = new OpenAIClientBuilder()
|
||||||
|
.credential(new AzureKeyCredential(aiModel.getApiKey()))
|
||||||
|
.endpoint(aiModel.getEndpoint())
|
||||||
|
.buildClient();
|
||||||
|
AzureOpenAiChatOptions openAIChatOptions = AzureOpenAiChatOptions.builder()
|
||||||
|
.withDeploymentName(aiModel.getModel())
|
||||||
|
.withTemperature(aiModel.getTemperature())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
AzureOpenAiChatModel azureOpenaichatModel = new AzureOpenAiChatModel(openAIClient, openAIChatOptions);
|
||||||
|
logger.info("AI model used: " + aiModel.getModel());
|
||||||
|
return azureOpenaichatModel;
|
||||||
|
|
||||||
case "OpenAI":
|
case "OpenAI":
|
||||||
OpenAiApi openAiApi = new OpenAiApi(aiModel.getApiKey());
|
OpenAiApi openAiApi = new OpenAiApi(aiModel.getApiKey());
|
||||||
OpenAiChatOptions openAiChatOptions = OpenAiChatOptions.builder()
|
OpenAiChatOptions openAiChatOptions = OpenAiChatOptions.builder()
|
||||||
|
|||||||
Reference in New Issue
Block a user