Co-Authored-By: Classic298 <27028174+Classic298@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2026-08-16 22:56:19 -07:00
co-authored by Classic298
parent 62fc436999
commit 3258330729
3 changed files with 17 additions and 9 deletions
+4 -3
View File
@@ -2034,13 +2034,14 @@ def get_reasoning_format(model: dict) -> str | None:
Determine how reasoning should be included in reconstructed messages.
Returns:
'think_tags': Ollama expects <think> tags in content.
'thinking': Ollama expects reasoning in the native thinking field.
'think_tags': wrap reasoning in <think> tags inside content.
'reasoning_content': llama.cpp supports reasoning_content as a top-level field.
None: skip reasoning (safe default for strict providers).
"""
provider = model.get('provider', '')
if provider == 'ollama':
return 'think_tags'
if model.get('owned_by') == 'ollama':
return 'thinking'
if provider == 'llama.cpp':
return 'reasoning_content'
return None