Skip to content

Commit

Permalink
Async Agent Interface Refactor (#2467)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Fiedler <jan@union.ai>
  • Loading branch information
Future-Outlier authored and fiedlerNr9 committed Jul 25, 2024
1 parent 04cbf01 commit 7764cbf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flytekit/extend/backend/base_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def metadata_type(self) -> ResourceMeta:
def create(
self,
task_template: TaskTemplate,
output_prefix: str,
inputs: Optional[LiteralMap],
output_prefix: Optional[str],
task_execution_metadata: Optional[TaskExecutionMetadata],
**kwargs,
) -> ResourceMeta:
Expand Down Expand Up @@ -297,7 +297,9 @@ def execute(self: PythonTask, **kwargs) -> LiteralMap:
task_template = get_serializable(OrderedDict(), ss, self).template
self._agent = AgentRegistry.get_agent(task_template.type, task_template.task_type_version)

resource_mata = asyncio.run(self._create(task_template, output_prefix, kwargs))
resource_mata = asyncio.run(
self._create(task_template=task_template, output_prefix=output_prefix, inputs=kwargs)
)
resource = asyncio.run(self._get(resource_meta=resource_mata))

if resource.phase != TaskExecution.SUCCEEDED:
Expand Down

0 comments on commit 7764cbf

Please sign in to comment.