Skip to content

[voice] Add REST endpoint to get LLM tools#5654

Merged
holgerfriedrich merged 2 commits into
openhab:mainfrom
florian-h05:rest-llmtools
Jun 15, 2026
Merged

[voice] Add REST endpoint to get LLM tools#5654
holgerfriedrich merged 2 commits into
openhab:mainfrom
florian-h05:rest-llmtools

Conversation

@florian-h05

Copy link
Copy Markdown
Contributor

No description provided.

@florian-h05 florian-h05 requested a review from a team as a code owner June 14, 2026 14:51
@florian-h05 florian-h05 marked this pull request as draft June 14, 2026 16:17
Signed-off-by: Florian Hotze <dev@florianhotze.com>
@florian-h05

Copy link
Copy Markdown
Contributor Author

@holgerfriedrich Can you please have a look at this PR? It's only a new REST endpoint and I need it for the chat UI (which BTW is finished, just waiting for this endpoint).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new REST API endpoint under the existing voice REST resource to expose available LLM tools (id/label/description) for clients, along with DTO/mapping support and a unit test.

Changes:

  • Extend VoiceResource with GET /voice/llmtools returning a JSON list of tools (localized via Accept-Language).
  • Add LLMToolDTO and LLMToolMapper to convert LLMTool domain objects to REST DTOs.
  • Update VoiceResourceTest to cover the new endpoint.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
bundles/org.openhab.core.io.rest.voice/src/main/java/org/openhab/core/io/rest/voice/internal/VoiceResource.java Injects LLMToolRegistry and adds GET /llmtools endpoint returning mapped DTOs.
bundles/org.openhab.core.io.rest.voice/src/main/java/org/openhab/core/io/rest/voice/internal/LLMToolMapper.java New mapper from LLMTool to LLMToolDTO.
bundles/org.openhab.core.io.rest.voice/src/main/java/org/openhab/core/io/rest/voice/internal/LLMToolDTO.java New OpenAPI-annotated DTO representing an LLM tool for REST responses.
bundles/org.openhab.core.io.rest.voice/src/test/java/org/openhab/core/io/rest/voice/internal/VoiceResourceTest.java Updates constructor usage and adds a unit test for getLLMTools.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
@florian-h05

Copy link
Copy Markdown
Contributor Author

@holgerfriedrich Addressed Copilot review 👍

@holgerfriedrich holgerfriedrich merged commit d4d7455 into openhab:main Jun 15, 2026
5 checks passed
@holgerfriedrich holgerfriedrich added this to the 5.2 milestone Jun 15, 2026
@holgerfriedrich holgerfriedrich added the enhancement An enhancement or new feature of the Core label Jun 15, 2026
@florian-h05 florian-h05 deleted the rest-llmtools branch June 15, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature of the Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants