langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Support for .NET

Open jeastham1993 opened this issue 1 year ago • 11 comments

Build SDK support for .NET.

I'd be happy to contribute to the project.

jeastham1993 avatar May 01 '23 16:05 jeastham1993

While the core team probably doesn't have bandwidth to develop it at the moment, we'd love to help where possible if there are enough maintainers to a .net version!

The golang support organically developed in a similar way https://discord.com/channels/1038097195422978059/1097608449266831390

vowelparrot avatar May 01 '23 17:05 vowelparrot

Thanks for the response @vowelparrot. I'm definitely on board with taking on support for the .NET version. I've connected with Harrison on Twitter and I'll check out the Go implementation.

jeastham1993 avatar May 01 '23 17:05 jeastham1993

@jeastham1993 i started with .net implementation in my own repository, but since i don't have that much free time my progress in not that good. you can check it out here. https://github.com/oorosh/langchain-dotnet

oorosh avatar May 22 '23 10:05 oorosh

@oorosh ah ok, do you want to join up our efforts? I've implemented most of the base types, the LLM for OpenAI and HuggingFace, the prompts and have just started on the actual chaining. The repo is still private at the moment but I've just added you. I've got a bunch of changes I need to comitt from my other laptop as well, so it isn't quite up to date.

jeastham1993 avatar May 22 '23 11:05 jeastham1993

Sure. Btw, my repo is definitely behind what you have.

oorosh avatar May 22 '23 11:05 oorosh

It would be awesome to collaborate in that case. I'm going to be travelling for a few hours tonight so I'll commit everything I have and then add some issues for what needs to happen next. We can split up the work then :)

jeastham1993 avatar May 22 '23 12:05 jeastham1993

yes, im up for it.

oorosh avatar May 23 '23 18:05 oorosh

@oorosh I have just pushed an updated version of my .NET implementation that contains the basic functionality for chains, prompts and support for OpenAI and HuggingFace. If you want to review the code that would be awesome.

jeastham1993 avatar Jun 28 '23 07:06 jeastham1993

For anyone coming across this issue, the .NET implementation is here https://github.com/jeastham1993/langchain-dotnet

jeastham1993 avatar Jun 28 '23 11:06 jeastham1993

For anyone interested, I've had some initial luck calling into the official langchainjs library in .NET using Microsoft ClearScript and some specially crafted polyfills.

iassafc avatar Jul 03 '23 00:07 iassafc

Why not use Semantic Kernel for .NET ? https://learn.microsoft.com/en-us/semantic-kernel/overview/

itorian avatar Jul 07 '23 07:07 itorian

I have made some work that could be used (maybe).

  • Use of Llamasharp models version 1 and 2, incl ASP.NET WebApi
  • Use of OpenAI, incl a .Net Client. The use of it can be found in a Console and WPF appl in Examples, and a Test project.
  • Use of Qdrant Vector database and a new .Net Client for it
  • Use of Microsoft.SemanticKernel (Using the Qdrant Vector database). As written by @itorian in the comment above, I would also consider this as a good candidate for a .Net LangChain
  • ImageClassification - TensorFlow.Net:
  • ImageClassification - Microsoft.ML/TensorFlow

A lot of the more experimental stuff is driven from Tests, but can easily be moved into an application

AI-playground

karlgodtliebsen avatar Aug 11 '23 22:08 karlgodtliebsen

Hello everyone,

I'm thrilled to introduce LangChainJSDotNet, an open-source library designed as a wrapper for LangChain.js. It offers .NET developers a seamless interface to run LangChain-based code with minimal adjustments. Given that the official JS/TS version closely mirrors the Python version, this library enables easy porting of LangChain code to .NET, unlocking the latest AI advancements and features from LangChain's vast ecosystem for the .NET community.

Your feedback and collaboration would be invaluable. Check it out here: https://github.com/iassafc/LangChainJSDotNet

iassafc avatar Sep 21 '23 02:09 iassafc

Hi, @jeastham1993

I'm helping the LangChain team manage their backlog and am marking this issue as stale. From the active discussion and collaboration among users, it seems that there has been interest and efforts towards .NET support in the build SDK, including potential contributions from you and others. Additionally, there are mentions of existing work and libraries related to .NET support for LangChain, as well as a new open-source library, LangChainJSDotNet, designed as a wrapper for LangChain.js, which has received positive feedback.

Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you!

dosubot[bot] avatar Dec 21 '23 16:12 dosubot[bot]

FYI for anyone that comes upon this issue/request - here's another .NET implementation of LangChain that has been started: https://github.com/tryAGI/LangChain. I haven't worked with the project yet, but as of now I see there are still commits happening by its author and if you're interested in contributing this may be a good one to watch.

@jeastham1993 - it looks like you archived your original repo here, did you end up continuing your work anywhere else?

jmatthiesen avatar Jan 22 '24 21:01 jmatthiesen