This package provides a simple and convenient way to integrate the OpenAI ChatGPT API 3.5 turbo Davinci model into your C# .NET core applications. With this integration, you can leverage the power of ChatGPT to add natural language conversation capabilities to your project.
$ dotnet add package ChatGPT-LayerThis package provides a simple and convenient way to integrate the OpenAI ChatGPT API 3.5 turbo Davinci model into your C# .NET core applications. With this integration, you can leverage the power of ChatGPT to add natural language conversation capabilities to your project.
Steps to integrate:
Get ChatGPT secret API key from OpenAI website.
DI in Program.cs:
builder.Services.AddScoped();
Inject service inside controller's constuctor:
private readonly OpenAIChatGPTAPIService _chatGPTservice;
public HomeController(OpenAIChatGPTAPIService openAIChatGPTService)
{
_chatGPTservice = openAIChatGPTService;
}
Send the query and api key to the package service to receive response from ChatGPT API:
var response = await _chatGPTservice.SendQueryAsync(_query, _apiKey); return Ok(respose);
This package is licensed under the MIT License - see the LICENSE file for details.