Skip to content

Commit

Permalink
rename ingest method, drop URL-based ing src type
Browse files Browse the repository at this point in the history
Signed-off-by: Panos Vagenas <[email protected]>
  • Loading branch information
vagenas committed Dec 15, 2023
1 parent ce4f3f5 commit 0b1f9be
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions deepsearch/cps/client/components/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
from deepsearch.cps.client import CpsApi


class SemIngestUrlSource(BaseModel):
url: str


class SemIngestPublicDataDocumentSource(BaseModel):
source: ElasticDataCollectionSource
document_hash: str
Expand All @@ -42,7 +38,6 @@ class SemIngestPrivateDataCollectionSource(BaseModel):


SemIngestSource = Union[
SemIngestUrlSource,
SemIngestPublicDataDocumentSource,
SemIngestPrivateDataDocumentSource,
SemIngestPrivateDataCollectionSource,
Expand Down Expand Up @@ -90,19 +85,15 @@ 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,
) -> Task:

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,
Expand Down

0 comments on commit 0b1f9be

Please sign in to comment.