33from deepset_mcp .api .exceptions import UnexpectedAPIError
44from deepset_mcp .api .pipeline .models import DeepsetPipeline , PipelineValidationResult , ValidationError
55from deepset_mcp .api .protocols import AsyncClientProtocol
6- from deepset_mcp .api .transport import raise_for_status
6+ from deepset_mcp .api .transport import TransportResponse , raise_for_status
77
88
99class PipelineResource :
@@ -109,7 +109,7 @@ async def get(self, pipeline_name: str, include_yaml: bool = True) -> DeepsetPip
109109
110110 return pipeline
111111
112- async def create (self , name : str , yaml_config : str ) -> None :
112+ async def create (self , name : str , yaml_config : str ) -> TransportResponse :
113113 """Create a new pipeline with a name and YAML config."""
114114 data = {"name" : name , "query_yaml" : yaml_config }
115115 resp = await self ._client .request (
@@ -120,12 +120,14 @@ async def create(self, name: str, yaml_config: str) -> None:
120120
121121 raise_for_status (resp )
122122
123+ return resp
124+
123125 async def update (
124126 self ,
125127 pipeline_name : str ,
126128 updated_pipeline_name : str | None = None ,
127129 yaml_config : str | None = None ,
128- ) -> None :
130+ ) -> TransportResponse :
129131 """Update name and/or YAML config of an existing pipeline."""
130132 # Handle name update first if any
131133 if updated_pipeline_name is not None :
@@ -139,6 +141,9 @@ async def update(
139141
140142 pipeline_name = updated_pipeline_name
141143
144+ if yaml_config is None :
145+ return name_resp
146+
142147 if yaml_config is not None :
143148 yaml_resp = await self ._client .request (
144149 endpoint = f"v1/workspaces/{ self ._workspace } /pipelines/{ pipeline_name } /yaml" ,
@@ -147,3 +152,7 @@ async def update(
147152 )
148153
149154 raise_for_status (yaml_resp )
155+
156+ return yaml_resp
157+
158+ raise ValueError ("Either `updated_pipeline_name` or `yaml_config` must be provided." )
0 commit comments