A console chat application built with .NET 9 using OpenAI. It processes text input from the user and provides responses using the OpenAI API.
- AI abstraction using Microsoft.Extensions.AI
- Real-time chat with OpenAI API
- Chat history tracking: System, User, and Assistant roles
- Streaming response support
- .NET 8 SDK or higher
- OpenAI API Key
- Visual Studio Code or any C# development environment
- git clone https://github.com/yilmazmustafayilmaz/MY.ChatAppAI.git
- cd MY.ChatAppAI
- dotnet add package OpenAI
- dotnet add package Microsoft.Extensions.AI.OpenAI --prerelease
- dotnet add package Microsoft.Extensions.Configuration
- dotnet add package Microsoft.Extensions.Configuration.UserSecrets
- dotnet user-secrets init
- dotnet user-secrets set OpenAIKey
- dotnet user-secrets set ModelName
dotnet run Type your questions in the terminal to get AI responses.
Your prompt: Which books would you recommend?
AI Response: Hello! What genre are you interested in, and what reading intensity are you looking for?