From d33fca14e774650443e88887fe97041984084460 Mon Sep 17 00:00:00 2001 From: "leftfire@hotmail.com" Date: Wed, 12 Jul 2023 16:23:04 +0800 Subject: [PATCH] Reintroduce the ChainOption parameter --- chains/retrieval_qa.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chains/retrieval_qa.go b/chains/retrieval_qa.go index 35bdfe983..7312486d8 100644 --- a/chains/retrieval_qa.go +++ b/chains/retrieval_qa.go @@ -59,7 +59,7 @@ func NewRetrievalQAFromLLM(llm llms.LanguageModel, retriever schema.Retriever) R // Call gets relevant documents from the retriever and gives them to the combine // documents chain. -func (c RetrievalQA) Call(ctx context.Context, values map[string]any, _ ...ChainCallOption) (map[string]any, error) { //nolint: lll +func (c RetrievalQA) Call(ctx context.Context, values map[string]any, options ...ChainCallOption) (map[string]any, error) { //nolint: lll query, ok := values[c.InputKey].(string) if !ok { return nil, fmt.Errorf("%w: %w", ErrInvalidInputValues, ErrInputValuesWrongType) @@ -73,7 +73,7 @@ func (c RetrievalQA) Call(ctx context.Context, values map[string]any, _ ...Chain result, err := Call(ctx, c.CombineDocumentsChain, map[string]any{ "question": query, "input_documents": docs, - }) + }, options...) if err != nil { return nil, err }