(self, prompt: str)
| 44 | |
| 45 | class 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, |
nothing calls this directly
no test coverage detected