|
Hi Team, 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. |
Replies: 2 comments 1 reply
|
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, |
|
Thanks for a clear example code snippet ECD5A. This worked for me! |
input()is only the sample's UI adapter. The workflow contract is the important part: after arequest_infoevent, that workflow run is suspended and must be resumed with a response map keyed by the exactevent.request_id.Returning
new_agent_text_message(...)at that point sends an A2A message where Agent Framework is waiting for the declaredstrresponse toHumanFeedbackRequest. That is why it reports an unexpected content type.I would split the integration into two HTTP/A2A turns: