fix: Display only last Q&A in sensor state to prevent data truncation

- Show only the latest question and answer in sensor state
- Keep full conversation history in attributes
- Fix truncation issues in Home Assistant UI
- Maintain backwards compatibility
- No configuration changes required
This commit is contained in:
SMKRV
2024-12-10 16:19:17 +03:00
parent 5f0bd861a7
commit be06fddce1
2 changed files with 50 additions and 27 deletions
+2
View File
@@ -56,6 +56,8 @@ DEFAULT_NAME: Final = "HA Text AI"
DEFAULT_NAME_PREFIX = "ha_text_ai"
DEFAULT_CONTEXT_MESSAGES: Final = 5
TRUNCATION_INDICATOR = ""
# Parameter constraints
MIN_TEMPERATURE: Final = 0.0
MAX_TEMPERATURE: Final = 2.0