mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-13 07:02:34 +00:00
feat: optional apiKey field for Ollama service
This commit is contained in:
parent
98c3d5073c
commit
4586838610
5 changed files with 36 additions and 6 deletions
|
|
@ -104,9 +104,14 @@ public class CompletionClientProvider {
|
|||
.getService(OllamaSettings.class)
|
||||
.getState()
|
||||
.getHost();
|
||||
return new OllamaClient.Builder()
|
||||
.setHost(host)
|
||||
.build(getDefaultClientBuilder());
|
||||
var builder = new OllamaClient.Builder()
|
||||
.setHost(host);
|
||||
|
||||
String apiKey = getCredential(CredentialKey.OLLAMA_API_KEY);
|
||||
if (apiKey != null && !apiKey.isBlank()) {
|
||||
builder.setApiKey(apiKey);
|
||||
}
|
||||
return builder.build(getDefaultClientBuilder());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ public class LlamaServerPreferencesForm {
|
|||
.withLabel(CodeGPTBundle.get("settingsConfigurable.shared.apiKey.label"))
|
||||
.resizeX(false)
|
||||
.withComment(
|
||||
CodeGPTBundle.get("settingsConfigurable.service.llama.apiKey.comment"))
|
||||
CodeGPTBundle.get("settingsConfigurable.shared.apiKey.comment"))
|
||||
.withCommentHyperlinkListener(UIUtil::handleHyperlinkClicked)
|
||||
.createPanel();
|
||||
return withEmptyLeftBorder(FormBuilder.createFormBuilder()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue