Replies: 1 comment
|
Returning I would split the integration into two HTTP/A2A turns: async def collect_pending(stream):
pending = []
async for event in stream:
if (
event.type == "request_info"
and isinstance(event.data, HumanFeedbackRequest)
):
pending.append({
"request_id": event.request_id,
"prompt": event.data.prompt,
})
# Forward output events to the UI as usual.
return pending
# Initial request
pending = await collect_pending(
workflow.run("start", stream=True)
)
# Return/publish an A2A `input-required` state containing request_id + prompt.
# A later request containing the React user's answer
pending = await collect_pending(
workflow.run(
stream=True,
responses={payload.request_id: payload.answer},
)
)The React client should treat For multiple users/tasks, keep these items associated with the A2A task/context:
Your file-backed checkpointer can persist workflow state, but it does not turn a later A2A text message into the With that separation, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi Team,
I am trying to implement MAF HITL with my React Js as frontend but not able to understand how it will work with the actual ui. The MAF examples shows the HITL implementation with the python 'input()' method. So i tried to directly return the Agent question from that line to ask user for input like below (I am using a2a-sdk for A2A communication):
I followed this example https://github.com/microsoft/agent-framework/blob/main/python/samples/03-workflows/human-in-the-loop/guessing_game_with_human_input.py
This successfully returns the Agent question but when the user replies (FYI i am using the FileCheckpointerStorage) to the Agent question i get this error:
AgentInvalidResponseException( agent_framework.exceptions.AgentInvalidResponseException: Unexpected content type while awaiting request info responses. Request Error (ID: fa0calcc-9c0f-467a-b58e-f8feec852159): Code=-32603, Message='Unexpected content type while awaiting request info responses.'
NOTE : I followed the above example in my actual code which is in my office laptop and i can not access it, hence referring to this example.
Please help.
All reactions