From 0e5c8567d470b7a390deaf613c26fe2b2b62c199 Mon Sep 17 00:00:00 2001 From: sigoden Date: Mon, 25 Dec 2023 08:05:06 +0800 Subject: refactor: ollam api_base configuration (#285) --- config.example.yaml | 2 +- src/client/ollama.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.example.yaml b/config.example.yaml index 975c0e1..d360a7b 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -41,7 +41,7 @@ clients: # See https://github.com/jmorganca/ollama - type: ollama - api_base: http://localhost:11434/api + api_base: http://localhost:11434 api_key: Basic xxx # Set authorization header chat_endpoint: /chat # Optional field models: diff --git a/src/client/ollama.rs b/src/client/ollama.rs index 91e7bb2..fc6e148 100644 --- a/src/client/ollama.rs +++ b/src/client/ollama.rs @@ -86,7 +86,7 @@ impl OllamaClient { let body = build_body(data, self.model.name.clone())?; - let chat_endpoint = self.config.chat_endpoint.as_deref().unwrap_or("/chat"); + let chat_endpoint = self.config.chat_endpoint.as_deref().unwrap_or("/api/chat"); let url = format!("{}{chat_endpoint}", self.config.api_base); -- cgit v1.2.3