mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-10 12:10:14 +00:00
fix: custom OpenAI service settings sync (#472)
This commit is contained in:
parent
7d075f6905
commit
b2d9442eba
2 changed files with 14 additions and 0 deletions
|
|
@ -51,6 +51,9 @@ public class GeneralSettings implements PersistentStateComponent<GeneralSettings
|
|||
if ("azure.chat.completion".equals(clientCode)) {
|
||||
state.setSelectedService(ServiceType.AZURE);
|
||||
}
|
||||
if ("custom.openai.chat.completion".equals(clientCode)) {
|
||||
state.setSelectedService(ServiceType.CUSTOM_OPENAI);
|
||||
}
|
||||
if ("llama.chat.completion".equals(clientCode)) {
|
||||
state.setSelectedService(ServiceType.LLAMA_CPP);
|
||||
var llamaSettings = LlamaSettings.getCurrentState();
|
||||
|
|
|
|||
|
|
@ -25,6 +25,17 @@ class GeneralSettingsTest : BasePlatformTestCase() {
|
|||
assertThat(openAISettings.model).isEqualTo("gpt-4")
|
||||
}
|
||||
|
||||
fun testCustomOpenAISettingsSync() {
|
||||
val conversation = Conversation()
|
||||
conversation.clientCode = "custom.openai.chat.completion"
|
||||
val settings = GeneralSettings.getInstance()
|
||||
settings.state.selectedService = ServiceType.OPENAI
|
||||
|
||||
settings.sync(conversation)
|
||||
|
||||
assertThat(settings.state.selectedService).isEqualTo(ServiceType.CUSTOM_OPENAI)
|
||||
}
|
||||
|
||||
fun testAzureSettingsSync() {
|
||||
val settings = GeneralSettings.getInstance()
|
||||
val conversation = Conversation()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue