Update tradingagents/llm_clients/ollama_client.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
mohammed bensassi 2026-03-08 14:07:32 +01:00 committed by GitHub
parent f3eb1cb143
commit db23658c8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -14,8 +14,9 @@ class OllamaClient(BaseLLMClient):
def _normalize_base_url(self, url: str) -> str:
# ChatOllama expects the root URL, not a /v1 suffix.
if url.endswith("/v1/"):
return url[:-4]
if not url:
return url
url = url.rstrip("/")
if url.endswith("/v1"):
return url[:-3]
return url