"You can't use AI directly in Java!" Hold my prompt...
summary
Demonstrates that Java calls LLMs with no HttpResponse parsing by showing three approaches: raw HTTP to OpenAI, Google Vertex AI JDK, and Spring AI / LangChain4j as adapters so the model can be swapped without changing business code. Shows chat session keeps history so follow-ups use prior context, converts model outputs into Java types including Boolean returned from model and a custom Person object extracted from free text, and builds a working AI car-recommender backend (budget int, fuel enum, brand list, features list) that behaves but still exhibits hallucinations and token-limit considerations.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:11Java can use AI directly
- 3:49Python dominates AI
- 5:59First AI in Java
- 7:26Google Vertex AI with Java
- 9:52Context handling in AI
- 11:37Simulating UI with Java
- 13:24Spring AI framework
- 17:11LangChain4J benefits
- 19:24AI sentiment analysis
- 22:57Extracting structured data
- 28:53AI car recommender
- 41:17AI cost and models
- 44:07Summary
- 44:50Q&A
related talks
52mAI for Busy Java Developers
48mBuilding AI Powered Applications with Java
52mAI/ML Introduction for Java Developers
47mJava Meets AI: Integrating LLMs into Your Applications with LangChain4j
45mJakarta EE Meets AI
53mJava meets AI: Build LLM-Powered Apps with LangChain4j
46mAI-powered Java Developers
55mAI in Java? Meet LangChain4j and Build Intelligent Services
