From 5434f3eb475a9633171617f617879b18b761f1a7 Mon Sep 17 00:00:00 2001 From: ydy0615 Date: Thu, 19 Feb 2026 18:55:49 +0800 Subject: [PATCH] fix(backend): rename thinking parameter to think for Ollama API compatibility The Ollama API expects "think" parameter instead of "thinking". Also updates the API base URL in the frontend configuration to point to the correct endpoint. --- backend/llm.py | 4 ++-- src/utils/config.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/llm.py b/backend/llm.py index e4aeb2d..c111beb 100644 --- a/backend/llm.py +++ b/backend/llm.py @@ -81,7 +81,7 @@ async def call_ollama(prompt: str, *, tag: str = "default", temperature: float = }, } if thinking: - kwargs["thinking"] = thinking + kwargs["think"] = thinking response = await client.chat(**kwargs) except Exception: @@ -117,7 +117,7 @@ async def call_ollama(prompt: str, *, tag: str = "default", temperature: float = if not content.strip(): logger.warning("[LLM][%s] empty content returned by model", tag) - return {"content": content, "thinking": thinking} + return {"content": content, "think": thinking} async def call_vlm_ocr(image_bytes: bytes, language: str = 'auto') -> str: start = time.perf_counter() diff --git a/src/utils/config.js b/src/utils/config.js index b3bb2aa..0e7612a 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -1,6 +1,6 @@ export const DEBUG = import.meta.env.DEV -const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'https://api.learnteach.tech:8002' +const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://149.104.29.239:8001' export const API_URL = import.meta.env.VITE_API_URL || `${API_BASE_URL}/v1/completions` export const OCR_URL = import.meta.env.VITE_OCR_URL || `${API_BASE_URL}/v1/ocr`