Skip to content

Commit

Permalink
data-extraction-langchain4j: Add an illustration schema
Browse files Browse the repository at this point in the history
  • Loading branch information
aldettinger committed Sep 4, 2024
1 parent af8f9f4 commit 8a380d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions data-extract-langchain4j/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ For instance, let's imagine an insurance company that would record the transcrip
There is probably a lot of valuable information that could be extracted from those conversation transcripts.
In this example, we'll convert those text conversations into Java Objects that could then be used in the rest of the Camel route.

image::schema.png[]

In order to achieve this extraction, we'll need a https://en.wikipedia.org/wiki/Large_language_model[Large Language Model (LLM)] that natively supports JSON output.
Here, we arbitrarily choose https://ollama.com/library/codellama[codellama] served through https://ollama.com/[ollama].
In order to invoke the served model, we'll use the high-level LangChain4j APIs like https://docs.langchain4j.dev/tutorials/ai-services[AiServices].
As we are using the Quarkus runtime, we can leverage all the advantages of the https://docs.quarkiverse.io/quarkus-langchain4j/dev/index.html[Quarkus LangChain4j extension].
In order to request inference to the served model, we'll use the high-level LangChain4j APIs like https://docs.langchain4j.dev/tutorials/ai-services[AiServices].
More precisely, we'll setup the https://docs.quarkiverse.io/quarkus-langchain4j/dev/index.html[Quarkus LangChain4j extension] to register an AiService bean.
Finally, we'll invoke the AiService extraction method via the https://camel.apache.org/camel-quarkus/latest/reference/extensions/bean.html[Camel Quarkus bean extension] .

=== Start the Large Language Model

Expand Down
Binary file added data-extract-langchain4j/schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data-extract-langchain4j/schemas-source.odp
Binary file not shown.

0 comments on commit 8a380d0

Please sign in to comment.