Skip to content
forked from tmc/langchaingo

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

License

Notifications You must be signed in to change notification settings

taigrr/langchaingo

This branch is 18 commits ahead of tmc/langchaingo:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

eb12650 Β· Feb 13, 2025
Feb 9, 2025
Oct 24, 2024
Feb 20, 2024
Dec 2, 2024
Feb 9, 2025
Sep 13, 2024
Sep 13, 2024
Feb 13, 2025
Jun 19, 2023
Jun 14, 2024
Sep 13, 2024
Mar 26, 2024
Feb 13, 2025
Sep 13, 2024
Sep 13, 2024
Jun 12, 2024
Oct 24, 2024
Jan 6, 2025
Jan 6, 2025
Jan 29, 2025
Feb 13, 2025
Apr 22, 2023
Sep 13, 2024
Apr 18, 2023
Jan 17, 2024
Jul 26, 2023
Sep 13, 2024
Feb 13, 2025
Apr 18, 2023
Feb 13, 2025
Feb 13, 2025

Repository files navigation

πŸŽ‰ Join our new official Discord community! Connect with other LangChain Go developers, get help and contribute: Join Discord

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

Packages

No packages published

Languages

  • Go 99.9%
  • Makefile 0.1%