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

sansmoraxz/langchaingo

This branch is 83 commits behind tmc/langchaingo:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6a285bf Β· Jun 15, 2024
Apr 1, 2024
May 11, 2024
Feb 20, 2024
Jun 15, 2024
May 10, 2024
Mar 18, 2024
Jun 15, 2024
Jun 15, 2024
Jun 19, 2023
Jun 14, 2024
May 4, 2024
Mar 26, 2024
Jun 15, 2024
Jun 15, 2024
Apr 17, 2024
Jun 12, 2024
May 7, 2024
May 7, 2024
May 4, 2024
Jun 15, 2024
Jun 15, 2024
Apr 22, 2023
Mar 26, 2024
Apr 18, 2023
Jan 17, 2024
Jul 26, 2023
Mar 26, 2024
Mar 23, 2024
Apr 18, 2023
Jun 15, 2024
Jun 15, 2024

Repository files navigation

πŸ¦œοΈπŸ”— 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"
  "fmt"
  "log"

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

func main() {
  ctx := context.Background()
  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 := llms.GenerateFromSinglePrompt(ctx, llm, prompt)
  if err != nil {
    log.Fatal(err)
  }
  fmt.Println(completion)
}
$ go run .
Socktastic

Resources

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

Contributors

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.9%
  • Makefile 0.1%