Skip to content

[voice] Update HLI interface for LLM implementations#5345

Draft
GiviMAD wants to merge 1 commit intoopenhab:mainfrom
GiviMAD:voice/hli_llm
Draft

[voice] Update HLI interface for LLM implementations#5345
GiviMAD wants to merge 1 commit intoopenhab:mainfrom
GiviMAD:voice/hli_llm

Conversation

@GiviMAD
Copy link
Member

@GiviMAD GiviMAD commented Feb 11, 2026

WIP!

This PR add a new interpret method to the HumanLanguageInterpreter interface that instead of a string get an instance of InterpretationContext which contains a conversation with the previous messages and the last user request. It includes a default method implementation to prevent breaking current interpreters. The PR also introduces the interface for LLMTools.

Each conversation message have a role associated to it: USER, OPENHAB, THINKING, THINKING, TOOL_CALL, TOOL_RETURN. Messages can be written at once or part by part (methods addMessage and addToMessage of the Conversation instance) and they emit an event so the conversation changes can be listened on a dedicated topic (openhab/conversations/{conversation_id}).

The interpreter implementation will be called with a conversation its last message is the new text sent to interpret with the USER role and it has to add a new message to the conversation with the role OPENHAB as response. In the middle it can add messages with the THINKING/TOOL_CALL/TOOL_RETURN so someone listening to the events produced by the conversation can be aware that the interpreter is thinking or executing a tool.

The interpret rest API and console commands have been updated to allow passing a conversation id (a user defined id, a new conversation is created if not exists), and also tools ids and a location item id.

Also API and console command to view the conversation messages and delete them have been added.

Voice dialog processor have been updated also so a dialog can have a configured conversation and a set of tools.

TODO?: Add system prompt id to interpretation context and create a API/console to define the system prompts or let it for another PR?

Using the conversation in the console

# send a command to the standard interpreter with a conversation defined
voice interpret --hli system --conversation test_conversation turn on the light
Ok.
# list conversation messages
voice conversation test_conversation
USER|> turn on the light
OPENHAB|> Ok.

@rkoshak
Copy link

rkoshak commented Feb 11, 2026

@GiviMAD GiviMAD force-pushed the voice/hli_llm branch 2 times, most recently from 8cc11be to a67444a Compare February 11, 2026 20:59
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@GiviMAD
Copy link
Member Author

GiviMAD commented Feb 11, 2026

Make sure to coordinate this work with openhab/openhab-webui#2995 and https://github.com/openhab/openhab-addons/tree/main/bundles/org.openhab.binding.chatgpt

@rkoshak, thank you for the advice, yes I'm about to mention some people for them take a look and see if the changes makes sense to every body before going further, I just fixing some minor issues first.

@GiviMAD
Copy link
Member Author

GiviMAD commented Feb 11, 2026

@florian-h05 , @Artur-Fedjukevits , @digitaldan would you be able to take a look at the changes proposed here when you have a moment?

And also please ping other people that you know have been involved with the chatgpt binding or any other LLM interpreter that is available if any.

I would like to know if you think this change makes sense in order to improve the interpreter LLM implementations or if you see some flaws on it before finalizing the PR.

@digitaldan
Copy link
Contributor

Hi! I'll take a look this week, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments