agentscope.server.servicer module

Server of distributed agent

class AgentServerServicer(stop_event: Event, host: str = 'localhost', port: int | None = None, server_id: str | None = None, studio_url: str | None = None, capacity: int = 32, pool_type: str = 'local', redis_url: str = 'redis://localhost:6379', max_pool_size: int = 8192, max_expire_time: int = 7200, max_timeout_seconds: int = 5)[源代码]

基类:RpcAgentServicer

A Servicer for RPC Agent Server (formerly RpcServerSideWrapper)

agent_exists(agent_id: str) bool[源代码]

Check whether the agent exists.

参数:

agent_id (str) – the agent id.

返回:

whether the agent exists.

返回类型:

bool

call_agent_func(request: CallFuncRequest, context: ServicerContext) GeneralResponse[源代码]

Call the specific servicer function.

create_agent(request: CreateAgentRequest, context: ServicerContext) GeneralResponse[源代码]

Create a new agent on the server.

delete_agent(request: StringMsg, context: ServicerContext) GeneralResponse[源代码]

Delete agents from the server.

参数:
  • request (StringMsg) – The value field is the agent_id of the

  • deleted. (agents to be)

delete_all_agents(request: Empty, context: ServicerContext) GeneralResponse[源代码]

clear all agent on the server

download_file(request: StringMsg, context: ServicerContext) Any[源代码]

Download file from local path.

get_agent(agent_id: str) Any[源代码]

Get the object by agent id.

参数:

agent_id (str) – the agent id.

返回:

the object.

返回类型:

Any

get_agent_list(request: Empty, context: ServicerContext) GeneralResponse[源代码]

Get id of all agents on the server as a list.

get_agent_memory(request: StringMsg, context: ServicerContext) StringMsg[源代码]

Get the memory of a specific agent.

get_server_info(request: Empty, context: ServicerContext) GeneralResponse[源代码]

Get the agent server resource usage information.

is_alive(request: Empty, context: ServicerContext) GeneralResponse[源代码]

Check whether the server is alive.

set_model_configs(request: StringMsg, context: ServicerContext) GeneralResponse[源代码]

Set the model configs of the agent server.

stop(request: Empty, context: ServicerContext) GeneralResponse[源代码]

Stop the server.

update_placeholder(request: UpdatePlaceholderRequest, context: ServicerContext) CallFuncResponse[源代码]

Update the value of a placeholder.