A weather query agent built with the Embabel framework.
- Extracts city name from user input using LLM
- Retrieves geographic coordinates using OpenWeather Geocoding API
- Fetches weather data using OpenWeather Weather API
- Generates friendly weather responses using LLM
- Java 21+
- Maven 3.8+
- OpenWeather API Key (free tier available)
- DeepSeek API Key (for LLM)
export OPENWEATHER_API_KEY=your-openweather-api-key
export DEEPSEEK_API_KEY=your-deepseek-api-keyOr create a .env file:
OPENWEATHER_API_KEY=your-openweather-api-keyDEEPSEEK_API_KEY=your-deepseek-api-key./mvnw spring-boot:runWhen the shell starts, you can query weather:
x "What's the weather like in London?"
embabel01/
├── src/main/java/com/example/embabel01/
│ ├── agent/
│ │ └── WeatherAgent.java # Main weather agent
│ ├── config/
│ │ └── RestTemplateConfig.java # RestTemplate configuration
│ └── Embabel01Application.java # Spring Boot entry point
├── src/main/resources/
│ └── application.yml # Application configuration
├── src/test/ # Unit and integration tests
└── pom.xml # Maven configuration
spring:
application:
name: embabel-agent-appembabel:
models:
default-llm: deepseek-chatagent:
platform:
models:
deepseek:
api-key: ${DEEPSEEK_API_KEY}openweather:
api:
key: ${OPENWEATHER_API_KEY}./mvnw testUnit tests use Embabel's FakeOperationContext to test agent actions without calling actual LLMs or APIs.
Integration tests test the complete agent workflow with mocked LLM responses.
- Framework: Spring Boot 3.5.13
- Agent Framework: Embabel 0.3.5
- LLM Provider: DeepSeek
- Weather API: OpenWeatherMap
- HTTP Client: Spring RestTemplate
Contributions are welcome! Please feel free to submit issues and pull requests.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.