This is an example pet name generator app used in the OpenAI API quickstart tutorial. It uses the .NET 7.0 framework.
-
If you don’t have .NET SDK 7.0 installed, install it from here
-
Clone this repository
-
Generate OpenAi API key here
-
Paste API key value to appsettings.json file in following section:
"OpenAiConfig": { "ApiKey": "<paste your key here>" }
-
Navigate into the project directory
$ cd openai-quickstart-csharp/OpenAiQuickStartCSharp/ -
Run the app
$ dotnet run
-
Test your app:
Open app web page http://localhost:5078/
Or use curl:
$ curl --location 'http://localhost:5078/OpenAi' --header 'Content-Type: application/json' --data '{ "Animal": "Cat"}'
