LangChain.Databases.Pinecone 0.12.2

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

// Install LangChain.Databases.Pinecone as a Cake Tool
#tool nuget:?package=LangChain.Databases.Pinecone&version=0.12.2

šŸ¦œļøšŸ”— LangChain

Nuget package dotnet License: MIT Discord

āš” Building applications with LLMs through composability āš”
C# implementation of LangChain. We try to be as close to the original as possible in terms of abstractions, but are open to new entities.

While the SemanticKernel is good and we will use it wherever possible, we believe that it has many limitations and based on Microsoft technologies. We proceed from the position of the maximum choice of available options and are open to using third-party libraries within individual implementations.
ā¤ļø Our project includes https://github.com/jeastham1993/langchain-dotnet and tries to be updated with the latest changes there ā¤ļø

I want to note:

  • Iā€™m unlikely to be able to make serious progress alone, so my goal is to unite the efforts of C# developers to create a C# version of LangChain and control the quality of the final project
  • I try to accept any Pull Request within 24 hours (of course, it depends, but I will try)
  • I'm also looking for developers to join the core team. I will sponsor them whenever possible and also share any money received.
  • I also respond quite quickly on Discord for any questions related to the project

Usage

const string apiKey = "API_KEY";
using var httpClient = new HttpClient();
var model = new Gpt4Model(apiKey, httpClient);
var response = await model.GenerateAsync("Hello, World of AI!");

var numberOfTokens = model.CountTokens("Hello, World of AI!");

Chains

const string apiKey = "API_KEY";
using var httpClient = new HttpClient();
var model = new Gpt4Model(apiKey, httpClient);

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(model, prompt));

var result = await chain.CallAsync(new ChainValues(new Dictionary<string, object>(1)
{
    { "product", "colourful socks" }
}));
// The result is an object with a `text` property.
Console.WriteLine(result.Value["text"]);

// Since the LLMChain is a single-input, single-output chain, we can also call it with `run`.
// This takes in a string and returns the `text` property.
var result2 = await chain.Run("colourful socks");

Console.WriteLine(result2);

OpenAI Functions:

WeatherService:

[OpenAiFunctions]
public interface IWeatherFunctions
{
    [Description("Get the current weather in a given location")]
    public Task<Weather> GetCurrentWeatherAsync(
        [Description("The city and state, e.g. San Francisco, CA")] string location,
        Unit unit = Unit.Celsius,
        CancellationToken cancellationToken = default);
}

public class WeatherService : IWeatherFunctions
{
    public Task<Weather> GetCurrentWeatherAsync(string location, Unit unit = Unit.Celsius, CancellationToken cancellationToken = default)
    {
        return Task.FromResult(new Weather
        {
            Location = location,
            Temperature = 22.0,
            Unit = unit,
            Description = "Sunny",
        });
    }
}
using var client = new HttpClient();
var model = new Gpt35TurboModel(apiKey, client);

var service = new WeatherService();
model.AddGlobalFunctions(service.AsFunctions(), service.AsCalls());

var response = await model.GenerateAsync(new ChatRequest(
    Messages: new []
    {
        "You are a helpful weather assistant.".AsSystemMessage(),
        "What's the weather like today?".AsHumanMessage(),
        "Sure! Could you please provide me with your location?".AsAiMessage(),
        "Dubai, UAE".AsHumanMessage(),
    }));

Console.WriteLine(response.Messages.AsHistory());

Result:

System: You are a helpful weather assistant.
Human: What's the weather like today?
AI: Sure! Could you please provide me with your location?
Human: Dubai, UAE
Function call: GetCurrentWeather({"location": "Dubai, UAE"})
Function result: GetCurrentWeather -> {"location":"Dubai, UAE","temperature":22,"unit":"celsius","description":"Sunny"}
AI: The weather in Dubai, UAE today is sunny with a temperature of 22 degrees Celsius.

Also see examples for example usage.

Support

