Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IMPORTANT! This package is currently in an early alpha preview, please provide any feedback via GitHub issues.

CI NuGet

🦜️🔗 LangChain .NET

⚡ Building applications with LLMs through composability ⚡

🤔 What is this?

This is the .NET language implementation of LangChain.

Installing LangChain.NET

You should install LangChain.NET with NuGet:

Install-Package LangChain.NET

Or via the .NET Core command line interface:

dotnet add package LangChain.NET

Either commands, from Package Manager Console or .NET Core CLI, will download and install LangChain.NET and all required dependencies.

🎉 Examples

See examples for example usage.

var model = new OpenAI();

var result = await model.Call("What is a good name for a company that sells colourful socks?");

Console.WriteLine(result);
$ dotnet run .

Socktastic!

Or using chains

var llm = new OpenAi();

var template = "What is a good name for a company that makes {product}?";
var prompt = new PromptTemplate(new PromptTemplateInput(template, new List<string>(1){"product"}));

var chain = new LlmChain(new LlmChainInput(llm, prompt));

var result = await chain.Call(new ChainValues(new Dictionary<string, object>(1)
{
    { "product", "colourful socks" }
}));

// The result is an object with a `text` property.
Console.WriteLine(result.Value["text"]);
$ dotnet run .

Socktastic!

About

.NET implementation of the LangChain project.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages