Skip to content

Commit

Permalink
Update extension to jupyterlab_chat (0.6.0) (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet authored Nov 22, 2024
1 parent f784fc8 commit 7b62b61
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from jupyter_ai.models import HumanChatMessage

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from jupyter_ai.models import HumanChatMessage

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The following import is to make sure jupyter_ydoc is imported before
# jupyterlab_collaborative_chat, otherwise it leads to circular import because of the
# jupyterlab_chat, otherwise it leads to circular import because of the
# YChat relying on YBaseDoc, and jupyter_ydoc registering YChat from the entry point.
import jupyter_ydoc

Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from langchain_core.prompts import PromptTemplate

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
4 changes: 2 additions & 2 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from langchain_core.runnables.utils import Input

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down Expand Up @@ -392,7 +392,7 @@ def pending(
Context manager that sends a pending message to the client, and closes
it after the block is executed.
TODO: Simplify it by only modifying the awareness as soon as collaborative chat
TODO: Simplify it by only modifying the awareness as soon as jupyterlab chat
is the only used chat.
"""
pending_msg = self.start_pending(text, human_msg=human_msg, chat=chat, ellipsis=ellipsis)
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from jupyter_ai.models import ClearRequest

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from langchain_core.runnables.history import RunnableWithMessageHistory

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from jupyter_ai.models import AgentChatMessage, AgentStreamMessage, HumanChatMessage

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from langchain.prompts import PromptTemplate

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from langchain_core.prompts import PromptTemplate

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from jupyter_ai.models import HumanChatMessage

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from langchain_community.vectorstores import FAISS

try:
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
except:
from typing import Any as YChat

Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from jupyter_events import EventLogger
from jupyter_server.extension.application import ExtensionApp
from jupyter_server.utils import url_path_join
from jupyterlab_collaborative_chat.ychat import YChat
from jupyterlab_chat.ychat import YChat
from pycrdt import ArrayEvent
from tornado.web import StaticFileHandler
from traitlets import Dict, Integer, List, Unicode
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@jupyter/chat": "^0.5.0",
"@jupyter/chat": "^0.6.0",
"@jupyter/collaboration": "^1",
"@jupyterlab/application": "^4.2.0",
"@jupyterlab/apputils": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies = [
"typing_extensions>=4.5.0",
"traitlets>=5.0",
"deepmerge>=2.0,<3",
"jupyterlab-collaborative-chat>=0.5.0",
"jupyterlab-chat>=0.6.0",
]

dynamic = ["version", "description", "authors", "urls", "keywords"]
Expand Down
4 changes: 2 additions & 2 deletions packages/jupyter-ai/src/components/chat-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type ChatSettingsProps = {
rmRegistry: IRenderMimeRegistry;
completionProvider: IJaiCompletionProvider | null;
openInlineCompleterSettings: () => void;
// The temporary input options, should be removed when the collaborative chat is
// The temporary input options, should be removed when jupyterlab chat is
// the only chat.
inputOptions?: boolean;
};
Expand Down Expand Up @@ -514,7 +514,7 @@ export function ChatSettings(props: ChatSettingsProps): JSX.Element {
onSuccess={server.refetchApiKeys}
/>

{/* Input - to remove when the collaborative chat is the only chat */}
{/* Input - to remove when jupyterlab chat is the only chat */}
{(props.inputOptions ?? true) && (
<>
<h2 className="jp-ai-ChatSettings-header">Input</h2>
Expand Down
6 changes: 3 additions & 3 deletions packages/jupyter-ai/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ const plugin: JupyterFrontEndPlugin<IJaiCore> = {
};

/**
* Add slash commands to collaborative chat.
* Add slash commands to jupyterlab chat.
*/
const collaborative_autocompletion: JupyterFrontEndPlugin<void> = {
const chat_autocompletion: JupyterFrontEndPlugin<void> = {
id: '@jupyter-ai/core:autocompletion',
autoStart: true,
requires: [IAutocompletionRegistry],
Expand All @@ -203,7 +203,7 @@ export default [
statusItemPlugin,
completionPlugin,
menuPlugin,
collaborative_autocompletion
chat_autocompletion
];

export * from './contexts';
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2220,7 +2220,7 @@ __metadata:
"@babel/preset-env": ^7.0.0
"@emotion/react": ^11.10.5
"@emotion/styled": ^11.10.5
"@jupyter/chat": ^0.5.0
"@jupyter/chat": ^0.6.0
"@jupyter/collaboration": ^1
"@jupyterlab/application": ^4.2.0
"@jupyterlab/apputils": ^4.2.0
Expand Down Expand Up @@ -2286,9 +2286,9 @@ __metadata:
languageName: unknown
linkType: soft

"@jupyter/chat@npm:^0.5.0":
version: 0.5.0
resolution: "@jupyter/chat@npm:0.5.0"
"@jupyter/chat@npm:^0.6.0":
version: 0.6.0
resolution: "@jupyter/chat@npm:0.6.0"
dependencies:
"@emotion/react": ^11.10.5
"@emotion/styled": ^11.10.5
Expand All @@ -2307,7 +2307,7 @@ __metadata:
clsx: ^2.1.0
react: ^18.2.0
react-dom: ^18.2.0
checksum: 0c935344e3cf8b60ded1df83c1b608f77becd7ea8c82c175a8588606c6c56a46525130b429b5acfaab441d9ccac9d478b25646bdb8aa3dfd1af82c8f372e07cf
checksum: 1af125488113fbe9089014ae2fd6bf39f5645e6a8387ee513cbae2ed24183ebd6611347e6c6bca05832a6d90fdb001ebce508f7b08e3ae92edd9946b9253dec9
languageName: node
linkType: hard

Expand Down

0 comments on commit 7b62b61

Please sign in to comment.