@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
56 lines (55 loc) • 2.17 kB
TypeScript
/**
* @license Copyright (c) 2003-2026, 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/aichatinteraction
* @publicApi
*/
import { type AICapabilitiesConfig } from '../../aicore/model/aicapabilities.js';
import { AIInteraction, type AIInteractionOptions } from '../../aicore/model/aiinteraction.js';
import { type AIContextItem } from '../../aicore/model/aicontext.js';
import { type AIReply } from '../../aicore/model/aireply.js';
export declare class AIChatInteraction extends AIInteraction {
/**
* The user message that was sent to the AI endpoint.
*/
readonly userMessage: string;
/**
* The ID of the conversation that the interaction belongs to.
*/
readonly conversationId: string;
/**
* The context items that were sent to the AI endpoint.
*/
readonly contextItems: Map<string, AIContextItem>;
/**
* The capabilities settings that were sent to the AI endpoint.
*/
readonly capabilities: AICapabilitiesConfig;
/**
* The model of the interaction.
*/
readonly model: string;
/**
* Additional metadata properties passed together with the user message when it was submitted.
*/
readonly attributes?: Record<string, unknown>;
constructor(options: AIChatInteractionOptions);
/**
* @inheritDoc
*
* For multi-root / multi-instance conversations, the `documentContextContent` is the concatenation of all uploaded documents'
* HTML. The server can send a single modification-delta stream whose `data-id`s span several source documents, so the reply needs
* a combined view when computing change groups. The single-document path keeps the base behavior.
*/
createReply(options: Parameters<AIInteraction['createReply']>[0]): AIReply;
}
export type AIChatInteractionOptions = {
conversationId: string;
contextItems: Map<string, AIContextItem>;
capabilities: AICapabilitiesConfig;
userMessage: string;
model: string;
attributes?: Record<string, unknown>;
} & AIInteractionOptions;