A .NET console application that leverages OpenAI's GPT-3.5 API to provide intelligent product recommendations based on user-specified categories.
- Category-based product recommendations using GPT-3.5
- Simple console interface for user interaction
- Secure API key management through configuration
- Robust error handling and JSON response parsing
- Clean architecture with separated data access layer
- .NET 6.0 or higher
- OpenAI API key
- Visual Studio 2022 or preferred .NET IDE
- Clone the repository:
git clone https://github.com/dwarkeshv/PromptNet.git- Navigate to the project directory:
cd PromptNet-
Configure your OpenAI API key:
- Open
appsettings.json - Replace the placeholder API key with your actual OpenAI API key
- Open
-
Build and run the application:
dotnet build
dotnet run- Launch the application
- Enter a product category when prompted
- The application will return AI-powered recommendations for products in that category
The application uses appsettings.json for configuration:
{
"OpenAI": {
"ApiKey": "your-api-key-here"
}
}The application includes comprehensive error handling for:
- HTTP request failures
- JSON parsing errors
- General exceptions
- API key is stored in configuration file
- Never commit your actual API key to version control
- Use environment variables or secure secrets management in production
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.