Skip to content

Commit 4d5a52a

Browse files
committed
Fix tools when bringing in easy-rag
1 parent 967ebd4 commit 4d5a52a

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

content/modules/ROOT/pages/module-private-docs.adoc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ In the new terminal, add this extension by running the following command:
175175
[.console-input]
176176
[source,bash,subs="+attributes,macros+"]
177177
----
178-
./mvnw quarkus:add-extension -Dextension=easy-rag
178+
./mvnw quarkus:add-extension -Dextension="io.quarkiverse.langchain4j:quarkus-langchain4j-easy-rag:\${quarkus.langchain4j.version}"
179179
----
180180

181181
You will see that a new extension was added to your application:
@@ -295,15 +295,26 @@ There is a fair bit of code in this file, but the main thing you should pay atte
295295

296296
To wire everything up, we will need to tell the AI Service about this tool. In the `src/main/java/org/parasol/ai` folder, open the `ClaimService.java` class again.
297297

298-
Find the `@RegisterAiService` annotation. We need to register the `NotificationService` class as a tool. Go ahead and replace the existing line with the following:
298+
We need to register the `NotificationService` class as a tool. Find the `chat` method and add the following annotation to it:
299299

300300
[.console-input]
301301
[source,java,subs="+attributes,macros+"]
302302
----
303-
@RegisterAiService(modelName = "parasol-chat", tools = NotificationService.class)
303+
@ToolBox(NotificationService.class)
304304
----
305305

306-
By doing this we have now registered the `NotificationService` file as class that contains one or more `@Tool` annotated methods.
306+
[NOTE]
307+
====
308+
You may need to add the following import to the `ClaimService` class if it isn't already added for you:
309+
310+
[.console-input]
311+
[source,java,subs="+attributes,macros+"]
312+
----
313+
import io.quarkiverse.langchain4j.ToolBox;
314+
----
315+
====
316+
317+
By doing this we have now registered the `NotificationService` file as class that contains one or more `@Tool` annotated methods. These methods become available to the LLM to be called.
307318

308319
=== Convert chat from streaming to synchronous
309320

0 commit comments

Comments
 (0)