SuggestionsConfig

Configuration for generating dynamic or static suggestions.


Overview

SuggestionsConfig configures how Suggestion pills are produced. It is a union of two variants:

  • DynamicSuggestionsConfig — suggestions are generated by the model from instructions.
  • StaticSuggestionsConfig — a fixed list of suggestions you provide.

The variant is determined by which fields are present (instructions vs. suggestions). Configs are supplied via CopilotKitCoreConfig.suggestionsConfig.

Import

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

Definition

type SuggestionsConfig = DynamicSuggestionsConfig | StaticSuggestionsConfig;

type SuggestionAvailability =
  | "before-first-message"
  | "after-first-message"
  | "always"
  | "disabled";

type DynamicSuggestionsConfig = {
  instructions: string;
  minSuggestions?: number;
  maxSuggestions?: number;
  available?: SuggestionAvailability;
  providerAgentId?: string;
  consumerAgentId?: string;
};

type StaticSuggestionsConfig = {
  suggestions: Omit<Suggestion, "isLoading">[];
  available?: SuggestionAvailability;
  consumerAgentId?: string;
};

Properties

DynamicSuggestionsConfig

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

StaticSuggestionsConfig

Prop

Type

Prop

Type

Prop

Type

Usage

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

// Dynamic: model-generated
const dynamic: SuggestionsConfig = {
  instructions: "Suggest follow-up questions about the report",
  maxSuggestions: 3,
  available: "after-first-message",
};

// Static: fixed list
const staticConfig: SuggestionsConfig = {
  suggestions: [
    { title: "Summarize", message: "Summarize this page" },
  ],
  available: "before-first-message",
};

Related