Iciclecreek.AI.OpenAI
1.0.0
dotnet add package Iciclecreek.AI.OpenAI --version 1.0.0
NuGet\Install-Package Iciclecreek.AI.OpenAI -Version 1.0.0
<PackageReference Include="Iciclecreek.AI.OpenAI" Version="1.0.0" />
paket add Iciclecreek.AI.OpenAI --version 1.0.0
#r "nuget: Iciclecreek.AI.OpenAI, 1.0.0"
// Install Iciclecreek.AI.OpenAI as a Cake Addin #addin nuget:?package=Iciclecreek.AI.OpenAI&version=1.0.0 // Install Iciclecreek.AI.OpenAI as a Cake Tool #tool nuget:?package=Iciclecreek.AI.OpenAI&version=1.0.0
Iciclecreek.AI.OpenAI
This library defines Recognizer classes which use OpenAI to recognize multiple intents in the text of a user as function calls.
Details
This library thinks about the problem of recognizing multiple intents in the text of a user as identifying the set of functions the user has requested, not as identifying functions to chain together.
This library provides a class SemanticActionRecognizer which allows you to simply define the function signatures that should be identified in the content of the user text.
It will return the set of functions that the user has requested in structured form.
Example
This example class defines a MathFunctionRecognizer that recognizes the natural language of a user to request a math function.
internal class MathFunctionRecognizer : SemanticActionRecognizer
{
public MathFunctionRecognizer(OpenAIClient client) : base(client)
{
this.Actions.Add(new SemanticActionDefinition("Add", "Add two numbers")
.AddArgument("number").AddArgument("number")
.AddExample("what is 5 + 3?", "5", "3"));
this.Actions.Add(new SemanticActionDefinition("Subtract", "Subtract two numbers")
.AddArgument("number").AddArgument("number")
.AddExample("remove 10 from 20", "20", "10"));
this.Actions.Add(new SemanticActionDefinition("Multiply", "Multiply two numbers")
.AddArgument("number").AddArgument("number")
.AddExample("32x16", "32", "16"));
this.Actions.Add(new SemanticActionDefinition("Divide", "Divde two numbers")
.AddArgument("number").AddArgument("number")
.AddExample("divide 100 x 4", "100", "4"));
}
}
If you provide the text "what is 5 + 3?" to the MathFunctionRecognizer, it will return the following:
Add('5', '3')
More importantly, if you provide the text "what is 5 + 3? remove 10 from 20", it will return multiple function signatures:
Add('5', '3')
Subtract('20', '10')
NOTES
The arguments passed to the functions may be in the form of strings and require further parsing to get to value types you need. For example, for the Add() function you may need to convert the x and y values to integers:
void Add(object x, object y)
{
var xValue = Convert.ToInt32(x);
var yValue = Convert.ToInt32(y);
Console.WriteLine(xValue + yValue);
})
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Azure.AI.OpenAI (>= 1.0.0-beta.15)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Iciclecreek.AI.OpenAI:
Package | Downloads |
---|---|
Iciclecreek.AI.OpenAI.FormFill
OpenAI based natural language form fill engine. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 78 | 3/28/2024 |