modulepackage
0.0.0-20230628125949-3eebe5bfe722
Repository: https://github.com/wejick/gochain.git
Documentation: pkg.go.dev
# README
We rename to https://github.com/wejick/gchain
🤔 What is this?
Inspired by langchain to provide composability when building Large Language Model Application. GoChain mission is to bring langchain concept to Go in idiomatic way.
This Library will help on many usecases, such as :
❓ Question Answering over specific documents
💬 Chatbots
📄 Document Summarization
Install and Importing
$ go get github.com/wejick/gochain
import "github.com/wejick/gochain
Example
llmModel = _openai.NewOpenAIModel(authToken, "", "text-davinci-003",callback.NewManager(), true)
chain, err := llm_chain.NewLLMChain(llmModel, nil)
if err != nil {
//handle error
}
outputMap, err := chain.Run(context.Background(), map[string]string{"input": "Indonesia Capital is Jakarta\nJakarta is the capital of "})
fmt.Println(outputMap["output"])
More example in the example folder
As our documentation is not yet complete, please refer to examples and integration test for reference.
Notice
- Don't use it if you have better option
- GoChain priority is golang idiomatic. So eventhough it happily use many langchain concept, don't expect exactly the same behavior as this is not reimplementation.
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A “prompt” refers to the input to the model.
Language model has token limit, managing text/prompt to fit the limit is easier with text splitter.