Site icon Stuff I've learned recently…

The Magic of AI Services with LangChain4J

My latest video is called The Magic of AI Services with LangChain4J:

Call AI functionality with a single interface definition using LangChain4J

The LangChain4J project lets you define Java interfaces that get implemented automatically by the framework. It’s about the easiest way I’ve ever seen to interact with AI tools.

The logo in the thumbnail comes from the LangChain4J project. It’s a parrot sitting on a saucer under a coffee cup:

Presumably that’s a stochastic parrot. 🙂

Here is a summary of the video in five bullet points, using the YouTube Summary plugin from Glasp, which works with ChatGPT (emphasis added):



As I mentioned in yesterday’s (Nov 5, 2023) Tales from the jar side newsletter, my favorite example uses a Java record:

along with an “extractor” inteface:

All you have to do is create the service and call the method:

Hard to be much simpler than that. 🙂

This example (in its Java 8 variation), along with others discussed in the video, come from the langchain4j-examples project on GitHub. I ported them to Java 17 so I could use records, text blocks, and so on.

I hope you enjoy the video. I plan to make more videos related to the LangChain4J project, so please subscribe if you want to learn how to use it effectively.

Exit mobile version