LangChain for Go,在Go中最容易写入基于LLM的程序
[(ZZURL1ZH).
通过可容性构建LLMs的应用程序,与Go!
□ 这是什么?
这是LangChain的Go语言执行.
□ 文档
□ 实例
例如,见./实例。
(原始内容存档于2019-09-29) (英语). ```go 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) }
ZZ1ZZ
# 资源
加入 Discord 服务器以获得支持和讨论 : [Join Discord] (ZZURL5Z)
使用LangChain Go的博客文章:
- [使用Gemini 型号与LangChainGo一起走](https://eli.thegreenplace.net/2024/using-gemini-models-in-go-with-langchaingo/) - 2024年1月
- [Using Ollama with LangChain Go] (https://eli.thegreenplace.net/2023/using-ollama-with-langchaingo/) - 2023年11月
- [创建简单的ChatGPT 克隆与Go](https://sausheong.com/creating-a-simple-chatgpt-clone-with-go-c40b4bec9267?sk=53a2bcf4ce3b0cfae1a4c26897c0deb0) - 2023年8月
2023年8月,在你的笔记本电脑上运行
贡献者
如果有兴趣成为维护者或贡献者,请加入我们的[Discord](https://discord.gg/8bHGKzHBkM),并告诉我们。
<llms/Anthropic: GenerateContent 在成功时从未调用 HandleLLMGenerateContentEnd
googleai: 在 GenerateContent 中的系统唯一消息列表中发生异常
这个项目死了吗?
llms/ollama: WithThink 没有效果 — think 在 "options" 中被序列化 (API 期望为顶级对象) 且忽略空值时会返回 false
离线文档
OpenAI GPT-5.4: 无法将推理努力设置为无,同时温度设置为 0
自定义多输入工具
WithStreamingReasoningFunc 尚未测试,且在 Ollama 和 Claude 中不工作
支持 Gemma 4 工具调用令牌对
Anthropic CacheControl 未正常工作