@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
64 lines (63 loc) • 2.13 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/model/aichatmodels
* @publicApi
*/
import { type AIModelData } from '../../aicore/aiconnector.js';
import { AIModels } from '../../aicore/model/aimodels.js';
/**
* Stores the list of available AI chat models.
*/
export declare class AIChatModels extends AIModels {
/**
* Returns a list of available models sorted by available capabilities.
*/
getAll(): Promise<Array<AIChatModel>>;
}
export type AIChatModel = AIModelData;
/**
* The configuration of the AI Chat models feature.
*
* ```ts
* ClassicEditor.create( {
* ai: {
* chat: {
* models: {
* defaultModelId: ...,
* modelSelectorAlwaysVisible: ...,
* displayedModels: ...
* }
* }
* }
* } )
* .then( ... )
* .catch( ... );
* ```
*
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
*/
export type AIChatModelsConfig = {
/**
* Decides which model is selected by default when the AI Chat is initialized or when user starts a new conversation.
*/
defaultModelId?: string;
/**
* Decides whether the model selector dropdown is always visible. It is `true` by default, which means
* the selector will be always visible in the UI. Setting it to `false`, hides the model selector dropdown when:
*
* * Only one model is available.
* * User has selected a model and send first message (which is the point when model cannot be changed).
*/
modelSelectorAlwaysVisible?: boolean;
/**
* Decides which models are visible in the model selector dropdown. It can be a string or an array of strings.
*
* * It is optional and if not provided, all models are supported.
* * If configured, editor will try to match the passed models by their ID, name or provider. Order by which the models are matched
* is later reflected in the model selector dropdown.
*/
displayedModels?: string | Array<string>;
};