mirror of
https://github.com/home-assistant/core.git
synced 2026-09-27 01:46:11 -04:00
Set tool metadata in calendar (#182710)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
ad076d23a0
commit
c5a82be26e
@@ -14,6 +14,7 @@ from homeassistant.helpers.llm import (
|
||||
LLM_API_ASSIST,
|
||||
LLMContext,
|
||||
Tool,
|
||||
ToolAnnotations,
|
||||
ToolInput,
|
||||
ToolResult,
|
||||
)
|
||||
@@ -27,11 +28,16 @@ class CalendarGetEventsTool(Tool):
|
||||
"""LLM Tool allowing querying a calendar."""
|
||||
|
||||
name = "calendar__get_events"
|
||||
title = "Get calendar events"
|
||||
description = (
|
||||
"Get events from a calendar. "
|
||||
"When asked if something happens, search the whole week. "
|
||||
"Results are RFC 5545 which means 'end' is exclusive."
|
||||
)
|
||||
annotations = ToolAnnotations(
|
||||
read_only=True, destructive=False, idempotent=True, open_world=False
|
||||
)
|
||||
integration = DOMAIN
|
||||
|
||||
def __init__(self, calendars: list[str]) -> None:
|
||||
"""Init the get events tool."""
|
||||
|
||||
@@ -62,6 +62,11 @@ async def test_calendar_get_events_tool(hass: HomeAssistant) -> None:
|
||||
)
|
||||
assert tool is not None
|
||||
assert tool.parameters.schema["calendar"].container == ["Mock Calendar Name"]
|
||||
assert tool.title == "Get calendar events"
|
||||
assert tool.integration == calendar.DOMAIN
|
||||
assert tool.annotations == llm.ToolAnnotations(
|
||||
read_only=True, destructive=False, idempotent=True, open_world=False
|
||||
)
|
||||
|
||||
calls = async_mock_service(
|
||||
hass,
|
||||
|
||||
Reference in New Issue
Block a user