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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Iciclecreek.AI.OpenAI.FormFill" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Iciclecreek.AI.OpenAI.FormFill --version 1.0.0
#r "nuget: Iciclecreek.AI.OpenAI.FormFill, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 62 3/28/2024