Skip to content

thread.prompt

Sends a prompt.

/** `thread.prompt` params. */
export type PromptParams = {
behavior?: PromptBehavior | null;
images?: unknown[];
text: string;
threadId: string;
};
/** `thread.prompt` and `thread.resume` result, sent once pi accepted the prompt, before its run ends. */
export type PromptResult = {
/**
* `false` when no run of the agent follows: pi handled the prompt itself (a `/` command) or it was a `!command`,
* answered once the command ended.
*/
agentInvoked: boolean;
/** A fresh id of this prompt. */
promptId: string;
};
/** How a prompt sent while the agent is busy is queued. */
export type PromptBehavior = "steer" | "followUp";