Skip to content

Commit 82ce500

Browse files
authored
Merge pull request #197 from AnguseZhang/fix/transfer
docs: update transfer guidelines to include user confirmation checks …
2 parents 4525d7d + dd8cbe9 commit 82ce500

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

agents/matmaster_agent/prompt.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,17 @@ def gen_params_check_info_agent_instruction():
730730
1. **Transfer Intent**: The RESPONSE TEXT must explicitly indicate an immediate transfer action to a specific agent, not just mention or describe the agent's function.
731731
2. **Target Clarity**: The target agent must be clearly identified by name (e.g., "xxx agent" or another explicitly named agent). This includes identification via a JSON object like `{{"agent_name": "xxx_agent"}}`.
732732
3. **Action Directness**: Look for explicit transfer verbs like "transfer", "connect", "hand over", "redirect", or clear transitional phrases like "I will now use", "Switching to", "Activating" that indicate the conversation is being passed to another agent. The presence of a standalone JSON object specifying an agent name is also considered an explicit transfer instruction.
733-
4. **Language Consideration**: Evaluate both English and Chinese transfer indications equally.
734-
5. **Key Indicators**:
733+
4. **User Confirmation Check**: If the response ends with a question or statement that requires user confirmation (e.g., "Should I proceed?", "Do you want to use this file or modify parameters?", "Shall I transfer and proceed with default values?"), then the transfer is not immediate and `is_transfer` should be false. The LLM is pausing for user input before taking action.
734+
5. **Language Consideration**: Evaluate both English and Chinese transfer indications equally.
735+
6. **Key Indicators**:
735736
- ✅ Explicit transfer statements: "I will transfer you to", "Let me connect you with", "Redirecting to", "Handing over to", "正在转移", "切换到"
736737
- ✅ Immediate action indicators: "Now using", "Switching to", "Activating the", "I will now use the", "正在使用"
737738
- ✅ **Explicit JSON transfer object:** A JSON object like `{{"agent_name": "target_agent"}}` is a direct and explicit instruction to transfer.
738739
- ❌ Mere mentions of agent capabilities or potential future use
739740
- ❌ Descriptions of what an agent could do without transfer intent
740741
- ❌ Suggestions or recommendations without explicit transfer instruction
741742
- ❌ Future tense plans without immediate action
743+
- ❌ **Requests for user confirmation before proceeding/transferring.**
742744
743745
RESPONSE TEXT (previous LLM's response to evaluate):
744746
{response_text}
@@ -765,6 +767,12 @@ def gen_params_check_info_agent_instruction():
765767
766768
- Case5 (true): `{{"agent_name":"traj_analysis_agent"}}`
767769
-> Reason: "Standalone JSON object with an 'agent_name' key is an explicit programmatic instruction to transfer."
770+
771+
- Case6 (false): "I can hand you over to the structure_generate_agent. Should I proceed?"
772+
-> Reason: "Although a transfer action ('hand you over to') and a target agent are mentioned, the phrase ends with a request for user confirmation ('Should I proceed?'), indicating the transfer is conditional and not immediate."
773+
774+
- Case7 (false): "正在切换到structure_generate_agent。您是希望直接继续,还是需要修改参数?"
775+
-> Reason: "Uses a transfer phrase '正在切换到' (switching to) but follows it with a question asking for user confirmation, pausing the immediate transfer action."
768776
"""
769777

770778

0 commit comments

Comments
 (0)