| | |
| | | openAiLlmConfig.setModel(getLlmModel()); |
| | | openAiLlmConfig.setDefaultEmbeddingModel(getLlmModel()); |
| | | String llmExtraConfig = getLlmExtraConfig(); |
| | | if (llmExtraConfig == null){ |
| | | return null; |
| | | } |
| | | Properties prop = PropertiesUtil.textToProperties(llmExtraConfig); |
| | | String chatPath = prop.getProperty("chatPath"); |
| | | String embedPath = prop.getProperty("embedPath"); |
| | | if (chatPath != null && !chatPath.isEmpty()) { |
| | | openAiLlmConfig.setChatPath(chatPath); |
| | | } |
| | | if (embedPath != null && !embedPath.isEmpty()) { |
| | | openAiLlmConfig.setEmbedPath(embedPath); |
| | | if (llmExtraConfig != null && !llmExtraConfig.isEmpty()){ |
| | | Properties prop = PropertiesUtil.textToProperties(llmExtraConfig); |
| | | String chatPath = prop.getProperty("chatPath"); |
| | | String embedPath = prop.getProperty("embedPath"); |
| | | if (chatPath != null && !chatPath.isEmpty()) { |
| | | openAiLlmConfig.setChatPath(chatPath); |
| | | } |
| | | if (embedPath != null && !embedPath.isEmpty()) { |
| | | openAiLlmConfig.setEmbedPath(embedPath); |
| | | } |
| | | } |
| | | return new OpenAILlm(openAiLlmConfig); |
| | | } |