mirror of
https://github.com/home-assistant/core.git
synced 2026-09-26 09:23:17 -04:00
Use OpenAPI 3.1.0 format for litellm (#182926)
This commit is contained in:
@@ -38,8 +38,10 @@ def _format_tool(
|
||||
custom_serializer: Callable[[Any], Any] | None,
|
||||
) -> ChatCompletionFunctionToolParam:
|
||||
"""Format tool specification."""
|
||||
unsupported_keys = {"oneOf", "anyOf", "allOf"}
|
||||
schema = to_openapi(tool.parameters, custom_serializer=custom_serializer)
|
||||
unsupported_keys = {"oneOf", "anyOf", "allOf", "enum", "not"}
|
||||
schema = to_openapi(
|
||||
tool.parameters, custom_serializer=custom_serializer, openapi_version="3.1.0"
|
||||
)
|
||||
schema = {k: v for k, v in schema.items() if k not in unsupported_keys}
|
||||
|
||||
tool_spec = FunctionDefinition(
|
||||
|
||||
Reference in New Issue
Block a user