KeyserDSoze / OpenSource.OpenAi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C#/.NET SDK for accessing the OpenAI GPT-3 API

A simple C# .NET wrapper library to use with OpenAI's GPT-3 API. More context on Roger Pincombe's blog and forked from OpenAI-API-dotnet.

This repository is available to transfer to the OpenAI organization if they so choose to accept it.

Requirements

This library targets .NET standard 2.0 and above.

Advertising

Watch out my Rystem framework to be able to do .Net webapp faster (easy integration with repository pattern or CQRS for your Azure services).

Setup

Install package OpenSource.OpenAi from Nuget.
Here's how via command line:

Install-Package OpenSource.OpenAi

Documentation

Table of Contents

Dependency Injection

Add to service collection the UI service in your DI

var apiKey = configuration["Azure:ApiKey"];
var resourceName = configuration["Azure:ResourceName"];
var deploymentId = configuration["Azure:DeploymentId"];
services.AddOpenAi(settings =>
{
    settings.ApiKey = apiKey;
});

About

License:MIT License


Languages

Language:C# 93.7%Language:HTML 3.6%Language:CSS 2.7%