Skip to content
Open
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
1 change: 1 addition & 0 deletions packages/jupyter-chat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export * from './markdown-renderer';
export * from './model';
export * from './registers';
export * from './selection-watcher';
export * from './tokens';
export * from './types';
export * from './widgets';
24 changes: 24 additions & 0 deletions packages/jupyter-chat/src/tokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

import { IWidgetTracker, MainAreaWidget } from '@jupyterlab/apputils';
import { Token } from '@lumino/coreutils';

import { ChatWidget } from './widgets';

/**
* the chat tracker type.
*/
export type IChatTracker = IWidgetTracker<
ChatWidget | MainAreaWidget<ChatWidget>
>;

/**
* A chat tracker token.
*/
export const IChatTracker = new Token<IChatTracker>(
'@jupyter/chat:IChatTracker',
'The chat widget tracker'
);
8 changes: 8 additions & 0 deletions packages/jupyter-chat/src/widgets/chat-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Chat, IInputToolbarRegistry, MESSAGE_CLASS } from '../components';
import { chatIcon } from '../icons';
import { IChatModel } from '../model';
import {
ChatArea,
IFileAttachment,
INotebookAttachment,
INotebookAttachmentCell
Expand Down Expand Up @@ -71,6 +72,13 @@ export class ChatWidget extends ReactWidget {
return this._chatOptions.model;
}

/**
* The area where the chat is opened.
*/
get area(): ChatArea | undefined {
return this._chatOptions.area;
}

/**
* Get the input toolbar registry (if it has been provided when creating the widget).
*/
Expand Down
Loading
Loading