TypeChatSharp 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TypeChatSharp --version 0.1.0                
NuGet\Install-Package TypeChatSharp -Version 0.1.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="TypeChatSharp" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TypeChatSharp --version 0.1.0                
#r "nuget: TypeChatSharp, 0.1.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 TypeChatSharp as a Cake Addin
#addin nuget:?package=TypeChatSharp&version=0.1.0

// Install TypeChatSharp as a Cake Tool
#tool nuget:?package=TypeChatSharp&version=0.1.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:

  1. Constructing a prompt to the LLM using types.
  2. Validating the LLM response conforms to the schema. If the validation fails, repair the non-conforming output through further language model interaction.
  3. 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 Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last updated
0.2.0 546 9/8/2023
0.1.0 485 9/7/2023