refactor: removed method from provider, should use model capabilities instead

refactor: cleanup temperature factory method
This commit is contained in:
Fahad
2025-10-02 11:08:56 +04:00
parent 9c11ecc4bf
commit a254ff2220
25 changed files with 105 additions and 224 deletions

View File

@@ -422,13 +422,17 @@ class SimpleTool(BaseTool):
estimated_tokens = estimate_tokens(prompt)
logger.debug(f"Prompt length: {len(prompt)} characters (~{estimated_tokens:,} tokens)")
# Resolve model capabilities for feature gating
capabilities = self._model_context.capabilities
supports_thinking = capabilities.supports_extended_thinking
# Generate content with provider abstraction
model_response = provider.generate_content(
prompt=prompt,
model_name=self._current_model_name,
system_prompt=system_prompt,
temperature=temperature,
thinking_mode=thinking_mode if provider.supports_thinking_mode(self._current_model_name) else None,
thinking_mode=thinking_mode if supports_thinking else None,
images=images if images else None,
)
@@ -485,9 +489,7 @@ class SimpleTool(BaseTool):
model_name=self._current_model_name,
system_prompt=system_prompt,
temperature=temperature,
thinking_mode=(
thinking_mode if provider.supports_thinking_mode(self._current_model_name) else None
),
thinking_mode=thinking_mode if supports_thinking else None,
images=images if images else None,
)