Skip to content

Commit

Permalink
fix(chains): Fix OpenAIQAWithSourcesChain returning empty strings (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmigloz committed Aug 12, 2023
1 parent 3c69adf commit 6181ff8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ class MapReduceDocumentsChain extends BaseCombineDocumentsChain {
String _getStringContent(final dynamic content) => switch (content) {
final String resultStr => resultStr,
final ChatMessage resultMsg => resultMsg.content,
_ => '',
_ => content,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class StuffDocumentsChain extends BaseCombineDocumentsChain {
final output = switch (llmOutput[llmChain.outputKey]) {
final String resultStr => resultStr,
final ChatMessage resultMsg => resultMsg.content,
_ => '',
_ => llmOutput[llmChain.outputKey],
};
return {
outputKey: output,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
const loader = TextLoader(filePath);
final documents = await loader.load();

const textSplitter = CharacterTextSplitter(
const textSplitter = RecursiveCharacterTextSplitter(
chunkSize: 800,
chunkOverlap: 0,
);
Expand Down

0 comments on commit 6181ff8

Please sign in to comment.