Añadir completion + ajustes del chat
This commit is contained in:
@@ -152,6 +152,14 @@ class OpenAIAdapter(ModelAdapter):
|
||||
}
|
||||
if tools:
|
||||
kwargs["tools"] = self._format_tools(tools)
|
||||
# Fuerza al modelo a usar un tool concreto para garantizar JSON por schema
|
||||
# (usado por /completions con json_schema). Ver ClaudeAdapter para la variante.
|
||||
force_tool = (config.extra or {}).get("force_tool")
|
||||
if force_tool:
|
||||
kwargs["tool_choice"] = {
|
||||
"type": "function",
|
||||
"function": {"name": force_tool},
|
||||
}
|
||||
|
||||
response = await self._client.chat.completions.create(**kwargs)
|
||||
choice = response.choices[0]
|
||||
|
||||
Reference in New Issue
Block a user