From 6eecf17ed615d71fb9cea8dbb390c12694f80ea5 Mon Sep 17 00:00:00 2001 From: Denis Shulyaka Date: Tue, 22 Sep 2026 20:13:44 +0300 Subject: [PATCH] Use OpenAPI 3.1.0 format for litellm (#182926) --- homeassistant/components/litellm/entity.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/litellm/entity.py b/homeassistant/components/litellm/entity.py index aa7a542c805e..a1c84484e422 100644 --- a/homeassistant/components/litellm/entity.py +++ b/homeassistant/components/litellm/entity.py @@ -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(