Harrison/update docstore (#47)

change docstore interface
This commit is contained in:
Harrison Chase
2022-10-31 21:18:52 -07:00
committed by GitHub
parent b45b126d9b
commit e982cf4b2e
6 changed files with 34 additions and 30 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
"""Unit tests for ReAct."""
from typing import List, Optional, Tuple
from typing import List, Optional, Union
import pytest
@@ -39,10 +39,10 @@ class FakeListLLM(LLM):
class FakeDocstore(Docstore):
"""Fake docstore for testing purposes."""
def search(self, search: str) -> Tuple[str, Optional[Document]]:
def search(self, search: str) -> Union[str, Document]:
"""Return the fake document."""
document = Document(page_content=_PAGE_CONTENT)
return document.summary, document
return document
def test_predict_until_observation_normal() -> None: