From 37919be70fec271602bc9792eb0df05f8cebbfb4 Mon Sep 17 00:00:00 2001 From: SMKRV Date: Mon, 1 Sep 2025 17:20:40 +0300 Subject: [PATCH] fix: Resolve hassfest validation errors in services.yaml - Remove invalid response schema from ask_question service - Add required target configuration for all services - Ensure compliance with Home Assistant service schema requirements --- custom_components/ha_text_ai/services.yaml | 47 ++++++++-------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/custom_components/ha_text_ai/services.yaml b/custom_components/ha_text_ai/services.yaml index 0b84324..cf7f7d9 100644 --- a/custom_components/ha_text_ai/services.yaml +++ b/custom_components/ha_text_ai/services.yaml @@ -4,6 +4,10 @@ ask_question: Send a question to the AI model and receive a detailed response. The response will be stored in the conversation history and can be retrieved later. This service now returns response data directly, eliminating the need to read from sensors. + target: + entity: + integration: ha_text_ai + domain: sensor fields: instance: name: Instance @@ -73,42 +77,15 @@ ask_question: max: 100000 step: 1 mode: box - response: - response_text: - description: "Full AI response text (unlimited length)" - example: "The answer to your question is..." - tokens_used: - description: "Total number of tokens consumed for this request" - example: 150 - prompt_tokens: - description: "Number of tokens used for the input prompt" - example: 50 - completion_tokens: - description: "Number of tokens used for the AI response" - example: 100 - model_used: - description: "AI model that generated the response" - example: "gpt-4o-mini" - instance: - description: "Instance name that processed the request" - example: "my_assistant" - question: - description: "The original question that was asked" - example: "What is the weather like?" - timestamp: - description: "ISO timestamp when the response was generated" - example: "2025-01-09T16:57:00.000Z" - success: - description: "Whether the request was successful" - example: true - error: - description: "Error message if the request failed (only present when success is false)" - example: "API rate limit exceeded" clear_history: name: Clear History description: >- Delete all stored questions and responses from the conversation history + target: + entity: + integration: ha_text_ai + domain: sensor fields: instance: name: Instance @@ -122,6 +99,10 @@ clear_history: get_history: name: Get History description: Retrieve conversation history with optional filtering and sorting + target: + entity: + integration: ha_text_ai + domain: sensor fields: instance: name: Instance @@ -182,6 +163,10 @@ get_history: set_system_prompt: name: Set System Prompt description: Set default system behavior instructions for all future conversations + target: + entity: + integration: ha_text_ai + domain: sensor fields: instance: name: Instance