Skip to main content

ConversationTemplate

Pre-configured conversation templates for common tasks.
id
string
required
Unique identifier for the template
name
string
required
Display name of the template
category
TemplateCategory
required
Category this template belongs to (see TemplateCategory)
description
string
required
Description of what the template does
systemPrompt
string
required
System instruction that configures the AI’s behavior for this template
userMessage
string
required
Pre-filled user message that starts the conversation
tags
string[]
required
Tags for searching and filtering templates
isCustom
boolean
required
Whether this is a user-created custom template
modelSpecific
string[]
Array of model IDs that this template works best with
icon
string
Icon identifier for the template
color
string
Color code for the template’s visual representation
examples
string[]
Example use cases or sample outputs for this template

Example

const template: ConversationTemplate = {
  id: 'code-review',
  name: 'Code Review',
  category: 'programming',
  description: 'Get detailed code reviews with suggestions for improvements',
  systemPrompt: 'You are an experienced code reviewer. Analyze code for bugs, performance issues, and best practices. Provide constructive feedback.',
  userMessage: 'Please review this code:\n\n',
  tags: ['code', 'review', 'programming', 'quality'],
  isCustom: false,
  modelSpecific: ['gpt-4', 'claude-3-opus'],
  icon: 'code-review',
  color: '#6366f1',
  examples: [
    'Review a pull request',
    'Check code for security vulnerabilities',
    'Suggest performance optimizations'
  ]
};

QuickAction

Quick actions for common text transformations and operations.
id
string
required
Unique identifier for the action
name
string
required
Display name of the action
icon
string
required
Icon identifier for the action
action
QuickActionType
required
The type of action (see QuickActionType)
description
string
required
Description of what the action does
requiresSelection
boolean
required
Whether the action requires text to be selected
modelSpecific
string[]
Array of model IDs that this action works best with
systemPrompt
string
Custom system prompt for this action
userMessageTemplate
string
Template for the user message, with {selection} placeholder for selected text

Example

const action: QuickAction = {
  id: 'explain-code',
  name: 'Explain Code',
  icon: 'lightbulb',
  action: 'explain',
  description: 'Get a detailed explanation of selected code',
  requiresSelection: true,
  modelSpecific: ['gpt-4', 'claude-3-sonnet'],
  systemPrompt: 'You are a patient coding instructor. Explain code clearly and thoroughly.',
  userMessageTemplate: 'Please explain this code:\n\n{selection}'
};

TemplateCategory

Categories for organizing conversation templates.
type TemplateCategory =
  | 'programming'
  | 'writing'
  | 'analysis'
  | 'creative'
  | 'learning'
  | 'business'
  | 'personal';
'programming'
category
Templates for coding, debugging, and software development
'writing'
category
Templates for writing assistance, editing, and content creation
'analysis'
category
Templates for data analysis, research, and critical thinking
'creative'
category
Templates for creative tasks like storytelling, brainstorming, and design
'learning'
category
Templates for educational purposes and learning new topics
'business'
category
Templates for business tasks like emails, proposals, and presentations
'personal'
category
Templates for personal assistance and daily tasks

QuickActionType

Available quick action types.
type QuickActionType =
  | 'explain'
  | 'optimize'
  | 'debug'
  | 'comment'
  | 'translate'
  | 'summarize'
  | 'review'
  | 'improve'
  | 'simplify'
  | 'expand';
'explain'
action
Explain or clarify selected text or code
'optimize'
action
Optimize code or content for better performance or clarity
'debug'
action
Debug code and find issues
'comment'
action
Add comments or documentation to code
'translate'
action
Translate text to another language
'summarize'
action
Create a concise summary of the content
'review'
action
Review and provide feedback on content
'improve'
action
Suggest improvements and enhancements
'simplify'
action
Simplify complex content
'expand'
action
Expand or elaborate on content

TemplateCategoryInfo

Metadata for template categories used in the UI.
id
TemplateCategory
required
The category identifier
name
string
required
Display name of the category
description
string
required
Description of the category
icon
string
required
Icon identifier for the category
color
string
required
Color code for the category

Example

const categoryInfo: TemplateCategoryInfo = {
  id: 'programming',
  name: 'Programming',
  description: 'Code development and technical tasks',
  icon: 'code',
  color: '#6366f1'
};

Build docs developers (and LLMs) love