@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
90 lines (89 loc) • 2.44 kB
TypeScript
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
/**
* @module ai/aichat/ui/controls/aichatpromptcapabilitiesview
*/
import { type Locale } from 'ckeditor5/src/utils.js';
import { View } from 'ckeditor5/src/ui.js';
import { type AIChatModel } from '../../model/aichatmodels.js';
/**
* Manages the prompt capabilities UI for AI chat, including web search, commands functionality, and model selection.
*/
export declare class AIChatPromptCapabilitiesView extends View {
/**
* Indicates whether the web search is active.
*
* @observable
*/
webSearchActive: boolean;
/**
* Indicates whether reasoning is active.
*
* @observable
*/
reasoningActive: boolean;
/**
* Indicates whether the model selection UI is visible.
*
* @observable
*/
modelSelectorVisible: boolean;
/**
* Indicates whether the model selection UI is enabled. The selection gets disabled
* after the first message is sent to the API, as the model cannot be changed then.
*
* @observable
*/
modelSelectorEnabled: boolean;
/**
* The ID of the currently active model.
*
* @observable
*/
activeModelId: string | null;
/**
* The name of the currently active model.
*
* @observable
*/
activeModelName: string | null;
constructor(locale: Locale);
/**
* Sets model list dropdown.
*/
setModelList(models: Array<AIChatModel>, hideIfSingleModel: boolean): void;
/**
* Sets the web search state.
*/
setWebSearch(isWebSearchEnabled: boolean): void;
/**
* Sets the reasoning state.
*/
setReasoning(isReasoningEnabled: boolean): void;
/**
* Sets the selected model.
*/
setModel(model: AIChatModel | null): void;
/**
* Enables the model selector dropdown.
*/
enableModelSelector(): void;
/**
* Disables the model selector dropdown.
*/
disableModelSelector(hideSelector: boolean): void;
}
export type AIChatUIToggleWebSearchEvent = {
name: 'toggleWebSearch';
args: [];
};
export type AIChatUIToggleReasoningEvent = {
name: 'toggleReasoning';
args: [];
};
export type AIChatUISelectModelEvent = {
name: 'selectModel';
args: [model: AIChatModel];
};