2 Building Your First Agent Step by Step
This chapter covers
- Building a simple AI-powered console application with Agent Framework
- Obtaining and securing API keys for OpenAI and Azure OpenAI
- Creating a basic console application for querying a GPT model
- Creating your first AI agent
Let’s dive into practical applications with Agent Framework and see how to build AI-powered apps that use large language models. We’ll start with a simple console app that interacts with OpenAI’s GPT models, then move on to an agent that can control a robot car. You’ll also learn how to obtain and secure API keys, set up your development environment, connect Agent Framework to GPT models, and expose native (C#) functions as tools.
2.1 A Robot Car Story
Imagine a robot car that can sense fire danger and escape independently. While this concept may sound like something out of science fiction, it represents a real pet project that sparked the journey behind this book. The idea of creating an autonomous vehicle capable of detecting and responding to potential fire hazards highlights the fascinating intersection of robotics, sensor technology, and machine learning. This project was built on a very low budget, with a focus on exploring how these technologies could run in the .NET ecosystem on an IoT (Internet of Things) device.