mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-11 13:10:50 +00:00
feat: add CodeGPT "native" API provider (#537)
* feat: support codegpt client * feat: add basic request handler test * refactor: minor cleanup
This commit is contained in:
parent
74fc2e6219
commit
0852c27170
36 changed files with 510 additions and 133 deletions
|
|
@ -8,6 +8,7 @@ import ee.carlrobert.codegpt.settings.GeneralSettings;
|
|||
import ee.carlrobert.codegpt.settings.service.ServiceType;
|
||||
import ee.carlrobert.codegpt.settings.service.anthropic.AnthropicSettings;
|
||||
import ee.carlrobert.codegpt.settings.service.azure.AzureSettings;
|
||||
import ee.carlrobert.codegpt.settings.service.codegpt.CodeGPTServiceSettings;
|
||||
import ee.carlrobert.codegpt.settings.service.google.GoogleSettings;
|
||||
import ee.carlrobert.codegpt.settings.service.llama.LlamaSettings;
|
||||
import ee.carlrobert.codegpt.settings.service.ollama.OllamaSettings;
|
||||
|
|
@ -188,7 +189,12 @@ public final class ConversationService {
|
|||
}
|
||||
|
||||
private static String getModelForSelectedService(ServiceType serviceType) {
|
||||
var application = ApplicationManager.getApplication();
|
||||
return switch (serviceType) {
|
||||
case CODEGPT -> application.getService(CodeGPTServiceSettings.class)
|
||||
.getState()
|
||||
.getChatCompletionSettings()
|
||||
.getModel();
|
||||
case OPENAI -> OpenAISettings.getCurrentState().getModel();
|
||||
case CUSTOM_OPENAI -> "CustomService";
|
||||
case ANTHROPIC -> AnthropicSettings.getCurrentState().getModel();
|
||||
|
|
@ -200,15 +206,12 @@ public final class ConversationService {
|
|||
? llamaSettings.getCustomLlamaModelPath()
|
||||
: llamaSettings.getHuggingFaceModel().getCode();
|
||||
}
|
||||
case OLLAMA -> ApplicationManager.getApplication()
|
||||
.getService(OllamaSettings.class)
|
||||
case OLLAMA -> application.getService(OllamaSettings.class)
|
||||
.getState()
|
||||
.getModel();
|
||||
case GOOGLE -> application.getService(GoogleSettings.class)
|
||||
.getState()
|
||||
.getModel();
|
||||
case GOOGLE ->
|
||||
ApplicationManager.getApplication()
|
||||
.getService(GoogleSettings.class)
|
||||
.getState()
|
||||
.getModel();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue