feat(llm): add thinking parameter support for Ollama API calls

Add optional thinking parameter to the call_ollama function and pass it from the request. Also enhance timezone handling in prompt generation to support configurable timezone preferences.
This commit is contained in:
2026-02-19 10:34:31 +08:00
parent aa6133e3ed
commit 065b4ac319
3 changed files with 41 additions and 22 deletions

View File

@@ -94,7 +94,12 @@ async def create_completion(request: Request, req: CompletionRequest):
thinking_level=req.model_thinking,
preferences=req.user_preferences
)
result = await call_ollama(prompt, tag=f"{request_id}-primary", temperature=0.7)
result = await call_ollama(
prompt,
tag=f"{request_id}-primary",
temperature=0.7,
thinking=req.model_thinking if req.model_thinking != "none" else None
)
content = result["content"] or ""
if not content.strip():