From 128ea4009a56757c27917ee2660cac8f8e310aca Mon Sep 17 00:00:00 2001 From: Yassine Souissi Date: Mon, 19 Feb 2024 14:28:53 +0100 Subject: [PATCH] update retrieval interface and requirements --- app/data/lecture/lectures.py | 2 +- app/data/repository/repositories.py | 3 +++ requirements.txt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/data/lecture/lectures.py b/app/data/lecture/lectures.py index 78026322..3c526e71 100644 --- a/app/data/lecture/lectures.py +++ b/app/data/lecture/lectures.py @@ -69,7 +69,7 @@ def batch_import(self, directory_path, subdirectory): if not embeddings_created: raise RuntimeError("Failed to create embeddings.") - def query_database(self, user_message: str, lecture_id: int = None): + def retrieve(self, user_message: str, lecture_id: int = None): response = self.collection.query.near_text( near_text=user_message, filters=( diff --git a/app/data/repository/repositories.py b/app/data/repository/repositories.py index e1983a48..e34cf26f 100644 --- a/app/data/repository/repositories.py +++ b/app/data/repository/repositories.py @@ -8,6 +8,9 @@ class Repositories: def __init__(self, client: weaviate.WeaviateClient): self.collection = init_schema(client) + def retrieve(self, question:str): + pass + def ingest(self, repositories: dict[str, str]): pass diff --git a/requirements.txt b/requirements.txt index a3d0f2aa..ee10ed37 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ black==24.1.1 flake8==7.0.0 pre-commit==3.6.1 pydantic==2.6.1 -unstructured[all-docs] pymupdf==1.23.22 PyYAML~=6.0.1 unstructured==0.11.8 +weaviate-client==4.4.4