CopilotKit
Reference / core / types

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

instructionsstringrequired

A prompt or instructions for the model to generate suggestions.

minSuggestionsnumber
Default: "1"

The minimum number of suggestions to generate.

maxSuggestionsnumber
Default: "3"

The maximum number of suggestions to generate.

availableSuggestionAvailability
Default: "after-first-message"

When the suggestions are available: "before-first-message", "after-first-message", "always", or "disabled".

providerAgentIdstring
Default: "default"

The agent ID of the provider of the suggestions.

consumerAgentIdstring
Default: "*"

The agent ID of the consumer of the suggestions. Defaults to "*" (all agents).

StaticSuggestionsConfig

suggestionsOmit<Suggestion, "isLoading">[]required

The fixed list of suggestions to display. Each entry is a Suggestion without the isLoading field.

availableSuggestionAvailability
Default: "before-first-message"

When the suggestions are available: "before-first-message", "after-first-message", "always", or "disabled".

consumerAgentIdstring
Default: "*"

The agent ID of the consumer of the suggestions. Defaults to "*" (all agents).

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