From 5ad061f361d7747079be92a65ab992e2d11eeb58 Mon Sep 17 00:00:00 2001 From: whosmyqueen Date: Fri, 23 May 2025 11:20:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor(llm):=20=E7=AE=80=E5=8C=96=20Ollama=20?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=88=9D=E5=A7=8B=E5=8C=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了不必要的注释代码,清理了初始化过程 - 保留了 Ollama 客户端的原始逻辑 --- main/xiaozhi-server/core/providers/llm/ollama/ollama.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/main/xiaozhi-server/core/providers/llm/ollama/ollama.py b/main/xiaozhi-server/core/providers/llm/ollama/ollama.py index 29f691fbb..9ba9ce12f 100644 --- a/main/xiaozhi-server/core/providers/llm/ollama/ollama.py +++ b/main/xiaozhi-server/core/providers/llm/ollama/ollama.py @@ -10,10 +10,7 @@ class LLMProvider(LLMProviderBase): def __init__(self, config): self.model_name = config.get("model_name") self.base_url = config.get("base_url", "http://localhost:11434") - # Initialize OpenAI client with Ollama base URL - # 如果没有v1,增加v1 - # if not self.base_url.endswith("/v1"): - # self.base_url = f"{self.base_url}/v1" + # Initialize Ollama client with Ollama base URL self.client = ollama.Client( host=self.base_url,