Priority place for bugs: https://github.com/tryAGI/LangChain/issues
Priority place for ideas and general questions: https://github.com/tryAGI/LangChain/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Product 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-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 is compatible.  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. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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.12.3-dev.63 0 12/6/2023
0.12.3-dev.62 26 12/5/2023
0.12.3-dev.61 23 12/5/2023
0.12.3-dev.60 35 12/5/2023
0.12.3-dev.41 33 12/4/2023
0.12.3-dev.40 42 12/1/2023
0.12.3-dev.39 21 11/29/2023
0.12.3-dev.38 35 11/27/2023
0.12.3-dev.37 32 11/27/2023
0.12.3-dev.36 34 11/27/2023
0.12.3-dev.34 43 11/24/2023
0.12.3-dev.33 41 11/22/2023
0.12.3-dev.32 28 11/21/2023
0.12.3-dev.31 33 11/18/2023
0.12.3-dev.30 33 11/17/2023
0.12.3-dev.29 30 11/17/2023
0.12.3-dev.28 31 11/16/2023
0.12.3-dev.27 26 11/16/2023
0.12.3-dev.23 31 11/16/2023
0.12.3-dev.22 30 11/16/2023
0.12.3-dev.21 33 11/13/2023
0.12.3-dev.20 29 11/13/2023
0.12.3-dev.11 32 11/11/2023
0.12.3-dev.9 31 11/11/2023
0.12.3-dev.8 28 11/11/2023
0.12.3-dev.3 29 11/11/2023
0.12.3-dev.2 29 11/11/2023
0.12.3-dev.1 31 11/11/2023
0.12.2 79 11/11/2023
0.12.2-dev.1 33 11/11/2023
0.12.1 44 11/11/2023
0.12.1-dev.4 32 11/11/2023
0.12.1-dev.0.3 28 11/11/2023
0.12.1-dev.0.2 29 11/11/2023
0.12.1-dev.0.1 31 11/11/2023
0.11.0-preview.0.132 34 11/8/2023
0.11.0-preview.0.131 27 11/8/2023
0.11.0-preview.0.130 41 11/6/2023
0.11.0-preview.0.129 40 11/6/2023
0.11.0-preview.0.128 37 11/5/2023
0.11.0-preview.0.127 46 11/5/2023
0.11.0-preview.0.126 39 11/5/2023
0.11.0-preview.0.125 43 11/4/2023
0.11.0-preview.0.124 42 11/4/2023
0.11.0-preview.0.123 44 11/4/2023
0.11.0-preview.0.122 38 11/4/2023
0.11.0-preview.0.121 37 11/3/2023
0.11.0-preview.0.120 35 11/3/2023
0.11.0-preview.0.119 44 11/3/2023
0.11.0-preview.0.118 43 11/2/2023
0.11.0-preview.0.117 35 11/2/2023
0.11.0-preview.0.116 37 11/2/2023
0.11.0-preview.0.115 41 11/2/2023
0.11.0-preview.0.114 42 11/2/2023
0.11.0-preview.0.113 37 11/1/2023
0.11.0-preview.0.112 41 11/1/2023
0.11.0-preview.0.111 41 10/24/2023
0.11.0-preview.0.110 53 10/22/2023
0.11.0-preview.0.109 44 10/19/2023
0.11.0-preview.0.107 46 10/18/2023
0.11.0-preview.0.106 45 10/18/2023
0.11.0-preview.0.105 50 10/18/2023
0.10.3 124 10/18/2023
0.10.2 142 10/13/2023
0.10.1 114 10/12/2023
0.10.0 287 8/29/2023
0.9.0 281 8/29/2023
0.8.4 280 8/10/2023
0.8.3 308 8/10/2023
0.8.2 261 8/10/2023
0.8.1 299 8/10/2023
0.8.0 301 8/5/2023
0.7.0 340 8/4/2023
0.6.2 320 7/29/2023
0.6.1 319 7/29/2023
0.6.0 292 7/29/2023
0.5.2 335 7/26/2023
0.5.1 305 7/24/2023