Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
ef3ac58
enable publish
May 22, 2025
008f8d9
fixes
May 22, 2025
87d5189
fixes
May 22, 2025
baad64a
fixes
May 22, 2025
d08263d
format fixes
May 22, 2025
74fecc8
format fixes
May 22, 2025
95de355
format fixes
May 22, 2025
de32116
format fixes
May 22, 2025
3ecb002
format fixes
May 22, 2025
9e3062f
format fixes
May 22, 2025
bd46340
fix sorting
May 22, 2025
2d182aa
optimize input/ouput validations if else statements
May 22, 2025
d37a325
early return in Pipeline import
May 22, 2025
96f02e8
change to debug log status
May 22, 2025
0c9e746
Add an SDK class with init method
May 22, 2025
0293cbc
rephrase pydoc style
May 22, 2025
504db6d
rephrase pydoc style
May 22, 2025
ab70b37
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 22, 2025
20c1123
support sync and async publishing
May 22, 2025
b39abca
use yaml parsing
May 22, 2025
30ff1ef
fix docstrings
May 23, 2025
d7ee0d6
fix docstrings
May 23, 2025
a52ec42
fix test interference
May 23, 2025
0d0e8f9
Merge branch 'main' into feat/support-pipeline-publishing
faymarie May 23, 2025
fe57e85
fix format
May 23, 2025
9b9802f
Merge branch 'feat/support-pipeline-publishing' of github.com:deepset…
May 23, 2025
6b831e6
use separate configs for Index and Pipeline
May 26, 2025
1414ef5
add docstrings directly to code
May 26, 2025
8665122
add docstrings directly to code
May 26, 2025
6d20c97
formatting
May 26, 2025
f793377
docs fixes
May 27, 2025
621b9cc
revert local version
May 27, 2025
947baa8
close event loop if it was newly created
May 27, 2025
79944fd
test exception
May 27, 2025
24adfbb
use Mock object
May 27, 2025
a1ff3e6
remove changed stout
May 27, 2025
f3671ba
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 27, 2025
395220f
reset rate limiter in tests
May 27, 2025
0357e26
Merge branch 'feat/support-pipeline-publishing' of github.com:deepset…
May 27, 2025
17ece95
fix import
May 27, 2025
4f0d420
re-add log configs
May 27, 2025
1e5e08e
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
fd35e31
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 27, 2025
fbfddd8
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 27, 2025
25df212
move _convert_to_yaml_dict to models
May 27, 2025
98bb19a
rename to _from_haystack_pipelin
May 27, 2025
eb66eff
haystack version
May 27, 2025
ae68611
rename to import instead of publish
May 27, 2025
15ee65d
revert python version
May 27, 2025
355dad2
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
548ddb8
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
c91400e
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
861d929
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
74d2bd3
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
5b8403e
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
33495b5
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
2c277b1
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
2391417
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
f54edb9
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
9eaff55
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
8f27c50
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
bce1ffe
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
a8a3022
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
7a90fdc
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
57cba62
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
6255e24
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
2c99adb
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
8b9b8ca
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
567ccdc
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
ea42525
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
7e55416
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
66944cf
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
9950e96
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
d446f67
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
19b01fb
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
0a4cfa3
fix dics
May 27, 2025
7294f9e
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 27, 2025
29470c6
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
3be9b59
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 27, 2025
cff5266
fix docs
May 27, 2025
b33bbcf
Merge branch 'main' into feat/support-pipeline-publishing
faymarie May 27, 2025
1a7e0f6
fix docs
May 27, 2025
224b154
Merge branch 'feat/support-pipeline-publishing' of github.com:deepset…
May 27, 2025
dd71919
fix docs
May 27, 2025
8c03b03
fix docs
May 27, 2025
f7bfaf2
fix docs
May 27, 2025
b51a45e
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
53e7c66
Update deepset_cloud_sdk/workflows/pipeline_client/models.py
faymarie May 27, 2025
002d381
fix docs
May 27, 2025
a19c0f4
fix docs
May 27, 2025
99750b3
fix docs
May 27, 2025
68d0c2f
add fullstops
May 27, 2025
aafa786
from future import annothations
May 27, 2025
6a3023e
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 27, 2025
6f697b1
Update deepset_cloud_sdk/workflows/sdk.py
faymarie May 27, 2025
7f3d17e
from future import annothations
May 27, 2025
9834bb9
update docstring to use paramater
May 27, 2025
7e36c0f
remove initilized
May 27, 2025
5e6a5bf
disable too few public methods
May 27, 2025
764563d
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 28, 2025
ff11f92
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 28, 2025
ae3a2bc
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 28, 2025
d4c3f13
Update deepset_cloud_sdk/workflows/pipeline_client/pipeline_service.py
faymarie May 28, 2025
09c6e39
fix docstring
May 28, 2025
402f189
fix docstring
May 28, 2025
10cd246
fix docstring
May 28, 2025
f119921
fix docstring
May 28, 2025
0f71809
fix docstring
May 28, 2025
801b703
fix docstring
May 28, 2025
e06ad7b
fix docstring
May 28, 2025
634b6ed
fix docstring
May 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion deepset_cloud_sdk/workflows/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
"""Workflows for the deepset cloud SDK."""
"""Workflows for deepset AI platform SDK."""

from deepset_cloud_sdk.workflows.pipeline_client.models import (
IndexConfig,
IndexInputs,
IndexOutputs,
PipelineConfig,
PipelineInputs,
PipelineOutputs,
)
from deepset_cloud_sdk.workflows.sdk import DeepsetSDK

