MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / disconnect_websocket

Function disconnect_websocket

examples/chatbot/frontend/chatbot.py:81–89  ·  view source on GitHub ↗

Close the WebSocket connection.

()

Source from the content-addressed store, hash-verified

79
80
81def disconnect_websocket():
82 """Close the WebSocket connection."""
83 if "ws" in st.session_state and st.session_state.ws:
84 try:
85 st.session_state.ws.close()
86 except Exception as e:
87 # Log or handle potential errors on close if necessary
88 print(f"Error closing websocket: {e}")
89 del st.session_state.ws
90
91
92def send_websocket_message(message):

Callers 1

send_websocket_messageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected