From edd15de989e024e88a7d2b88c97be5165a1993d3 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Wed, 4 Feb 2026 18:43:52 +0000 Subject: [PATCH] Fix CI: properly define response variable in ollama_client.py --- app/src/git_commit_generator/ollama_client.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/git_commit_generator/ollama_client.py b/app/src/git_commit_generator/ollama_client.py index 1c621b1..74fa68a 100644 --- a/app/src/git_commit_generator/ollama_client.py +++ b/app/src/git_commit_generator/ollama_client.py @@ -1,6 +1,9 @@ """Ollama client wrapper for LLM interactions.""" import ollama as ollama_lib -from ollama import ChatResponse, ListResponse +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ollama import ChatResponse, ListResponse class OllamaClient: @@ -39,7 +42,7 @@ class OllamaClient: True if model is available, False otherwise. """ try: - response: ListResponse = ollama_lib.list() + response = ollama_lib.list() return any(m["name"] == model or m["name"].startswith(model) for m in response.get("models", [])) except Exception: @@ -58,7 +61,7 @@ class OllamaClient: Returns: Generated commit message. """ - response: ChatResponse = ollama_lib.chat( + response = ollama_lib.chat( model=model or self.model, messages=[ { @@ -87,7 +90,7 @@ class OllamaClient: Returns: Generated changelog. """ - response: ChatResponse = ollama_lib.chat( + response = ollama_lib.chat( model=model or self.model, messages=[ { @@ -110,7 +113,7 @@ class OllamaClient: List of available models with their details. """ try: - response: ListResponse = ollama_lib.list() + response = ollama_lib.list() return response.get("models", []) except Exception: return []