Skip to content

Commit

Permalink
use generated sem ingest req 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 d317528 commit 7e1e04e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions deepsearch/cps/client/components/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from typing_extensions import Annotated

from deepsearch.cps.apis import public as sw_client
from deepsearch.cps.apis.public.models.semantic_ingest_request import (
SemanticIngestRequest,
)
from deepsearch.cps.apis.public.models.task import Task
from deepsearch.cps.client.components.data_indices import (
ElasticProjectDataCollectionSource,
Expand Down Expand Up @@ -92,10 +95,6 @@ class _APISemanticIngestSourcePrivateDataCollection(BaseModel):
]


class _APISemanticIngestSourceWrapper(BaseModel):
source: _APISemanticIngestSourceType


class DSApiDocuments:
def __init__(self, api: CpsApi) -> None:
self.api = api
Expand Down Expand Up @@ -135,7 +134,7 @@ def ingest_for_qa(

task: Task = self.semantic_api.ingest(
proj_key=proj_key,
body=_APISemanticIngestSourceWrapper(source=api_src_data).dict(),
body=SemanticIngestRequest(source=api_src_data.dict()),
)

return task
Expand Down

0 comments on commit 7e1e04e

Please sign in to comment.