Iciclecreek.AI.OpenAI.FormFill
1.0.0
dotnet add package Iciclecreek.AI.OpenAI.FormFill --version 1.0.0
NuGet\Install-Package Iciclecreek.AI.OpenAI.FormFill -Version 1.0.0
<PackageReference Include="Iciclecreek.AI.OpenAI.FormFill" Version="1.0.0" />
paket add Iciclecreek.AI.OpenAI.FormFill --version 1.0.0
#r "nuget: Iciclecreek.AI.OpenAI.FormFill, 1.0.0"
// Install Iciclecreek.AI.OpenAI.FormFill as a Cake Addin #addin nuget:?package=Iciclecreek.AI.OpenAI.FormFill&version=1.0.0 // Install Iciclecreek.AI.OpenAI.FormFill as a Cake Tool #tool nuget:?package=Iciclecreek.AI.OpenAI.FormFill&version=1.0.0
Iciclecreek.AI.OpenAI.FormFill
This library gives you a natural language form filling engine using OpenAI**
Details
This library defines the FormFillEngine class which uses OpenAI to recognize user intent in terms of function calls that are modifications to the properties on an object. (aka natural language form fill)
Example
Given a model like this:
public class SampleModel
{
public string? Name { get; set; }
public int? Age { get; set; }
public string? City { get; set; }
public StatesEnum? State { get; set; }
}
You define an instance of the FormFillEngine like this:
var services = new ServiceCollection();
// define the OpenAI client
.AddSingleton<OpenAIClient>((sp) => new OpenAIClient(sp.GetRequiredService<IConfiguration>()["OpenAIKey"]));
// add the form fill engine for SampleModel
.AddFormFillEngine<SampleModel>();
.BuildServiceProvider();
Then to use that engine
var formFillEngine = services.GetService<FormFillEngine<SampleModel>>();
var model = new SampleModel();
await formFillEngine.InterpretTextAsync("I am Fred, and I'm 42 years old", model);
// model.Name = "Fred"
// model.Age = 42
await formFillEngine.InterpretTextAsync("My name is Frank and I live in Iowa.", model);
// model.Name = "Frank"
// model.Age = 42
// model.City = "Iowa"
The call to InterpretTextAsync() will parse the text using OpenAI and set the properties on the model as requested by the user.
NOTE: It returns a data structure which describes the operations that were performed.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- Azure.AI.OpenAI (>= 1.0.0-beta.15)
- Humanizer (>= 2.14.1)
- Iciclecreek.AI.OpenAI (>= 1.0.0)
- Microsoft.Recognizers.Text (>= 1.8.8)
- Microsoft.Recognizers.Text.Choice (>= 1.8.8)
- Microsoft.Recognizers.Text.DataTypes.TimexExpression (>= 1.8.8)
- Microsoft.Recognizers.Text.DateTime (>= 1.8.8)
- Microsoft.Recognizers.Text.Number (>= 1.8.8)
- Microsoft.Recognizers.Text.NumberWithUnit (>= 1.8.8)
- Microsoft.Recognizers.Text.Sequence (>= 1.8.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 86 | 3/28/2024 |