Skip to content

LangChain for Go, the easiest way to write LLM-based programs in Go

License

Notifications You must be signed in to change notification settings

tyloafer/langchaingo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork之因

为什么要fork这个项目?

在使用项目过程中,有一些设计让我感觉用起来会有点难受,在上层也无法hack,即使可以hack,也会使代码非常丑陋

其次,有一些我认为必要的逻辑是存在缺失的,类似于agent里面无法使用vector、向量搜索无法显示score让我无法回测以确定score、agent无法设置LLM的参数等等,而这些问题作者也不鸟我!!!

最后,作者是国外的大神,但是对于国内的一些工具和模型更新较少,在监管下,总是会有些不便

所以,我fork了整个项目,并为此提供所需的能力支撑

同时,会定期merge源项目,保持能力一致

如果有pr和issue,欢迎来砸

🦜️🔗 LangChain Go

go.dev reference scorecard Open in Dev Containers

⚡ Building applications with LLMs through composability, with Go! ⚡

🤔 What is this?

This is the Go language implementation of LangChain.

📖 Documentation

🎉 Examples

See ./examples for example usage.

package main

import (
	"context"
	"log"

	"github.com/tyloafer/langchaingo/llms/openai"
)

func main() {
	llm, err := openai.New()
	if err != nil {
		log.Fatal(err)
	}
	prompt := "What would be a good company name for a company that makes colorful socks?"
	completion, err := llm.Call(context.Background(), prompt)
	if err != nil {
		log.Fatal(err)
	}
	log.Println(completion)
}
$ go run .

Socktastic!

Resources

Here are some links to blog posts and articles on using Langchain Go:

About

LangChain for Go, the easiest way to write LLM-based programs in Go

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.8%
  • Makefile 0.2%