fix map reduce chain (#550)

This commit is contained in:
Harrison Chase
2023-01-06 07:15:57 -08:00
committed by GitHub
parent ba0cbb4a41
commit 330a5b42d4
2 changed files with 14 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
"""Test functionality related to combining documents."""
from typing import List
from typing import Any, List, Tuple
import pytest
@@ -12,11 +12,11 @@ from langchain.docstore.document import Document
def _fake_docs_len_func(docs: List[Document]) -> int:
return len(_fake_combine_docs_func(docs))
return len(_fake_combine_docs_func(docs)[0])
def _fake_combine_docs_func(docs: List[Document]) -> str:
return "".join([d.page_content for d in docs])
def _fake_combine_docs_func(docs: List[Document], **kwargs: Any) -> Tuple[str, dict]:
return "".join([d.page_content for d in docs]), {}
def test__split_list_long_single_doc() -> None: