MCPcopy Create free account
hub / github.com/Chainlit/cookbook / get_human_input

Method get_human_input

pyautogen/async_app.py:46–78  ·  view source on GitHub ↗
(self, prompt: str)

Source from the content-addressed store, hash-verified

44
45class ChainlitUserProxyAgent(UserProxyAgent):
46 async def get_human_input(self, prompt: str) -> str:
47 if prompt.startswith(
48 "Provide feedback to assistant. Press enter to skip and use auto-reply"
49 ):
50 res = await ask_helper(
51 cl.AskActionMessage,
52 content="Continue or provide feedback?",
53 actions=[
54 cl.Action(
55 name="continue",
56 payload={"value": "continue"},
57 label="✅ Continue",
58 ),
59 cl.Action(
60 name="feedback",
61 payload={"value": "feedback"},
62 label="💬 Provide feedback",
63 ),
64 cl.Action(
65 name="exit",
66 payload={"value": "exit"},
67 label="🔚 Exit Conversation",
68 ),
69 ],
70 )
71 if res.get("payload").get("value") == "continue":
72 return ""
73 if res.get("payload").get("value") == "exit":
74 return "exit"
75
76 reply = await ask_helper(cl.AskUserMessage, content=prompt, timeout=60)
77
78 return reply["content"].strip()
79
80 async def a_send(
81 self,

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
ask_helperFunction · 0.70

Tested by

no test coverage detected