Calling AI Tools from Java
summary
Shows concrete Java code that calls OpenAI (ChatGPT, Whisper, DALL·E), Anthropic Claude vision, Mistral (same API as OpenAI) and local Olama models (llama3, 5 3) via plain HTTP: uses Java 21 HTTP Client with Gson/Jackson, maps requests to records and sealed interfaces with compact constructors for validation, handles Whisper 25MB transcription chunks, generates MP3 via the TTS endpoint tts1/tts1_HD, saves/plays audio (JLayer) and decodes Base64 images; examples compile and run, token pricing ~ $10 per million input tokens.
AI-written summary · about
chapters (7)
- 0:00Introduction to AI in Java
- 8:10AI tools as REST services
- 15:43Text to speech demo
- 31:26Combining models with sealed interfaces
- 40:40Chat API integration
- 52:07Advanced features and tools
- 57:52Resources and Q&A
related talks
51mIntelligent Applications with Spring AI
52mAI for Busy Java Developers
55m"You can't use AI directly in Java!" Hold my prompt...
58mBuilding Your Own Private GenAI Chatbot With Java Tools – A Step-by-Step Adventure
55mAI in Java? Meet LangChain4j and Build Intelligent Services
48mBuilding AI Powered Applications with Java
02h 49mJava meets AI: Build LLM-Powered Apps with LangChain4j
54mAI 202: Next-Level AI Mastery for Java Developers
