notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 47e942be28f80c78efea5488409046412a6f4abd
parent 403b0f7696a747b1df5d959f343bda5a6a70ed06
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  7 Apr 2025 20:07:54 -0400

dave: fix ollama config if enabled

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
M.envrc | 2++
Mcrates/notedeck_dave/src/lib.rs | 4++--
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.envrc b/.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 || : diff --git a/crates/notedeck_dave/src/lib.rs b/crates/notedeck_dave/src/lib.rs @@ -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();