Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Latest commit

 

History

History
65 lines (41 loc) · 1.74 KB

README.md

File metadata and controls

65 lines (41 loc) · 1.74 KB

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!