agentscope.web.gradio.utils module
web ui utils
- exception ResetException[source]
Bases:
Exception
Custom exception to signal a reset action in the application.
- check_uuid(uid: str | None) str [source]
Checks whether a UUID is provided or generates a default one.
- generate_image_from_name(name: str) str [source]
Generates an image based on the hash of the given name.
- get_chat_msg(uid: str | None = None) list [source]
Retrieves the next chat message from the queue, if available.
- get_player_input(timeout: int | None = None, uid: str | None = None) str [source]
Gets player input from the web UI or command line.
- get_reset_msg(uid: str | None = None) None [source]
Retrieves a reset message from the queue, if available.
- send_msg(msg: str, is_player: bool = False, role: str | None = None, uid: str | None = None, flushing: bool = False, avatar: str | None = None, msg_id: str | None = None) None [source]
Sends a message to the web UI.