Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ai
/
ai-workflow
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3d0c28e0
authored
Jun 02, 2026
by
sunqi02
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
refactor(agent_hub): extract SUB_AGENT_TEMPERATURE constant and fix comment style
1 parent
2c7eef2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
workspace/agent-admin/backend/app/service/agent_hub.py
workspace/agent-admin/backend/app/service/agent_hub.py
View file @
3d0c28e
...
@@ -20,6 +20,9 @@ from agentscope.memory import InMemoryMemory
...
@@ -20,6 +20,9 @@ from agentscope.memory import InMemoryMemory
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
# sub_agent 专用低 temperature:调用子 Agent 处理确定性任务时使用更稳定的输出
SUB_AGENT_TEMPERATURE
=
0.2
REVIEW_GUIDE
=
"""
REVIEW_GUIDE
=
"""
## 收到子Agent返回后
## 收到子Agent返回后
...
@@ -135,12 +138,12 @@ class AgentHub:
...
@@ -135,12 +138,12 @@ class AgentHub:
)
)
self
.
formatter
=
OpenAIChatFormatter
()
self
.
formatter
=
OpenAIChatFormatter
()
# sub_agent 专用 model:
temperature=0.2
,更确定性
# sub_agent 专用 model:
低 temperature
,更确定性
self
.
sub_model
=
OpenAIChatModel
(
self
.
sub_model
=
OpenAIChatModel
(
model_name
=
self
.
main_model_config
.
model_name
,
model_name
=
self
.
main_model_config
.
model_name
,
api_key
=
self
.
main_model_config
.
api_key
,
api_key
=
self
.
main_model_config
.
api_key
,
stream
=
False
,
stream
=
False
,
generate_kwargs
=
{
"temperature"
:
0.2
},
generate_kwargs
=
{
"temperature"
:
SUB_AGENT_TEMPERATURE
},
client_kwargs
=
{
"base_url"
:
self
.
main_model_config
.
api_base
}
client_kwargs
=
{
"base_url"
:
self
.
main_model_config
.
api_base
}
)
)
...
@@ -461,7 +464,7 @@ class AgentHub:
...
@@ -461,7 +464,7 @@ class AgentHub:
sub_agent
=
ReActAgent
(
sub_agent
=
ReActAgent
(
name
=
agent_code
,
name
=
agent_code
,
sys_prompt
=
sub_prompt
,
sys_prompt
=
sub_prompt
,
model
=
self
.
sub_model
,
#
改:sub_agent 专用低 temperature
model
=
self
.
sub_model
,
#
sub_agent 专用低 temperature 实例
formatter
=
self
.
formatter
,
formatter
=
self
.
formatter
,
toolkit
=
self
.
agent_toolkits
.
get
(
agent_code
,
self
.
toolkit
),
toolkit
=
self
.
agent_toolkits
.
get
(
agent_code
,
self
.
toolkit
),
memory
=
sub_memory
,
memory
=
sub_memory
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment