Using Gemini LLM from Java with LangChain4j
summary
Shows Java code using Vertex AI + LangChain4j to run Gemini 1.5 Flash (multimodal, 1M‑token context) and an open variant locally. Demos include hello‑world and streaming responses, chat memory (keeps last 20 messages), image captioning, structured extraction into typed objects, prompt templates and few‑shot sentiment, RAG over a PDF using text-embedding-gecko with an in‑memory vector store, and function/multi‑tool calling. Also runs Gemma via testcontainers locally. All examples compile and run in the presenter’s demo environment.
AI-written summary · about
chapters (16)
- 0:00Introduction and speaker background
- 2:34AI landscape and Google's LLMs
- 13:32Java integration with LLMs
- 16:00Hello World with Gemini
- 17:23Streaming responses
- 18:47Chat memory and conversation
- 22:18Multimodal capabilities
- 24:06Data extraction from text
- 27:36Prompt templates
- 30:27Text classification
- 30:48Retrieval Augmented Generation
- 38:43Function calling basics
- 42:16Advanced function calling
- 44:24Multi-function calling
- 46:06Running Gemma locally
- 49:21Q&A and resources
