mirror of
https://github.com/home-assistant/core.git
synced 2026-05-30 04:05:01 +01:00
Fix invalid schema for HassStartTimer in OpenRouter extension (#172153)
This commit is contained in:
@@ -88,9 +88,13 @@ def _format_tool(
|
||||
custom_serializer: Callable[[Any], Any] | None,
|
||||
) -> ChatCompletionFunctionToolParam:
|
||||
"""Format tool specification."""
|
||||
unsupported_keys = {"oneOf", "anyOf", "allOf"}
|
||||
schema = convert(tool.parameters, custom_serializer=custom_serializer)
|
||||
schema = {k: v for k, v in schema.items() if k not in unsupported_keys}
|
||||
|
||||
tool_spec = FunctionDefinition(
|
||||
name=tool.name,
|
||||
parameters=convert(tool.parameters, custom_serializer=custom_serializer),
|
||||
parameters=schema,
|
||||
)
|
||||
if tool.description:
|
||||
tool_spec["description"] = tool.description
|
||||
|
||||
Reference in New Issue
Block a user