agentscope.rpc.rpc_object module

A proxy object which represent a object located in a rpc server.

class RpcObject(cls: type, oid: str, host: str, port: int, connect_existing: bool = False, max_pool_size: int = 8192, max_expire_time: int = 7200, max_timeout_seconds: int = 5, local_mode: bool = True, retry_strategy: ~agentscope.rpc.retry_strategy.RetryBase | dict = <agentscope.rpc.retry_strategy.RetryFixedTimes object>, configs: dict | None = None)[源代码]

基类:ABC

A proxy object which represent an object located in an Rpc server.

备注

When to_dist is called on an object or when using the to_dist parameter to create an object, the object is moved to an Rpc server, and an RpcObject instance is left behind in the local process. The RpcObject will automatically forward all public method invocations to the original object in the rpc server.

create(configs: dict) None[源代码]

create the object on the rpc server.

stop() None[源代码]

Stop the RpcAgent and the rpc server.

get_public_methods(cls: type) list[str][源代码]

Get all public methods of the given class.