__all__ = [
"PipelineInputs",
"IndexInputs",
"IndexOutputs",
"PipelineOutputs",
"IndexConfig",
"PipelineConfig",
"DeepsetSDK",
]
1 change: 1 addition & 0 deletions deepset_cloud_sdk/workflows/pipeline_client/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Package to enable importing pipelines and indexes to deepset AI platform."""
156 changes: 156 additions & 0 deletions deepset_cloud_sdk/workflows/pipeline_client/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
"""Models for the pipeline service."""
from typing import List

from pydantic import BaseModel, Field, model_validator


class InputOutputBaseModel(BaseModel):
"""Base model for input and output configurations.

This class provides common functionality for input and output models, such as YAML conversion.
"""

def to_yaml_dict(self) -> dict:
"""Convert the model to a YAML-compatible dictionary.

Clears empty values from the dictionary.

:return: Dictionary ready for YAML serialization.
"""
fields = self.model_dump(exclude_none=True)
# Remove empty values
return {k: v for k, v in fields.items() if v}
Comment thread
wochinge marked this conversation as resolved.


class PipelineInputs(InputOutputBaseModel):
"""Pipeline input configuration.

Defines the components that should receive the Query input and any filters that apply to it.

:param query: List of components that will receive the `query` input.
Specify each component in the format: '<component-name>.<run-method-parameter-name>', for example: 'retriever.query'
:param filters: Optional list of components that will receive the filters input.
Specify each component using the format: '<component-name>.<run-method-parameter-name>', for example: 'retriever.filters'.
"""

model_config = {"extra": "allow"} # Allow additional fields in inputs

query: List[str] = Field(
...,
description=(
"List of components and parameters that will receive the `query` input when they are executed. "
"Use the format: '<component-name>.<run-method-parameter-name>', for example: 'retriever.query'."
),
min_items=1,
Comment thread
faymarie marked this conversation as resolved.
)
filters: List[str] = Field(
default_factory=list,
description=(
"List of components and parameters that will receive the `filters` input when they are executed. "
"Use the format: '<component-name>.<run-method-parameter-name>', for example: 'retriever.filters'."
),
)


class PipelineOutputs(InputOutputBaseModel):
"""Pipeline output configuration.

Specify the components that will output `documents`, `answers`, or both.
You must include at least one. The outputs of these components become the final output of the pipeline.

:param documents: Name of the component and parameter that will provide `documents` as output.
Use the format '<component-name>.<output-parameter>', for example: 'retriever.documents'.
:param answers: Name of the component and parameter that will provide `answers` as output.
Use the format '<component-name>.<output-parameter>', for example: 'reader.answers'.
"""

model_config = {"extra": "allow"} # Allow additional fields in outputs

documents: str | None = Field(
default=None,
description="Name of the component that will provide `documents` as output. "
Comment thread
faymarie marked this conversation as resolved.
"Format: '<component-name>.<output-parameter>', for example: 'meta_ranker.documents'",
)
answers: str | None = Field(
default=None,
description="Name of the component that will provide `answers` as output. "
"Format: '<component-name>.<output-parameter>', for example: 'answers_builder.answers'",
)

@model_validator(mode="after")
def validate_documents_xor_answers(self) -> "PipelineOutputs":
Comment thread
faymarie marked this conversation as resolved.
"""Validate that either `documents`, `answers`, or both are defined."""
if not self.documents and not self.answers:
raise ValueError("Define at least one pipeline output, either 'documents, 'answers' or both.")
return self


class IndexOutputs(InputOutputBaseModel):
"""Output configuration for the index.

Index outputs are optional.
"""

model_config = {"extra": "allow"} # Allow additional fields in outputs


class PipelineConfig(BaseModel):
"""Configuration required to import the pipeline into deepset AI Platform.

:param name: Name of the pipeline to be imported
:param inputs: Pipeline input configuration. Use `PipelineInputs` model to define the inputs.
:param outputs: Pipeline output configuration. Use `PipelineOutputs` model to define the outputs.
"""

model_config = {"extra": "forbid"}

name: str = Field(..., description="The name of the pipeline to be imported", min_length=1)
inputs: PipelineInputs = Field(
default_factory=PipelineInputs,
description=("Pipeline input configuration. Use `PipelineInputs` model to define the inputs."),
)
outputs: PipelineOutputs = Field(
default_factory=PipelineOutputs,
description=("Pipeline output configuration. Use `PipelineOutputs` model to define the outputs."),
)


class IndexInputs(InputOutputBaseModel):
"""Configuration required to import an index into deepset AI Platform.

Defines the index components that should receive the `Files` input.

:param files: List of components and parameters that should receive files as input.
Specify the components using the format: '<component-name>.<run-method-parameter-name>', for example: 'file_type_router.sources'.
"""

model_config = {"extra": "allow"} # Allow additional fields in inputs

files: List[str] = Field(
default_factory=list,
description=(
"List of components and parameters that will receive files as input when they're executed. "
"Format: '<component-name>.<run-parameter-name>', for example: 'file_type_router.sources'."
),
)


class IndexConfig(BaseModel):
"""Index configuration for importing an index to deepset AI platform.

:param name: Name of the index to be imported.
:param inputs: Index input configuration. Use `IndexInputs` model to define the inputs.
:param outputs: Index output configuration. Optional. Use `IndexOutputs` model to define the outputs.
"""

model_config = {"extra": "forbid"}

name: str = Field(..., description="Name of the index to be imported.", min_length=1)
inputs: IndexInputs = Field(
default_factory=IndexInputs,
description=("Input configuration for the index. Use `IndexInputs` model to define the inputs."),
)
outputs: IndexOutputs | None = Field(
Comment thread
faymarie marked this conversation as resolved.
default_factory=IndexOutputs,
description=("Optional output configuration for the index. Use `IndexOutputs` model to define the outputs."),
)
Loading
Loading