mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 09:04:21 +01:00
dave: fix ollama config if enabled
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
2
.envrc
2
.envrc
@@ -13,6 +13,8 @@ source scripts/macos_build_secrets.sh || :
|
||||
export PATH=$PATH:$HOME/.cargo/bin
|
||||
export JB55=32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245
|
||||
|
||||
export OLLAMA_HOST=http://ollama.jb55.com
|
||||
|
||||
# simple todo reminders
|
||||
export TODO_FILE=TODO
|
||||
2>/dev/null todo.sh ls || :
|
||||
|
||||
@@ -356,7 +356,7 @@ impl Default for ModelConfig {
|
||||
impl ModelConfig {
|
||||
pub fn ollama() -> Self {
|
||||
ModelConfig {
|
||||
endpoint: std::env::var("OLLAMA_HOST").ok(),
|
||||
endpoint: std::env::var("OLLAMA_HOST").ok().map(|h| h + "/v1"),
|
||||
model: "hhao/qwen2.5-coder-tools:latest".to_string(),
|
||||
api_key: None,
|
||||
}
|
||||
@@ -382,8 +382,8 @@ impl Dave {
|
||||
}
|
||||
|
||||
pub fn new(render_state: Option<&RenderState>) -> Self {
|
||||
//let mut config = OpenAIConfig::new(); //.with_api_base("http://ollama.jb55.com/v1");
|
||||
let model_config = ModelConfig::default();
|
||||
//let model_config = ModelConfig::ollama();
|
||||
let client = Client::with_config(model_config.to_api());
|
||||
|
||||
let input = "".to_string();
|
||||
|
||||
Reference in New Issue
Block a user