-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collaborative chat using jupyterlab_chat package #237
Conversation
Following the install instructions, I get this error: $ jupyter lab
[W 2024-02-20 14:58:49.963 ServerApp] jupyter_collaboration | error adding extension (enabled: True): The module 'jupyter_collaboration' could not be found (No module named 'langchain'). Are you sure the extension is installed?
Traceback (most recent call last):
File "/home/david/github/davidbrochart/jupyterlab-chat/.pixi/envs/default/lib/python3.12/site-packages/jupyter_server/extension/manager.py", line 322, in add_extension
extpkg = ExtensionPackage(name=extension_name, enabled=enabled)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/david/github/davidbrochart/jupyterlab-chat/.pixi/envs/default/lib/python3.12/site-packages/jupyter_server/extension/manager.py", line 186, in __init__
self._load_metadata()
File "/home/david/github/davidbrochart/jupyterlab-chat/.pixi/envs/default/lib/python3.12/site-packages/jupyter_server/extension/manager.py", line 201, in _load_metadata
raise ExtensionModuleNotFound(msg) from None
jupyter_server.extension.utils.ExtensionModuleNotFound: The module 'jupyter_collaboration' could not be found (No module named 'langchain'). Are you sure the extension is installed? |
Thanks for testing, |
Thanks @brichet. I updated
|
Probably the handler is not running server side. |
I reinstalled everything and now it works fine, thanks! |
66ba34d
to
9f09f7e
Compare
What's the status here? Anything blocking y'all from publishing? |
I'm happy to review here whenever folks are ready. I'd love to see this land soon! |
The package was really new and untested, we wanted to make sure it at least worked with the current implementation before publishing. |
Let us know when you are ready for review. |
278dc52
to
2085eff
Compare
… does not use websockets
…eral chats in an accordion
…istn for change on the drive
cefe297
to
6b86cd9
Compare
A temporary |
This PR currently includes the YChat document model, back end and front end. The correct way would be to describe the YChat in jupyter_ydoc package. But the jupyter_ydoc used in jupyter_collaboration seems to be the one bundled with jupyterlab (and webpack). A workaround is to register the YChat using To move forward with this PR I suggest to use the workaround and to include the YChat in jupyter_ydoc at the same time. Any thoughts ? |
The circular import is expected since
Yes, this will make it complicated.
The problem with something like this is that, unlike using the entry points,
Another way would be to have a Python package in |
I don't understand this point, but I'm probably missing something about the import workflow. I push my idea in 6a01b2a, but it can be reverted of course.
Thanks, indeed this is another workaround. I'd like to avoid it because I think that jupyter-chat is supposed to be only a front end package, and should not depend on any back end technology. But, of course, if it is the more stable solution, it must be considered. |
jupyter_collaboration/ychat.py
Outdated
from pycrdt import Array, Map | ||
|
||
|
||
class YChat(YBaseDoc): | ||
class YChat(jupyter_ydoc.YBaseDoc): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how that can work, since jupyter_ydoc
doesn't export YBaseDoc
:
import jupyter_ydoc
jupyter_ydoc.YBaseDoc
# Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
# AttributeError: module 'jupyter_ydoc' has no attribute 'YBaseDoc'. Did you mean: 'ybasedoc'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me neither, but i fixed it anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the YBaseDoc
should be prefixed with an underscore, to specified that it should not be imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's fine to import it, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, I misunderstood your comment and thought you meant not to import it.
Failures are reported in #252 |
After discussion with @SylvainCorlay and @davidbrochart, we wonder where this code should be located and how it should be divided. Let me know if this summary is wrong. In each case, we thing the jupyter-chat package, providing the front end components, should be in a project in jupyterlab org. Independent of the technology used for communication, it would allow other extensions to include a chat widget.
@Zsailer @ellisonbg do you have an opinion on it ? |
We decide to move the collaborative chat to a dedicated extension https://github.com/jupyterlab-contrib/jupyter-chat/tree/main/packages/jupyterlab-collaborative-chat, to have all in one repository and avoid the circular dependency mentioned here Note that this extension already have a working shared document that allow to open a chat in the main area by opening a |
This PR adds a collaborative chat panel using the jupyter-chat package.
It supersedes #155
Description
Follow up changes
Testing this PR:
As
jupyter-chat
is not published on PyPI or NPMjs, this PR can only be tested locally.Python dependencies:
Clone locally jupyter-chat then
pip install .
Javascript dependencies (using yalc)
npm install -g yalc
yalc publish
yalc add @jupyter/chat
: this will create adependencies
entry in ./package.json, that we don't want for a monorepotodependencies
resolutions
in ./package.jsonpip install -e .
(orjlpm build
if already installed)EDIT
The chat package has been restarted from scratch (to restore history on chat UI files), and renamed jupyter-chat (previously
jupyterlab-chat
).The commands above has been updated accordingly, please start again if you already installed
jupyterlab-chat
, the repojupyterlab-chat
should be removed soon.