Inspired by langchain to provide composability when building Large Language Model Application. GChain 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
$ go get github.com/wejick/gchain
import "github.com/wejick/gchain
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.