Fitomad.OpenAI
0.2.0
See the version list below for details.
dotnet add package Fitomad.OpenAI --version 0.2.0
NuGet\Install-Package Fitomad.OpenAI -Version 0.2.0
<PackageReference Include="Fitomad.OpenAI" Version="0.2.0" />
paket add Fitomad.OpenAI --version 0.2.0
#r "nuget: Fitomad.OpenAI, 0.2.0"
// Install Fitomad.OpenAI as a Cake Addin
#addin nuget:?package=Fitomad.OpenAI&version=0.2.0
// Install Fitomad.OpenAI as a Cake Tool
#tool nuget:?package=Fitomad.OpenAI&version=0.2.0
OpenAI .NET library
Fitomad.OpenAI is a .NET library that allows you to access the powerful AI models from OpenAI, such as GPT, DALL-E, and Whisper, through a simple and intuitive interface. You can use this framework to generate text, code, images, audio, and more, with just a few lines of code.
Fitomad.OpenAI provides various options to customize your requests and responses. Whether you want to create a chatbot, a content generator, a sentiment analyzer, a translator, or any other AI-powered application, Fitomad.OpenAI can help you achieve your goals with ease and efficiency.
Dependency Injection
var aiSettings = new OpenAISettingsBuilder()
.WithApiKey(_apiKey)
.Build();
var services = new ServiceCollection();
services.AddOpenAIHttpClient(settings: aiSettings);
Chat Completion
ChatRequest request = new ChatRequestBuilder()
.WithModel(ChatModelKind.GPT_3_5_TURBO)
.WithSystemMessage("Eres un profesor de alumnos de 10 años.")
.WithUserMessage("Explícame qué es una estrella.")
.WithTemperatute(TemperatureKind.Precise)
.WithReponseFormat(ChatResponseFormat.Text)
.Build();
ChatResponse chatResponse = await client.ChatCompletion.CreateChatAsync(request);
Image
ImageRequest request = new ImageRequestBuilder()
.WithModel(ImageModelKind.DALL_E_3)
.WithPrompt("Un paisaje urbano, con algunos rascacielos de fondo aplicando un estilo de Dalí.")
.WithImagesCount(1)
.WithSize(DallE3Size.Square)
.WithQuality(DallE3Quality.HD)
.WithStyle(DallE3Style.Vivid)
.WithResponseFormat(ImageResponseFormat.Url)
.Build();
ImageResponse imageResponse = await client.Image.CreateImageAsync(request);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.