diff --git a/homeassistant/components/anthropic/config_flow.py b/homeassistant/components/anthropic/config_flow.py index 7fc8e70c962a..7baecd07347f 100644 --- a/homeassistant/components/anthropic/config_flow.py +++ b/homeassistant/components/anthropic/config_flow.py @@ -577,7 +577,7 @@ class ConversationSubentryFlowHandler(ConfigSubentryFlow): "format": { "type": "json_schema", "schema": { - **to_openapi(location_schema), + **to_openapi(location_schema, openapi_version="3.1.0"), "additionalProperties": False, }, } diff --git a/homeassistant/components/anthropic/entity.py b/homeassistant/components/anthropic/entity.py index e62a2122bb4e..7f079e17c989 100644 --- a/homeassistant/components/anthropic/entity.py +++ b/homeassistant/components/anthropic/entity.py @@ -150,7 +150,9 @@ def _format_tool( ) -> ToolParam: """Format tool specification.""" unsupported_keys = {"oneOf", "anyOf", "allOf"} - schema = to_openapi(tool.parameters, custom_serializer=custom_serializer) + 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} return ToolParam( @@ -1114,6 +1116,7 @@ class AnthropicBaseLLMEntity(CoordinatorEntity[AnthropicCoordinator]): custom_serializer=chat_log.llm_api.custom_serializer if chat_log.llm_api else llm.selector_serializer, + openapi_version="3.1.0", ), "additionalProperties": False, }, @@ -1162,6 +1165,7 @@ class AnthropicBaseLLMEntity(CoordinatorEntity[AnthropicCoordinator]): custom_serializer=chat_log.llm_api.custom_serializer if chat_log.llm_api else llm.selector_serializer, + openapi_version="3.1.0", ), ) )