http_request tool.
Features
- Built with AWS Strands library
- HTTP request tool for API integration
- Weather forecasting via National Weather Service API
- LiteLLM model integration
- Clean, production-ready code structure
Prerequisites
- Python 3.12 or higher
- uv - Fast Python package installer
- Nebius API key from Nebius Token Factory
Installation
Implementation
Model Configuration
Set up the Strands agent with LiteLLM:main.py
System Prompt
Define the agent’s capabilities:main.py
Agent Setup
main.py
Running the Agent
main.py
Usage
Run the agent:- Create a weather assistant
- Make API calls to the National Weather Service
- Compare temperatures between cities
- Output formatted weather information
Example Queries
- “What’s the weather in New York this weekend?”
- “Compare the temperature in Seattle and Portland”
- “Give me the forecast for San Francisco”
- “What’s the weather like in Chicago today?”
Technical Details
AWS Strands Components
Agent
Core agent with system prompt and tools
LiteLLMModel
Model provider supporting multiple LLM backends
http_request
Built-in tool for making HTTP API calls
strands_tools
Collection of pre-built tools
HTTP Request Tool
Thehttp_request tool allows the agent to:
- Make GET, POST, PUT, DELETE requests
- Handle JSON responses
- Set custom headers
- Parse and process API data
Extending the Agent
Add Custom Tools
Customize Model Parameters
Add Error Handling
Use Different APIs
AWS Strands Course
For a comprehensive guide to AWS Strands, check out the full course:AWS Strands Course
8-lesson progressive course covering agents, sessions, MCP, multi-agent patterns, and more
Course Topics
- Basic agent with simple tools
- Session management and persistent conversations
- Structured output with Pydantic
- MCP agent with external tool integration
- Human-in-the-loop patterns
- Multi-agent systems (orchestrator, swarm, graph, workflow)
- Observability with OpenTelemetry and Langfuse
- Guardrails and safety measures
Best Practices
System Prompts
System Prompts
- Be explicit about available capabilities
- Provide clear instructions for API usage
- Define expected output format
- Include error handling guidance
Tool Integration
Tool Integration
- Use built-in tools when available
- Keep custom tools focused
- Validate tool inputs
- Handle API rate limits
Model Selection
Model Selection
- Choose appropriate model size
- Adjust temperature for use case
- Set reasonable token limits
- Test with different models
Environment Variables
| Variable | Description | Required |
|---|---|---|
NEBIUS_API_KEY | Your Nebius API key | Yes |
Next Steps
AWS Strands Course
Complete 8-lesson course on AWS Strands
MCP Integration
Connect external services with MCP