Skip to content

Commit 6b5f6cf

Browse files
authored
Merge pull request #8 from Zsailer/fix-cursor-positioning
Add collaborative notebook editing with real-time cursor tracking
2 parents 07ddd7c + 73e1843 commit 6b5f6cf

File tree

7 files changed

+1465
-134
lines changed

7 files changed

+1465
-134
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,35 @@ This extension provides runtime-discoverable tools compatible with OpenAI-style
3232

3333
These tools are ideal for agents that assist users with code editing, version control, or dynamic notebook interaction.
3434

35+
______________________________________________________________________
36+
37+
## 🔧 Creating Collaborative Tools
38+
39+
For developers building AI tools that need collaborative awareness, `jupyter_ai_tools` provides a `collaborative_tool` decorator that automatically enables real-time collaboration features.
40+
41+
This decorator enables other users in the same Jupyter environment to see when your AI tool is actively working on shared notebooks, improving the collaborative experience.
42+
43+
```python
44+
from jupyter_ai_tools.utils import collaborative_tool
45+
46+
# Define user information
47+
user_info = {
48+
"name": "Alice",
49+
"color": "var(--jp-collaborator-color1)",
50+
"display_name": "Alice Smith"
51+
}
52+
53+
# Apply collaborative awareness to your tool
54+
@collaborative_tool(user=user_info)
55+
async def my_notebook_tool(file_path: str, content: str):
56+
"""Your tool implementation here"""
57+
# Tool automatically sets user awareness for:
58+
# - Global awareness system (all users can see Alice is active)
59+
# - Notebook-specific awareness (for .ipynb files)
60+
return f"Processed {file_path}"
61+
```
62+
63+
3564
______________________________________________________________________
3665

3766
## Requirements

0 commit comments

Comments
 (0)