CopilotKit
Reference / core / types

Suggestion

A single suggested prompt presented to the user.

Overview

Suggestion represents one suggested prompt shown to the user (typically as a clickable pill). Suggestions are produced from a SuggestionsConfig and surfaced through CopilotKitCoreSubscriber.onSuggestionsChanged.

Import

import type { Suggestion } from "@copilotkit/core";

Definition

type Suggestion = {
  title: string;
  message: string;
  isLoading: boolean;
  className?: string;
};

Properties

titlestringrequired

Short label displayed on the suggestion pill.

messagestringrequired

The message sent to the agent when the suggestion is selected.

isLoadingbooleanrequired

Indicates whether this suggestion is still being generated.

classNamestring

Optional CSS class name applied to the suggestion pill.

Usage

import type { Suggestion } from "@copilotkit/core";

const suggestion: Suggestion = {
  title: "Summarize",
  message: "Summarize the current document",
  isLoading: false,
};

Related