Skip to content

Commit

Permalink
feat(chains): Support custom doc prompt in StuffDocumentsQAChain (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmigloz committed Sep 9, 2023
1 parent 34bb440 commit faa9d2d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ final _promptSelector = ConditionalPromptSelector(
class StuffDocumentsQAChain extends StuffDocumentsChain {
/// {@macro stuff_documents_qa_chain}
StuffDocumentsQAChain({
required final BaseLanguageModel llm,
final BasePromptTemplate? prompt,
required final BaseLanguageModel llm,
super.inputKey = StuffDocumentsChain.defaultInputKey,
super.outputKey = StuffDocumentsChain.defaultOutputKey,
super.documentPrompt = StuffDocumentsChain.defaultDocumentPrompt,
super.documentSeparator = StuffDocumentsChain.defaultDocumentSeparator,
}) : super(
llmChain: LLMChain(
prompt: prompt ?? _promptSelector.getPrompt(llm),
Expand Down

0 comments on commit faa9d2d

Please sign in to comment.