This repository contains .NET samples for building ChatGPT plugins using C# and minimal APIs. The examples are based on OpenAI's ChatGPT plugin examples and have been adapted for the .NET platform.
The solution consists of a single project, Gpt.Plugins.TodoList
, which contains a minimal API implementation for a
simple Todo list plugin for ChatGPT, with no authentication.
This project demonstrates how to build a simple ChatGPT plugin using .NET 7 and C# 11 with minimal APIs, top-level statements, and records.
To run the Gpt.Plugin.TodoList project, follow these steps:
-
Clone the repository:
git clone https://github.com/r3core/chatgpt-plugin-samples-dotnet.git
-
Navigate to the
Gpt.Plugins.TodoList
directory:cd chatgpt-plugin-samples-dotnet/Gpt.Plugins.TodoList
-
Run the project:
dotnet run
This will launch the minimal API on the default port, usually 5000 for HTTP and 5001 for HTTPS.
-
Test the API endpoints using a tool like Postman or curl. The available endpoints are:
- POST
/todos/{username}
- GET
/todos/{username}
- DELETE
/todos/{username}
Please note that this example is intended for educational purposes and should not be used as-is for production applications.