agentscope.rpc
Import all rpc related modules in the package.
- class agentscope.rpc.RpcAgentClient(host: str, port: int, agent_id: str = '')[源代码]
基类:
object
A client of Rpc agent server
- __init__(host: str, port: int, agent_id: str = '') None [源代码]
Init a rpc agent client
- 参数:
host (str) – the hostname of the rpc agent server which the
connected. (is)
port (int) – the port of the rpc agent server which the client
connected.
agent_id (str) – the agent id of the agent being called.
- class agentscope.rpc.ResponseStub[源代码]
基类:
object
A stub used to save the response of an rpc call in a sub-thread.
- class agentscope.rpc.RpcMsg
基类:
Message
,Message
- DESCRIPTOR = <google._upb._message.Descriptor object>
- agentscope.rpc.call_in_thread(client: RpcAgentClient, value: str, func_name: str) ResponseStub [源代码]
Call rpc function in a sub-thread.
- 参数:
client (RpcAgentClient) – the rpc client.
x (str) – the value of the reqeust.
func_name (str) – the name of the function being called.
- 返回:
a stub to get the response.
- 返回类型:
ResponseStub