Skip to content

Commit

Permalink
Support agent_id in rpc agent server (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-x-c authored Apr 3, 2024
1 parent 86c648f commit 07f9dbb
Show file tree
Hide file tree
Showing 11 changed files with 506 additions and 118 deletions.
27 changes: 14 additions & 13 deletions notebook/distributed_debate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,20 @@
"\n",
"\n",
"\"\"\"Setup the main debate competition process\"\"\"\n",
"participants = [pro_agent, con_agent, judge_agent]\n",
"hint = Msg(name=\"System\", content=ANNOUNCEMENT)\n",
"x = None\n",
"with msghub(participants=participants, announcement=hint):\n",
" for _ in range(3):\n",
" pro_resp = pro_agent(x)\n",
" logger.chat(pro_resp)\n",
" con_resp = con_agent(pro_resp)\n",
" logger.chat(con_resp)\n",
" x = judge_agent(con_resp)\n",
" logger.chat(x)\n",
" x = judge_agent(x)\n",
" logger.chat(x)\n"
"if __name__ == \"__main__\":\n",
" participants = [pro_agent, con_agent, judge_agent]\n",
" hint = Msg(name=\"System\", content=ANNOUNCEMENT)\n",
" x = None\n",
" with msghub(participants=participants, announcement=hint):\n",
" for _ in range(3):\n",
" pro_resp = pro_agent(x)\n",
" logger.chat(pro_resp)\n",
" con_resp = con_agent(pro_resp)\n",
" logger.chat(con_resp)\n",
" x = judge_agent(con_resp)\n",
" logger.chat(x)\n",
" x = judge_agent(x)\n",
" logger.chat(x)\n"
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions src/agentscope/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def to_dist(
self,
host: str = "localhost",
port: int = None,
max_pool_size: int = 100,
max_pool_size: int = 8192,
max_timeout_seconds: int = 1800,
launch_server: bool = True,
local_mode: bool = True,
Expand All @@ -217,7 +217,7 @@ def to_dist(
Hostname of the rpc agent server.
port (`int`, defaults to `None`):
Port of the rpc agent server.
max_pool_size (`int`, defaults to `100`):
max_pool_size (`int`, defaults to `8192`):
Max number of task results that the server can accommodate.
max_timeout_seconds (`int`, defaults to `1800`):
Timeout for task results.
Expand Down Expand Up @@ -246,4 +246,5 @@ def to_dist(
launch_server=launch_server,
local_mode=local_mode,
lazy_launch=lazy_launch,
agent_id=self.agent_id,
)
Loading

0 comments on commit 07f9dbb

Please sign in to comment.