Azure / Azure/agent-openai-python-banking-assistant

[User Story] - Provide support for user approval before payment gets submitted

Đang mở
#55 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
2
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Description**
Payment agent ask the user to confirm the submitPayment MCP tool execution

**Current Behavior**
Today Payment Agent is instructed to ask the user to review payment details and confirm execution. this use natural language instructions that are part of the agent system prompt. This is not deterministic. We need a deterministic way to implement this human-in-the-loop pattern for real time user feedback using a conversational chat.

**Acceptance Criteria**
List clear, testable outcomes. Example:
- [ ] Payment Agent 'submitPayment' tool execution is intercepted, an approval request is sent to the chat for the user to confirm.

**Design Considerations**
- When defining payment_mcp_server in Payment Agent, use "approval_mode" params in MCPStreamableHTTPTool class. Documentation reference: [approval_mode](https://github.com/microsoft/agent-framework/blob/15433700275a2a26071016d5f824f78feb0527bb/python/packages/core/agent_framework/_mcp.py#L820C9-L820C22)
- How to configure approval_mode sample : `approval_mode={
"always_require_approval": ["processPayment"]
}`
- We need to check if there is any approval request in agent response, register the user request in memory, send an approval generated text along with request id back as part for chat response, check for approval in user response and let the agent execute the tool. An example of the user approval flow using thread: https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/tools/ai_tool_with_approval_and_threads.py

**Main Affected Modules and/or Classes**

- app/copilot/app/agents/azure_chat/supervisor_agent.py
- app/copilot/app/agents/azure_chat/payment_agent.py
- app/copilot/app/agents/foundry/supervisor_agent.py
- app/copilot/app/agents/foundry/payment_agent.py

**Additional Context (optional)**
The current design strategy is based on agents-as-tools supervisor implementation. In the future we will migrate to the implementation based on hand-off built-in orchestration provided by agent framework and the user approval approach will probably require a significant solution refactoring.

---
*Migrated from: https://github.com/Azure-Samples/agent-openai-python-banking-assistant/issues/5*

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với bốn module được liệt kê, supervisor_agent.py và payment_agent.py, sau đó đọc tài liệu tham chiếu về approval_mode của MCPStreamableHTTPTool và sample approval-with-threads được liên kết. Theo dõi cách các yêu cầu phê duyệt và phản hồi của chat được biểu diễn và lưu trữ. Hoàn thành khi submitPayment bị chặn, một yêu cầu phê duyệt và request ID đến được chat, và phản hồi của người dùng cho phép tool thực thi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
ai, payments
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.