fixed reasoning
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user