Cast context size

This commit is contained in:
Nicolas Mowen 2026-02-28 08:01:47 -07:00
parent be743128aa
commit dd7427f94a
2 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ class LlamaCppClient(GenAIClient):
def get_context_size(self) -> int:
"""Get the context window size for llama.cpp."""
return self.provider_options.get("context_size", 4096)
return int(self.provider_options.get("context_size", 4096))
def _build_payload(
self,

View File

@ -85,8 +85,8 @@ class OllamaClient(GenAIClient):
def get_context_size(self) -> int:
"""Get the context window size for Ollama."""
return self.genai_config.provider_options.get("options", {}).get(
"num_ctx", 4096
return int(
self.genai_config.provider_options.get("options", {}).get("num_ctx", 4096)
)
def _build_request_params(