Skip to main content

addThreadStep

plugin.chatApi.addThreadStep(threadId: string, stepData: Record<string, unknown>): Promise<ChatThreadStep>

Adds a step to a chat thread.

Creates a new step within the thread's step sequence, representing a discrete unit of work or progress in the conversation.

Parameters

ParameterTypeRequiredDescription
threadIdstringYesThe unique identifier of the thread
stepDataRecord<string, unknown>YesThe step definition including type and content

Returns

Promise<ChatThreadStep> — A promise that resolves to the created ChatThreadStep

Example

import plugin from '@codebolt/plugin-sdk';

const result = await plugin.chatApi.addThreadStep('threadId', /* Record<string, unknown> */);
console.log(result);