fixed reasoning

This commit is contained in:
2026-06-10 14:37:27 +03:00
parent 905d756a25
commit 89158930ee
6 changed files with 47 additions and 22 deletions
+8 -4
View File
@@ -147,8 +147,9 @@ class LLMClient:
*,
temperature: float = 0.7,
model: str | None = None,
for_extraction: bool = False,
) -> dict[str, Any]:
use_tools = bool(tools) and self.tools_enabled
use_tools = bool(tools) and self.tools_enabled and not for_extraction
kwargs: dict[str, Any] = {
"model": model or self.model,
"messages": messages,
@@ -156,9 +157,12 @@ class LLMClient:
}
if use_tools:
kwargs["tools"] = tools
extra_body = self._reasoning_extra_body()
if extra_body:
kwargs["extra_body"] = extra_body
if for_extraction:
kwargs["extra_body"] = {"reasoning": {"effort": "none"}}
else:
extra_body = self._reasoning_extra_body()
if extra_body:
kwargs["extra_body"] = extra_body
response = await self.client.chat.completions.create(**kwargs)
message = response.choices[0].message