code-examples
Overview
This repository contains practical code examples and tutorials designed to accompany blog posts on johnsosoka.com. Each example is self-contained and demonstrates specific concepts, patterns, or techniques in AI/LLM development, enterprise Java applications, and desktop automation.
The examples range from production-ready patterns (like PII masking middleware) to exploratory projects demonstrating emerging frameworks like Spring AI and LangChain4J.
Contents
Python Examples
| Example | Description | Key Technologies |
|---|---|---|
| custom-chatGPT-data | Working with custom data in ChatGPT | Python, OpenAI API |
| langchain-inference-masking | PII masking middleware for LangChain 1.0 | Python, LangChain, Privacy/Security |
| token-based-llm-langraph-router | Multi-agent query routing with conditional edges | Python, LangGraph, LLM Routing |
Java Examples
| Example | Description | Key Technologies |
|---|---|---|
| spring-ai-booking | Hotel booking agent using Spring AI | Java, Spring Boot, Spring AI, OpenAI |
| langchain-booking-tests | Unit testing strategies for LLM-driven applications | Java, LangChain4J, Testing |
| object-mapping | ModelMapper library tutorial | Java, ModelMapper |
| spotify-spring-security | OAuth 2.0 authentication with Spotify API | Java, Spring Security, OAuth 2.0 |
Automation & Infrastructure
| Example | Description | Key Technologies |
|---|---|---|
| ahk-recipes-examples | AutoHotkey automation recipes and snippets | AutoHotkey |
| terraform | Infrastructure as code examples | Terraform |
Usage
Each example is organized in its own directory with complete setup instructions. Navigate to the specific example directory and follow the README.md for:
- Prerequisites and dependencies
- Configuration steps (API keys, environment variables)
- Running instructions
- Usage examples
Quick Start Example
# Clone the repository
git clone https://github.com/johnsosoka/code-examples.git
cd code-examples
# Navigate to a specific example
cd python/langchain-inference-masking
# Follow the example's README for setup and executionRepository Structure
code-examples/
├── python/ # Python-based AI/LLM examples
├── java/ # Java Spring and AI framework examples
├── terraform/ # Infrastructure as code examples
├── ahk/ # AutoHotkey automation scripts
└── README.md
Related Resources
- Blog: johnsosoka.com — Detailed explanations and tutorials
- License: GPL v3 — See LICENSE for details