Skip to content

Commit

Permalink
feat: expose gen AI params (#165)
Browse files Browse the repository at this point in the history
Signed-off-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com>
  • Loading branch information
vagenas authored Feb 16, 2024
1 parent 0e3fbbd commit dc3db56
Show file tree
Hide file tree
Showing 9 changed files with 249 additions and 56 deletions.
1 change: 1 addition & 0 deletions deepsearch/cps/apis/public/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions deepsearch/cps/apis/public/models/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

121 changes: 121 additions & 0 deletions deepsearch/cps/apis/public/models/semantic_ingest_req_params.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion deepsearch/cps/apis/public/models/semantic_ingest_request.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 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_req_params import (
SemanticIngestReqParams,
)
from deepsearch.cps.apis.public.models.semantic_ingest_request import (
SemanticIngestRequest,
)
Expand Down Expand Up @@ -89,6 +92,7 @@ def semantic_ingest(
self,
project: Union[Project, str],
data_source: SemIngestSource,
skip_ingested_docs: bool = True,
) -> Task:

proj_key = project.key if isinstance(project, Project) else project
Expand All @@ -112,10 +116,15 @@ def semantic_ingest(
)
else:
raise RuntimeError("Unknown data source format for ingest_for_qa")

req_params = SemanticIngestReqParams(
skip_ingested_docs=skip_ingested_docs,
)
task: Task = self.semantic_api.ingest(
proj_key=proj_key,
body=SemanticIngestRequest(source=api_src_data.dict()),
body=SemanticIngestRequest(
source=api_src_data.dict(),
parameters=req_params.to_dict(),
),
)

return task
Expand Down
Loading

0 comments on commit dc3db56

Please sign in to comment.