🌍 AI Travel Agent with Microsoft Agent Framework (.NET)
📋 Scenario Overview
This example demonstrates how to build an intelligent travel planning agent using the Microsoft Agent Framework for .NET. The agent can automatically generate personalized day-trip itineraries for random destinations around the world.
Key Capabilities:
- 🎲 Random Destination Selection: Uses a custom tool to pick vacation spots
- 🗺️ Intelligent Trip Planning: Creates detailed day-by-day itineraries
- 🔄 Real-time Streaming: Supports both immediate and streaming responses
- 🛠️ Custom Tool Integration: Demonstrates how to extend agent capabilities
🔧 Technical Architecture
Core Technologies
- Microsoft Agent Framework: Latest .NET implementation for AI agent development
- Azure OpenAI (Responses API): Uses the Azure OpenAI Responses API for model inference
- Azure Identity: Secure sign-in via
AzureCliCredential(az login) - Secure Configuration: Environment-based endpoint management
Key Components
- AIAgent: The main agent orchestrator that handles conversation flow
- Custom Tools:
GetRandomDestination()function available to the agent - Responses Client: Azure OpenAI Responses-based conversation interface
- Streaming Support: Real-time response generation capabilities
Integration Pattern
mermaid
graph LR
A[User Request] --> B[AI Agent]
B --> C[Azure OpenAI (Responses API)]
B --> D[GetRandomDestination Tool]
C --> E[Travel Itinerary]
D --> E🚀 Getting Started
Prerequisites
- .NET 10 SDK or higher
- An Azure subscription with an Azure OpenAI resource and a model deployment
- The Azure CLI — sign in with
az login
Required Environment Variables
bash
# zsh/bash