Jawwal.Recognizer.GPT
3.1.0
dotnet add package Jawwal.Recognizer.GPT --version 3.1.0
NuGet\Install-Package Jawwal.Recognizer.GPT -Version 3.1.0
<PackageReference Include="Jawwal.Recognizer.GPT" Version="3.1.0" />
paket add Jawwal.Recognizer.GPT --version 3.1.0
#r "nuget: Jawwal.Recognizer.GPT, 3.1.0"
// Install Jawwal.Recognizer.GPT as a Cake Addin #addin nuget:?package=Jawwal.Recognizer.GPT&version=3.1.0 // Install Jawwal.Recognizer.GPT as a Cake Tool #tool nuget:?package=Jawwal.Recognizer.GPT&version=3.1.0
Jawwal Open AI Recognizer
Summary
This recognizer helps you add a custom recognizer to an empty bot built with Bot Framework Composer in order to use the Open AI Completion API in place of the traditional Recognizer.
Installation
In order to enable the Jawwal GPT recognizer, you must first install the [Jawwal GPT Recognizer package] from NuGet in your Composer project.
Create a new Composer bot using the
Empty Bot
template.Open the Package Manager in Composer.
Search for
Jawwal.Recognizer.GPT
and install the package.
Configuration
To enable the Jawwal recognizer, complete the following steps:
Select
Custom
as your root dialog's recognizer type.Paste the following JSON into the custom recognizer configuration window:
{
"$kind": "Jawwal.Recognizer.GPT",
"endpoint": "<your endpoint, including https://>",
"endpointKey": "<your endpoint key>",
"prePromptText": "<your message to Open AI API (you should include system message plus context if you need to preserve it beside user message with input text), by default this will maintain specific number of turns and everytime response will returned with intents but you need to know that system mesage should have this instruction ( The results should be formatted as json object with list named intents and with 3 keys and values per list index, keys are intent1, Englishgeneralanswer and confidenceScore. ) so recognized intent will be returned in intent1 variable >",
"temperature": "<temperature for GPT API>",
"maxContext": "<Number of message to preserve in context history noting that each message either system, user or assistant counted and each round two indeices will be deleted (1,2) if number of messages maxContext reached >",
"openAiModel": "OpenAI Model"
}
- Update the
endpoint
andendpointKey
fields with the values from your Open AI Portal.
Notes
If any error occured during calling Open AI APIs intent error will be returned in order to allow for you to handle recognizing errors, intent is
OpenAIIntentError
Regarding
prePromptText
in configuration window you need to add variable in the value to maintain that you always send user message as exactly mentioned below : ${user.context} {"role":"user","content":"${turn.activity.text}"}]here i save system message as a json in user.context in Begindialog trigger with only add extra , for this object to have valid json in the end. so first value for user context will be
"[{\"role\":\"system\",\"content\":\" Your Instruction included mentioned instruction"},"
then based on configuration value it will be concatenated correctly with user message as role and input finallly to maintain the maxContext you need after each recognized intent to change user.context to add history as mentioned belowuser.context = concat(substring(turn.recognized.text, 0, length(turn.recognized.text) - 1),"," )
noting that DLL return ready json for history in each call in propertyturn.recognized.text
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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. 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.0
- Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime (>= 4.18.1)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.