From 0b1f9be211ae6b58eb601602aae5c49b320032b8 Mon Sep 17 00:00:00 2001 From: Panos Vagenas <35837085+vagenas@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:08:21 +0100 Subject: [PATCH] rename ingest method, drop URL-based ing src type Signed-off-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com> --- deepsearch/cps/client/components/documents.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/deepsearch/cps/client/components/documents.py b/deepsearch/cps/client/components/documents.py index 9488abb1..b196cf30 100644 --- a/deepsearch/cps/client/components/documents.py +++ b/deepsearch/cps/client/components/documents.py @@ -23,10 +23,6 @@ from deepsearch.cps.client import CpsApi -class SemIngestUrlSource(BaseModel): - url: str - - class SemIngestPublicDataDocumentSource(BaseModel): source: ElasticDataCollectionSource document_hash: str @@ -42,7 +38,6 @@ class SemIngestPrivateDataCollectionSource(BaseModel): SemIngestSource = Union[ - SemIngestUrlSource, SemIngestPublicDataDocumentSource, SemIngestPrivateDataDocumentSource, SemIngestPrivateDataCollectionSource, @@ -90,7 +85,7 @@ def __init__(self, api: CpsApi) -> None: self.api = api self.semantic_api = sw_client.SemanticApi(self.api.client.swagger_client) - def ingest_for_qa( + def semantic_ingest( self, project: Union[Project, str], data_source: SemIngestSource, @@ -98,11 +93,7 @@ def ingest_for_qa( proj_key = project.key if isinstance(project, Project) else project api_src_data: _APISemanticIngestSourceType - if isinstance(data_source, SemIngestUrlSource): - api_src_data = _APISemanticIngestSourceUrl( - url=data_source.url, - ) - elif isinstance(data_source, SemIngestPublicDataDocumentSource): + if isinstance(data_source, SemIngestPublicDataDocumentSource): api_src_data = _APISemanticIngestSourcePublicDataDocument( elastic_id=data_source.source.elastic_id, index_key=data_source.source.index_key,