The Magic of AI Services with LangChain4J

preview_player
Показать описание
LangChain4J is a port of the Python project LangChain to the Java world. It has many capabilities, but one particularly useful one is that it can generate AI “services” from a simple interface that interact with whatever language model you choose.

This video demonstrates:
* How to set up a Java project that uses LangChain4J
* How to log requests and responses
* How to submit requests to LLMs like OpenAI
* How to test the responses
* How the Gson parser works under the hood

Tales from the jar side:

Welcome to Tales from the jar side! New newsletter every Sunday, new newsletter video every Monday, and additional technical videos (Java, Gradle, JUnit, Spring, and lots more) every week.

Affiliate links:
These are products I use on a regular basis. If you click on them, your price doesn't change, but I may receive a small referral fee. Feel free to try them out.

This is a great program for transcribing videos and letting you edit them by editing the transcript. It also has several AI features like Studio Sound, Background Removal, Eye Tracking, Autodub, and more. I use it especially for YouTube Shorts.
This is about the best tool around for giving you statistics on YouTube videos.
I use this as my primary way of making screenshots. You can save them locally or to the cloud, crop and do other edits, add backgrounds, and more.
This is where my first book, "Making Java Groovy", was published, but you can use the link for any Manning books

00:00 - Welcome to Tales from the jar side
00:25 - Introducing LangChain4J
02:00 - langchain4j-examples project
02:46 - Setting up a LangChain4J project
03:37 - Hello, LangChain!
04:50 - PromptTemplates
06:48 - AI Services
08:19 - A Translator Service
10:39 - Sentiment Analyzer
13:07 - DateTimeExtractor
14:51 - Extracting a Record
15:38 - Adding Logging
Рекомендации по теме
Комментарии
Автор

Cool demo. The challenge with all these AI tools is they don't work 100% of the time. You can't rely on the response which makes them unsuitable for a large number of enterprisey tasks. There was a recent case of a airline company chatbot that advised a customer to cancel tickets to get a refund when there was a no-refund policy. The customer took the airline to court and court ruled in the customer's favor. Enterprises are shit scared of such things and rightly so.

lhxperimental
Автор

I'm using the Hugging Face LLM model with this, however the response of this llm model is not so accurate, I was curious if I can change the model type of it, as there are many freely available models in hugging face. And also if possible please provide a code snippet.

hrishikeshmishra
Автор

Was in your Functional Java session today. Dude this stuff is both cool and scary

magsteel
Автор

It's a very interesting video.
The LangChain4j is a very interesting project. For sure I will experiment somethig with it !!
Thanks

massimodaros
Автор

Thanks, that was very helpful! I am working on a Clojure wrapper for Langchain4j (I really hate having to use python from Java/Clojure). I see in the API that you can bypass the Annotation mechanism and create tool descriptors yourself and then stuff those into the builder. That would be best for me since Java Annotations are not so elegant in Clojure.

ElvinHoney
Автор

Fantastic video! Thanks for the very helpful explanation.

mckeeh
Автор

What a passioned and sympathic guy! Thank you!

jonescomas
Автор

How can I connect LangChain4J to work with MySQL database just like LangChain ?

mondrisokundolor
Автор

Thanks sir it was quite informative video.

freebusdoctor