diff --git a/instill/clients/pipeline.py b/instill/clients/pipeline.py index d83b2a6..42be638 100644 --- a/instill/clients/pipeline.py +++ b/instill/clients/pipeline.py @@ -117,13 +117,15 @@ def is_serving(self) -> bool: def create_pipeline( self, name: str, + description: str, recipe: Struct, async_enabled: bool = False, ) -> pipeline_interface.CreateUserPipelineResponse: pipeline = pipeline_interface.Pipeline( id=name, - recipe=recipe, + description=description, ) + pipeline.recipe.update(recipe) if async_enabled: return RequestFactory( method=self.hosts[self.instance].async_client.CreateUserPipeline, @@ -306,24 +308,28 @@ def trigger_pipeline( data: list, async_enabled: bool = False, ) -> pipeline_interface.TriggerUserPipelineResponse: + request=pipeline_interface.TriggerUserPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}", + ) + for input in inputs: + trigger_inputs = Struct() + trigger_inputs.update(input) + request.inputs.append(trigger_inputs) + for d in data: + trigger_data = Struct() + trigger_data.update(d) + request.data.append(trigger_data) + if async_enabled: return RequestFactory( method=self.hosts[self.instance].async_client.TriggerUserPipeline, - request=pipeline_interface.TriggerUserPipelineRequest( - name=f"{self.target_namespace}/pipelines/{name}", - inputs=inputs, - data=data, - ), + request=request, metadata=self.hosts[self.instance].metadata, ).send_async() return RequestFactory( method=self.hosts[self.instance].client.TriggerUserPipeline, - request=pipeline_interface.TriggerUserPipelineRequest( - name=f"{self.target_namespace}/pipelines/{name}", - inputs=inputs, - data=data, - ), + request=request, metadata=self.hosts[self.instance].metadata, ).send_sync()