Conversation Starters Settings

conversationStarters

Defines the set of conversation starter prompts displayed to the user. This property is an object containing two arrays — KNOWLEDGE and ACTION — each representing a distinct type of starter.

KNOWLEDGE: Used for informational or contextual questions based on existing knowledge.

ACTION: Used for task-oriented starters that trigger specific actions.

Each item in either array must follow the format { title: "" }.

Type: object
Default Value: { "KNOWLEDGE": [], "ACTION": [] }


defaultConversationStarter

Specifies which conversation starter group (KNOWLEDGE or ACTION) is shown by default when the chat loads.

Type: string
Default Value: "KNOWLEDGE"
Accepted Values: "KNOWLEDGE" | "ACTION"


startNewConversationOnStarterClick

Determines whether clicking a conversation starter automatically initiates a new conversation instead of continuing the current one.

Type: boolean
Default Value: false


Example

foldspace.agent('API-KEY').setConfiguration({
  conversationStartersSettings: {
    defaultConversationStarter: "KNOWLEDGE",
    startNewConversationOnStarterClick: true,
    conversationStarters: {
      KNOWLEDGE: [
        { title: "What is your return policy?" },
        { title: "How do I track my order?" },
        { title: "Show me product specifications" }
      ],
      ACTION: [
        { title: "Schedule a demo" },
        { title: "Check my order status" },
        { title: "Contact support" }
      ]
    }
  }
});

Programmatic API

setConversationStarters(starters, defaultStarterType?)

Dynamically overrides the conversation starters displayed on the agent entry screen at runtime. If called before the agent is ready, the call is automatically queued and replayed once the agent initializes.

Parameters:

ParameterTypeRequiredDescription
startersRecord<"KNOWLEDGE" | "ACTION", { title: string }[]>YesA record with KNOWLEDGE and ACTION arrays. Pass null to restore the original remote configuration starters.
defaultStarterType"KNOWLEDGE" | "ACTION"NoSwitch which starter tab is shown by default. If omitted or null, the original remote default is restored.

Returns: The agent instance, enabling method chaining.

Example — Override starters:

const agent = foldspace.agent('API-KEY');

agent.setConversationStarters(
  {
    KNOWLEDGE: [
      { title: "What is your return policy?" },
      { title: "How do I track my order?" }
    ],
    ACTION: [
      { title: "Schedule a demo" },
      { title: "Contact support" }
    ]
  },
  "ACTION"
);

Example — Restore original starters from remote config:

agent.setConversationStarters(null);

getConversationStarters()

Returns the current conversation starters and the default starter type. If starters were overridden via setConversationStarters, the overridden values are returned. Otherwise, it reflects the remote configuration.

Parameters: None

Returns: { starters, defaultStarterType } | null

Returns null if the agent is not yet initialized.

FieldTypeDescription
startersRecord<"KNOWLEDGE" | "ACTION", { title: string }[]>The starters grouped by type. Each group is guaranteed to contain at least one entry.
defaultStarterType"KNOWLEDGE" | "ACTION"Which starter tab is currently the default.

Example:

const result = agent.getConversationStarters();
console.log(result);

Response:

{
  "starters": {
    "KNOWLEDGE": [
      { "title": "What is your return policy?" },
      { "title": "How do I track my order?" }
    ],
    "ACTION": [
      { "title": "Schedule a demo" },
      { "title": "Contact support" }
    ]
  },
  "defaultStarterType": "ACTION"
}