Skip to content

Commit eeb8e32

Browse files
committed
Merge branch 'feat/job_complete_card' into dev/zhouh
2 parents a64863e + 99269e6 commit eeb8e32

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

agents/matmaster_agent/callback.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from agents.matmaster_agent.constant import FRONTEND_STATE_KEY
1616
from agents.matmaster_agent.model import UserContent
1717
from agents.matmaster_agent.prompt import get_user_content_lang
18+
from agents.matmaster_agent.style import JobCompleteCard
1819
from agents.matmaster_agent.utils.job_utils import get_job_status, has_job_running, get_running_jobs_detail
1920

2021
logger = logging.getLogger(__name__)
@@ -100,7 +101,7 @@ async def matmaster_check_job_status(callback_context: CallbackContext, llm_resp
100101
reset = True
101102
function_call_id = f"call_{str(uuid.uuid4()).replace('-', '')[:24]}"
102103
callback_context.state['origin_job_id'] = origin_job_id
103-
llm_response.content.parts.append(Part(text=job_complete_intro.format(job_id=job_id)))
104+
llm_response.content.parts.append(Part(text=JobCompleteCard.format(job_id=job_id)))
104105
llm_response.content.parts.append(Part(function_call=FunctionCall(id=function_call_id,
105106
name='transfer_to_agent',
106107
args={'agent_name': agent_name})))

agents/matmaster_agent/style.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
JobCompleteCard = """
2+
<div style="
3+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
4+
border-radius: 12px;
5+
padding: 20px;
6+
margin: 16px 0;
7+
color: white;
8+
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
9+
">
10+
<div style="display: flex; align-items: center; gap: 12px; margin-bottom: 8px;">
11+
<div style="
12+
background: rgba(255, 255, 255, 0.2);
13+
padding: 6px 12px;
14+
border-radius: 20px;
15+
backdrop-filter: blur(10px);
16+
font-size: 12px;
17+
font-weight: bold;
18+
">🚀 任务状态</div>
19+
<div style="
20+
background: rgba(255, 255, 255, 0.1);
21+
padding: 4px 10px;
22+
border-radius: 6px;
23+
font-family: monospace;
24+
">ID: {job_id}</div>
25+
</div>
26+
<div style="
27+
font-size: 16px;
28+
font-weight: 500;
29+
margin-top: 8px;
30+
">已完成 · 正在转移至 Agent</div>
31+
<div style="
32+
font-size: 12px;
33+
opacity: 0.9;
34+
margin-top: 4px;
35+
">结果获取中...</div>
36+
</div>
37+
"""

0 commit comments

Comments
 (0)