From e83da97b8fb928aca67c8d53719987d9e1c8fa23 Mon Sep 17 00:00:00 2001 From: Jan Martiska Date: Wed, 20 Dec 2023 08:04:16 +0100 Subject: [PATCH] Minor Dev UI fixes for tools --- .../deployment/devui/Langchain4jDevUIProcessor.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkiverse/langchain4j/deployment/devui/Langchain4jDevUIProcessor.java b/core/deployment/src/main/java/io/quarkiverse/langchain4j/deployment/devui/Langchain4jDevUIProcessor.java index fc17c4575..6af18281d 100644 --- a/core/deployment/src/main/java/io/quarkiverse/langchain4j/deployment/devui/Langchain4jDevUIProcessor.java +++ b/core/deployment/src/main/java/io/quarkiverse/langchain4j/deployment/devui/Langchain4jDevUIProcessor.java @@ -26,7 +26,9 @@ CardPageBuildItem cardPage(List aiServices, List embeddingStoreBuildItem) { CardPageBuildItem card = new CardPageBuildItem(); addAiServicesPage(card, aiServices); - addToolsPage(card, toolsMetadataBuildItem); + if (toolsMetadataBuildItem != null) { + addToolsPage(card, toolsMetadataBuildItem); + } // for now, add the embedding store page only if there is a single embedding model and a single embedding store // if we allow more in the future, we need a way to specify which ones to use for the page if (embeddingModelBuildItem.size() == 1 && embeddingStoreBuildItem.size() == 1) { @@ -61,7 +63,7 @@ private void addToolsPage(CardPageBuildItem card, ToolsMetadataBuildItem metadat for (Map.Entry> toolClassEntry : metadata.entrySet()) { for (ToolMethodCreateInfo toolMethodCreateInfo : toolClassEntry.getValue()) { infos.add(new ToolMethodInfo(toolClassEntry.getKey(), - toolMethodCreateInfo.getMethodName(), + toolMethodCreateInfo.getToolSpecification().name(), toolMethodCreateInfo.getToolSpecification().description())); } }