mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-10 23:41:28 +00:00
Use run
and arun
in place of combine_docs
and acombine_docs
(#2635)
`combine_docs` does not go through the standard chain call path which means that chain callbacks won't be triggered, meaning QA chains won't be traced properly, this fixes that. Also fix several errors in the chat_vector_db notebook
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Test functionality related to combining documents."""
|
||||
|
||||
from typing import Any, List, Tuple
|
||||
from typing import Any, List
|
||||
|
||||
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)[0])
|
||||
return len(_fake_combine_docs_func(docs))
|
||||
|
||||
|
||||
def _fake_combine_docs_func(docs: List[Document], **kwargs: Any) -> Tuple[str, dict]:
|
||||
return "".join([d.page_content for d in docs]), {}
|
||||
def _fake_combine_docs_func(docs: List[Document], **kwargs: Any) -> str:
|
||||
return "".join([d.page_content for d in docs])
|
||||
|
||||
|
||||
def test__split_list_long_single_doc() -> None:
|
||||
|
Reference in New Issue
Block a user