[docs]classAgentProxy:"""A helper class that allows you to use an :class:`~autogen_core.AgentId` in place of its associated :class:`~autogen_core.Agent`"""def__init__(self,agent:AgentId,runtime:AgentRuntime):self._agent=agentself._runtime=runtime@propertydefid(self)->AgentId:"""Target agent for this proxy"""returnself._agent@propertydefmetadata(self)->Awaitable[AgentMetadata]:"""Metadata of the agent."""returnself._runtime.agent_metadata(self._agent)
[docs]asyncdefsave_state(self)->Mapping[str,Any]:"""Save the state of the agent. The result must be JSON serializable."""returnawaitself._runtime.agent_save_state(self._agent)
[docs]asyncdefload_state(self,state:Mapping[str,Any])->None:"""Load in the state of the agent obtained from `save_state`. Args: state (Mapping[str, Any]): State of the agent. Must be JSON serializable. """awaitself._runtime.agent_load_state(self._agent,state)