jupyter-chat-example 0.23.2 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -35,7 +35,7 @@ class MyChatModel extends AbstractChatModel {
35
35
  }
36
36
  sendMessage(newMessage) {
37
37
  if (!newMessage.body) {
38
- return;
38
+ return null;
39
39
  }
40
40
  const message = {
41
41
  body: newMessage.body,
@@ -47,6 +47,7 @@ class MyChatModel extends AbstractChatModel {
47
47
  };
48
48
  this.messageAdded(message);
49
49
  this.input.clearAttachments();
50
+ return message.id;
50
51
  }
51
52
  createChatContext() {
52
53
  return new ChatContext({ model: this });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jupyter-chat-example",
3
- "version": "0.23.2",
3
+ "version": "0.24.0",
4
4
  "description": "A chat extension providing a chat as example",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -44,7 +44,7 @@
44
44
  "install:extension": "jlpm build"
45
45
  },
46
46
  "dependencies": {
47
- "@jupyter/chat": "^0.23.2",
47
+ "@jupyter/chat": "^0.24.0",
48
48
  "@jupyterlab/application": "^4.5.0",
49
49
  "@jupyterlab/apputils": "^4.6.0",
50
50
  "@jupyterlab/notebook": "^4.5.0",
package/src/index.ts CHANGED
@@ -55,11 +55,9 @@ class MyChatModel extends AbstractChatModel {
55
55
  this.setReady();
56
56
  }
57
57
 
58
- sendMessage(
59
- newMessage: INewMessage
60
- ): Promise<boolean | void> | boolean | void {
58
+ sendMessage(newMessage: INewMessage): string | null {
61
59
  if (!newMessage.body) {
62
- return;
60
+ return null;
63
61
  }
64
62
  const message: IMessageContent = {
65
63
  body: newMessage.body,
@@ -71,6 +69,7 @@ class MyChatModel extends AbstractChatModel {
71
69
  };
72
70
  this.messageAdded(message);
73
71
  this.input.clearAttachments();
72
+ return message.id;
74
73
  }
75
74
 
76
75
  createChatContext(): IChatContext {