ship grants, a2a_client, discovery, sandbox SDK + tests
This commit is contained in:
@@ -372,19 +372,26 @@ class A2AAgent(Generic[ConfigT, AuthT], metaclass=_AgentMeta):
|
||||
secrets: dict[str, str] | None = None,
|
||||
task_id: str = "local-task",
|
||||
workspace: Any = None, # WorkspaceClient or None
|
||||
sandbox: Any = None, # SandboxClient or None
|
||||
a2a: Any = None, # A2AClient or None
|
||||
discover: Any = None, # DiscoveryClient or None
|
||||
**kwargs: Any,
|
||||
) -> Any:
|
||||
"""Convenience harness: build a :class:`LocalRunContext` and invoke.
|
||||
|
||||
Useful in tests and notebooks. ``auth`` defaults to a default-constructed
|
||||
instance of the agent's ``auth_model`` (works for :class:`NoAuth`; pass
|
||||
an explicit instance for auth models with required fields). Pass
|
||||
``workspace=`` to bind a :class:`WorkspaceClient`.
|
||||
Useful in tests and notebooks. Pass ``workspace=``, ``sandbox=``,
|
||||
``a2a=``, and/or ``discover=`` to bind concrete runtime clients.
|
||||
"""
|
||||
if auth is None:
|
||||
auth = typing.cast(AuthT, type(self).auth_model())
|
||||
ctx: LocalRunContext[AuthT] = LocalRunContext(
|
||||
auth=auth, secrets=secrets, task_id=task_id, workspace=workspace
|
||||
auth=auth,
|
||||
secrets=secrets,
|
||||
task_id=task_id,
|
||||
workspace=workspace,
|
||||
sandbox=sandbox,
|
||||
a2a=a2a,
|
||||
discover=discover,
|
||||
)
|
||||
return await self.invoke(skill_name, ctx, **kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user