Skip to content

AlanTanner/ChatGPT-.NET-CLI

Repository files navigation

ChatGPT-.NET-CLI

Build/Test visitors

⚠️ You will need an OpenAI API to build this app

This is a basic .NET command line client for OpenAI's chatGPT. It uses the unoffical OPENAI .NET SDK betalgo/openai created by Betalgo.

Defult Settings

  1. Currently set ot use the ChatGPT 3.5-Turbo model.
  2. ChatGPT replies are in green, while user input are in white.
  3. The first system param set for ChatGPT is "Introduce yourself".

Screenshot 2023-03-11 at 6 06 56 PM

Requirement

  1. An active OpenAI API key
  2. .NET 7 Installed on your machine to build the app

Getting Started

  1. open the Cmd or Terminal to the base folder '/ChatGPT-.NET-CLI'
  2. ensure that .NET & is installed

Store OpenAI API keys

  1. added the API key to your user secrets
dotnet user-secrets init
dotnet user-secrets set "OpenAIServiceOptions:ApiKey" "YOUR_OPENAI_API_KEY"

Build The Project

  1. build the project
dotnet build ChatGPT-.NET-CLI.sln
  1. Currently it is set to build to the '/bin/Debug/net7.0' folder

Start the app

  1. From the base folder you can run the following
dotnet run bin/Debug/net7.0/ChatGPTDemo