def create_weather_agent() -> Agent: """ Factory function to create a weather-enabled agent. Returns: Configured agent instance with weather tool """ weather_tool = WeatherTool() custom_system_prompt = """You are a helpful weather assistant. When users ask about weather, use the get_weather tool to retrieve accurate information. Present weather data in a clear, conversational manner. If users don't specify a temperature unit, use celsius by default. Always mention the weather condition along with the temperature.""" return Agent( tools=[weather_tool], system_prompt=custom_system_prompt ) def main(): """Main execution function demonstrating agent capabilities""" # Create agent with weather tool agent = create_weather_agent() # Test Case 1: Simple weather query print("\n" + "="*80) print("TEST 1: Simple Weather Query") print("="*80) response = run_agent_loop( agent, "What's the weather like in Tokyo?", verbose=True ) print(response) # Test Case 2: Multi-city comparison print("\n" + "="*80) print("TEST 2: Multi-City Comparison") print("="*80) response = run_agent_loop( agent, "Compare the weather in London and Paris. Which city is warmer?", verbose=True ) print(response) # Test Case 3: Temperature unit conversion print("\n" + "="*80) print("TEST 3: Temperature Unit Preference") print("="*80) response = run_agent_loop( agent, "What's the temperature in New York in Fahrenheit?", verbose=True ) print(response) if __name__ == "__main__": main() __ __