@@ -11,17 +11,17 @@ This extension provides the foundational message routing functionality for Jupyt
1111### Basic MessageRouter Setup
1212
1313``` python
14- # The router is automatically available in other extensions via settings
15- router = self .settings[ ' jupyter-ai' ][ ' router' ]
16-
14+ # The router is available in other extensions via settings
15+ router = self .serverapp.web_app. settings.get( " jupyter-ai" , {}).get( " router" )
16+
1717# Register callbacks for different event types
1818def on_new_chat (room_id : str , ychat : YChat):
1919 print (f " New chat connected: { room_id} " )
2020
2121def on_slash_command (room_id : str , message : Message):
2222 print (f " Slash command in { room_id} : { message.body} " )
2323
24- def on_regular_message (room_id : str , message : Message):
24+ def on_regular_message (room_id : str , message : Message):`
2525 print (f " Regular message in { room_id} : { message.body} " )
2626
2727# Register the callbacks
@@ -42,26 +42,6 @@ router.observe_chat_msg("room-id", on_regular_message)
4242- ` observe_chat_init(callback) ` - Called when new chat sessions are initialized with ` (room_id, ychat) `
4343- ` observe_slash_cmd_msg(room_id, callback) ` - Called for messages starting with ` / ` in a specific room
4444- ` observe_chat_msg(room_id, callback) ` - Called for regular (non-slash) messages in a specific room
45- - ` connect_chat(room_id, ychat) ` - Manually connect a chat (usually automatic)
46- - ` disconnect_chat(room_id) ` - Disconnect a chat session
47- - ` cleanup() ` - Clean up all resources when shutting down
48-
49- ## QUICK START
50-
51- Everything that follows after this section was from the extension template. We
52- will need to revise the rest of this README.
53-
54- Development install:
55-
56- ```
57- micromamba install uv jupyterlab nodejs=22
58- jlpm
59- jlpm dev:install
60- ```
61-
62- ## Requirements
63-
64- - JupyterLab >= 4.0.0
6545
6646## Install
6747
0 commit comments