Skip to content

Commit

Permalink
fix(agents-api): set include remote to true in prepare_for_step
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad-mtos committed Nov 29, 2024
1 parent 5f370b3 commit b82d159
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion agents-api/agents_api/common/protocol/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def model_dump(self, *args, **kwargs) -> dict[str, Any]:
return dump | execution_input

async def prepare_for_step(
self, *args, include_remote: bool = False, **kwargs
self, *args, include_remote: bool = True, **kwargs
) -> dict[str, Any]:
current_input = self.current_input
inputs = self.inputs
Expand Down
14 changes: 11 additions & 3 deletions agents-api/agents_api/common/storage_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def load_args(
}
)
elif isinstance(arg, BaseRemoteModel):
new_args.append(arg.unload_all())
new_args.append(await arg.unload_all())

elif isinstance(arg, BaseModel):
for field in arg.model_fields.keys():
Expand All @@ -119,7 +119,11 @@ async def load_args(
],
)
elif isinstance(getattr(arg, field), BaseRemoteModel):
setattr(arg, field, getattr(arg, field).unload_all())
setattr(
arg,
field,
await getattr(arg, field).unload_all(),
)

new_args.append(arg)

Expand Down Expand Up @@ -163,7 +167,11 @@ async def load_args(
],
)
elif isinstance(getattr(v, field), BaseRemoteModel):
setattr(v, field, getattr(v, field).unload_all())
setattr(
v,
field,
await getattr(v, field).unload_all(),
)
new_kwargs[k] = v

else:
Expand Down

0 comments on commit b82d159

Please sign in to comment.