Skip to content

tmc/langchaingo

Folders and files

NameName
Last commit message
Last commit date
Feb 9, 2025
Sep 13, 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
May 7, 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
Jan 29, 2025
Jan 29, 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