You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2024/10/15 14:47:56 UTC
(camel-quarkus) branch main updated: langchain4j: document camel parameter binding usage (#6643)
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new fd5ab4539d langchain4j: document camel parameter binding usage (#6643)
fd5ab4539d is described below
commit fd5ab4539d8baff4a7462c6acd32727de8f28cac
Author: Alexandre Gallice <al...@gmail.com>
AuthorDate: Tue Oct 15 16:47:50 2024 +0200
langchain4j: document camel parameter binding usage (#6643)
---
.../pages/reference/extensions/langchain4j.adoc | 24 ++++++++++++++++++++++
.../runtime/src/main/doc/configuration.adoc | 18 ++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j.adoc
index 228bdac207..08444c83f1 100644
--- a/docs/modules/ROOT/pages/reference/extensions/langchain4j.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/langchain4j.adoc
@@ -59,3 +59,27 @@ In order to ensure alignment across all Quarkus and LangChain4j related dependen
Note that the import order is paramount when using maven `dependencyManagement`.
As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms.
+
+[id="extensions-langchain4j-additional-camel-quarkus-configuration"]
+== Additional Camel Quarkus configuration
+
+[id="extensions-langchain4j-configuration-using-camel-annotations-from-langchain4j-ai-service-method-parameters"]
+=== Using camel annotations from LangChain4j AI service method parameters
+
+The `camel-quarkus-langchain4j` extension make it possible to use camel parameter binding annotations with LangChain4j AI services.
+
+Let's see an example below:
+
+```
+@RegisterAiService
+@ApplicationScoped
+public interface CustomAiService {
+
+ @UserMessage("An LLM prompt that can use the method parameter {myHeaderInjectedIntoPrompt}.")
+ @Handler
+ String invokeLlm(@Header("myHeaderName") String myHeaderInjectedIntoPrompt);
+}
+```
+
+More details could be found about camel parameter binding annotations at https://camel.apache.org/manual/parameter-binding-annotations.html.
+
diff --git a/extensions/langchain4j/runtime/src/main/doc/configuration.adoc b/extensions/langchain4j/runtime/src/main/doc/configuration.adoc
new file mode 100644
index 0000000000..f14ab3bec9
--- /dev/null
+++ b/extensions/langchain4j/runtime/src/main/doc/configuration.adoc
@@ -0,0 +1,18 @@
+=== Using camel annotations from LangChain4j AI service method parameters
+
+The `camel-quarkus-langchain4j` extension make it possible to use camel parameter binding annotations with LangChain4j AI services.
+
+Let's see an example below:
+
+```
+@RegisterAiService
+@ApplicationScoped
+public interface CustomAiService {
+
+ @UserMessage("An LLM prompt that can use the method parameter {myHeaderInjectedIntoPrompt}.")
+ @Handler
+ String invokeLlm(@Header("myHeaderName") String myHeaderInjectedIntoPrompt);
+}
+```
+
+More details could be found about camel parameter binding annotations at https://camel.apache.org/manual/parameter-binding-annotations.html.
\ No newline at end of file