TypeChatSharp 0.2.0
dotnet add package TypeChatSharp --version 0.2.0
NuGet\Install-Package TypeChatSharp -Version 0.2.0
<PackageReference Include="TypeChatSharp" Version="0.2.0" />
paket add TypeChatSharp --version 0.2.0
#r "nuget: TypeChatSharp, 0.2.0"
// Install TypeChatSharp as a Cake Addin #addin nuget:?package=TypeChatSharp&version=0.2.0 // Install TypeChatSharp as a Cake Tool #tool nuget:?package=TypeChatSharp&version=0.2.0
TypeChatSharp
TypeChatSharp is a library that makes it easy to build natural language interfaces using types in C#. It is a direct port from TypeChat, but is not maintained by Microsoft.
Much of the text below and in other places in this repository is a direct copy or slightly modified version of text in the original TypeChat repository. The copyright for these texts belongs to Microsoft.
Building natural language interfaces has traditionally been difficult. These apps often relied on complex decision trees to determine intent and collect the required inputs to take action. Large language models (LLMs) have made this easier by enabling us to take natural language input from a user and match to intent. This has introduced its own challenges including the need to constrain the model's reply for safety, structure responses from the model for further processing, and ensuring that the reply from the model is valid. Prompt engineering aims to solve these problems, but comes with a steep learning curve and increased fragility as the prompt increases in size.
TypeChatSharp, like TypeChat, replaces prompt engineering with schema engineering.
Simply define types that represent the intents supported in your natural language application. That could be as simple as a type for categorizing sentiment or more complex examples like types for a shopping cart or music application. For example, to add additional intents to a schema, a developer can add additional types.
After defining your types, TypeChat takes care of the rest by:
- Constructing a prompt to the LLM using types.
- Validating the LLM response conforms to the schema. If the validation fails, repair the non-conforming output through further language model interaction.
- Summarizing succinctly (without use of a LLM) the instance and confirm that it aligns with user intent.
Types are all you need!
Getting Started
Install TypeChatSharp:
dotnet add package TypeChatSharp
You can also build TypeChatSharp from source:
cd TypeChatSharp
dotnet build
To see TypeChat in action, we recommend exploring the Example projects.
To learn more about TypeChat, visit the documentation which includes more information on TypeChat and how to get started. Much of it will also apply to TypeChatSharp.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. 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 is compatible. 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 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 is compatible. 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. |
-
.NETFramework 4.7
- System.Net.Http (>= 4.3.4)
- System.Net.Http.Json (>= 7.0.1)
- System.Text.Json (>= 7.0.3)
-
.NETStandard 2.0
- System.Net.Http (>= 4.3.4)
- System.Net.Http.Json (>= 7.0.1)
- System.Text.Json (>= 7.0.3)
-
.NETStandard 2.1
- System.Net.Http (>= 4.3.4)
- System.Net.Http.Json (>= 7.0.1)
- System.Text.Json (>= 7.0.3)
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.