Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"watch:labextension": "jupyter-builder watch ."
},
"dependencies": {
"@jupyter/chat": "^0.22.1",
"@jupyter/chat": "^0.25.1",
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/cells": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
Expand All @@ -68,7 +68,7 @@
},
"devDependencies": {
"@eslint/js": "^9.0.0",
"@jupyter/builder": "^1.0.0",
"@jupyter/builder": "^1.2.0",
"@jupyter/eslint-plugin": "^0.0.5",
"@jupyterlab/testutils": "^4.0.0",
"@types/jest": "^29.2.0",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling>=1.5.0", "hatch-nodejs-version>=0.3.2", "jupyter-builder>=1.0.0,<2"]
requires = ["hatchling>=1.5.0", "hatch-nodejs-version>=0.3.2", "jupyter-builder>=1.2.0,<2"]
build-backend = "hatchling.build"

[project]
Expand Down Expand Up @@ -29,7 +29,7 @@ dynamic = ["version", "description", "authors", "urls", "keywords"]
[project.optional-dependencies]
dev = [
"jupyterlab>=4",
"jupyter-builder>=1.0.0",
"jupyter-builder>=1.2.0",
]
server = [
"jupyter_ai_jupyternaut",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
rmRegistry,
translator: translator ?? undefined,
welcomeMessage: trans.__(
`## Select a code cell and click **Explain Code** <img src="data:image/svg+xml;base64,${INFO_ICON_BASE_64}" /> or **Review Code** <img src="data:image/svg+xml;base64,${CHECK_ICON_BASE_64}" /> to get started.`
`Select a code cell and click **Explain Code** <img src="data:image/svg+xml;base64,${INFO_ICON_BASE_64}" /> or **Review Code** <img src="data:image/svg+xml;base64,${CHECK_ICON_BASE_64}" /> to get started.`
),
attachmentOpenerRegistry,
inputToolbarRegistry
Expand Down
10 changes: 6 additions & 4 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,28 @@ export class TutorChatModel extends AbstractChatModel {
constructor(options?: IChatModel.IOptions) {
super(options);
this.name = 'Tutor';
this.setReady();
this.setReady(UUID.uuid4());
}

get user(): IUser {
return { username: 'user', display_name: 'You' };
}

sendMessage(message: ITutorNewMessage): void {
sendMessage(message: ITutorNewMessage): string {
const userMsg: IMessageContent = {
type: 'msg',
id: UUID.uuid4(),
time: Date.now() / 1000,
body: message.body,
body: message.body ?? '',
sender: this.user,
attachments: message.attachments
};
this.messageAdded(userMsg);
return userMsg.id;
}

async sendMessageToAI(message: ITutorNewMessage): Promise<void> {
if (!message.body.trim()) return;
if (!message.body?.trim()) return;

this.sendMessage(message);

Expand Down Expand Up @@ -114,6 +115,7 @@ export class TutorChatModel extends AbstractChatModel {
createChatContext(): ITutorChatContext {
return {
name: this.name,
id: this.id ?? '',
user: this.user,
users: [],
messages: this.messages,
Expand Down
Loading
Loading