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

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

Abierto
#55 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Sin datos de lenguaje
Estrellas
2
Forks
5
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**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*

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza con los cuatro módulos enumerados, supervisor_agent.py y payment_agent.py; después, lee la referencia de approval_mode de MCPStreamableHTTPTool y el ejemplo vinculado approval-with-threads. Traza cómo se representan y almacenan las solicitudes de aprobación y las respuestas del chat. Se considera completado cuando submitPayment es interceptado, una solicitud de aprobación y un request ID llegan al chat, y una respuesta del usuario permite que la herramienta se ejecute.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
ai, payments
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.