Correct the use of abstractmethod (#80)

* Correct abstractmethod usage

* Update interface

* Specify minimal llama-index version [ignore cache]

* Update examples
This commit is contained in:
Nguyen Trung Duc (john)
2023-11-20 11:18:53 +07:00
committed by GitHub
parent 98509f886c
commit 0a3fc4b228
12 changed files with 33 additions and 37 deletions

View File

@@ -35,3 +35,6 @@ class Pipeline(BaseComponent):
def run_raw(self, text: str) -> str:
matched_texts: List[str] = self.retrieving_pipeline(text)
return self.llm("\n".join(matched_texts)).text
def run(self):
...

View File

@@ -34,6 +34,7 @@ def test_indexing(mock_openai_embedding, tmp_path):
vector_store=db, embedding=embedding, doc_store=doc_store
)
pipeline.doc_store = cast(InMemoryDocumentStore, pipeline.doc_store)
pipeline.vector_store = cast(ChromaVectorStore, pipeline.vector_store)
assert pipeline.vector_store._collection.count() == 0, "Expected empty collection"
assert len(pipeline.doc_store._store) == 0, "Expected empty doc store"
pipeline(text=Document(text="Hello world"))