Move OLLAMA_API_KEY_VAR to ollama crate

Co-authored-by: Oliver Azevedo Barnes <oliver@liquidvoting.io>
This commit is contained in:
Umesh Yadav 2025-08-26 15:51:45 +05:30
parent f15d4eea6d
commit 9936f65cd3
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View file

@ -14,8 +14,9 @@ use language_model::{
};
use menu;
use ollama::{
ChatMessage, ChatOptions, ChatRequest, ChatResponseDelta, KeepAlive, OLLAMA_API_URL,
OllamaFunctionTool, OllamaToolCall, get_models, show_model, stream_chat_completion,
ChatMessage, ChatOptions, ChatRequest, ChatResponseDelta, KeepAlive, OLLAMA_API_KEY_VAR,
OLLAMA_API_URL, OllamaFunctionTool, OllamaToolCall, get_models, show_model,
stream_chat_completion,
};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@ -33,7 +34,6 @@ use crate::ui::InstructionListItem;
const OLLAMA_DOWNLOAD_URL: &str = "https://ollama.com/download";
const OLLAMA_LIBRARY_URL: &str = "https://ollama.com/library";
const OLLAMA_SITE: &str = "https://ollama.com/";
const OLLAMA_API_KEY_VAR: &str = "OLLAMA_API_KEY";
const PROVIDER_ID: LanguageModelProviderId = LanguageModelProviderId::new("ollama");
const PROVIDER_NAME: LanguageModelProviderName = LanguageModelProviderName::new("Ollama");

View file

@ -6,6 +6,7 @@ use serde_json::Value;
use std::time::Duration;
pub const OLLAMA_API_URL: &str = "http://localhost:11434";
pub const OLLAMA_API_KEY_VAR: &str = "OLLAMA_API_KEY";
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[derive(Clone, Serialize, Deserialize, Debug, Eq, PartialEq)]