Skip to main content

Parameter Controls

Parameter Controls allow server bots to add additional input elements to their UI on Poe, enabling users to configure settings and provide structured input beyond just text messages.

Adding Parameter Controls to Your Bot

You can add parameter controls to your bot by setting the parameter_controls property inside the SettingsResponse object (PoeBot:get_settings method in the fastapi_poe API) to a JSON object that uses the API described in the following sections.

The parameter controls system uses the following JSON structure to define its controls and settings:

Fields

FieldTypeDescriptionRequired
api_versionStringVersion of the Parameter Controls schema. This matches the Poe Protocol response version. Currently only "2" is supportedYes
sectionsArrayList of Section objects that define the UI structureYes

The schema shows that Sections are the fundamental building blocks - they act as containers that organize all other controls. Every interface must have at least one Section to function properly.

Here's a practical example showing how to create a server bot with parameter controls. This example creates a 'Generation' section containing two dropdown menus:

class ImageBot(PoeBot):

async def get_settings(self, setting: SettingsRequest) -> SettingsResponse:
return SettingsResponseWithCustomUI(
enable_multi_bot_chat_prompting=True,
allow_attachments=True,
enable_image_comprehension=False,
custom_ui_definition={
"api_version": "0",
"sections": [
{
"name": "Generation",
"controls": [
{
"control": "drop_down",
"label": "Style",
"parameter_name": "style",
"default_value": "GENERAL",
"options": [
{"name": "General", "value": "GENERAL"},
{"name": "Realistic", "value": "REALISTIC"},
{"name": "Design", "value": "DESIGN"},
{"name": "3D render", "value": "RENDER_3D"},
{"name": "Anime", "value": "ANIME"},
],
},
{
"control": "drop_down",
"label": "Aspect ratio",
"parameter_name": "aspect",
"default_value": "1:1",
"options": [
{"name": "16:9 (Horizontal)", "value": "16:9"},
{"name": "16:10", "value": "16:10"},
{"name": "3:2", "value": "3:2"},
{"name": "4:3", "value": "4:3"},
{"name": "1:1 (Square)", "value": "1:1"},
{"name": "9:16 (Vertical)", "value": "9:16"},
{"name": "10:16", "value": "10:16"},
{"name": "2:3", "value": "2:3"},
{"name": "3:4", "value": "3:4"},
],
},
],
}
],
},
)

Getting Parameter Values from User Messages

When a user submits a message, any configured parameter values will be included in the ProtocolMessage object within a dedicated parameters field. The parameters field is an object where the parameters will be sent as:

{
"some_text_parameter": "some value",
"some_number_paramter": 123, //some value
}

This field is sent alongside the standard content field, allowing your bot to access both the user's message content and their parameter configurations in a structured format.

See Parameters for more details about how parameters are sent to the bot.


Parameter Control Definition

To define your parameter controls, you will create a JSON object that describes the desired UI and the corresponding parameters that the bot can accept as user input.

The are four basic building blocks:


Controls

The base building block is the Control. Controls describe individual UI elements that accept user input; like everything in the Parameter Controls API, they are described by JSON objects.

The basic available Controls are:

ControlDescription
DividerVisual separator for grouping controls
Text FieldSingle-line input for short text
Text AreaMulti-line input for longer text
Drop DownSelection from predefined options
Toggle SwitchOn/off control for boolean settings
SliderNumeric value selector with range limits
ConditionShows/hides controls based on parameter values

Other use-case-specific Controls are available:

ControlDescription
Aspect RatioSelection for image/video dimensions with visual previews

Parameters

Parameters store the user input captured by Controls. Every Control has an associated Parameter, and the name of this Parameter is specified using the parameter_name property on the JSON description of the Control.

Controls may optionally specify a default value to store in their associated Parameter. If a default value is not provided, a default value will be inferred. Multiple controls are allowed to share the same parameter_name, but if they do they must all use the same default value.

When a user submits a message, their configured parameters are included in the ProtocolMessage object like this:

{
"some_text_parameter": "some value",
"some_number_paramter": 123, //some value
}

This lets your bot easily access both the message content and parameter values in a structured way.

Some things to consider:

  • Parameters included in the parameter dictionary on ProtocolMessages do not have to come from the Poe UI.
  • Bots calling other Bots through the Bot Query API can include arbitrary parameters in the parameter dictionary.
  • The parameter dictionary might include parameters not defined in your parameter_controls setting.
  • Parameters included in the parameter dictionary can have any type and might have unexpected values.

Parameter Naming

  • Only alphanumeric characters and underscores (_) are allowed
  • Parameters cannot contain hyphens (-)
  • Parameters cannot start with "poe_" as this prefix is reserved
  • Style suggestions:
    • Parameter names should be descriptive and indicate their purpose
    • Use lowercase letters and underscores for readability (e.g., image_size, output_format)

Examples of valid parameter names:

user_preference
imageSize
quality_level
output_format_1

Examples of invalid parameter names:

poe_setting      // Starts with reserved prefix
image-size // Contains hyphen
$special // Contains special character

Sections

Sections group Tabs and Controls into collapsible accordion cards for visual organization. This grouping helps users by clustering controls that are related or manage specific aspects of your bot.

Fields

FieldTypeDescriptionRequired
nameStringThe name of the section shown in the headerNo
controlsArrayList of Controls to show in this sectionNo
tabsArrayList of Tabs to show in this sectionNo
collapsed_by_defaultBooleanWhether the section should start collapsedNo

Example

{
"name": "Image Generation",
"controls": [
{
"control": "slider",
"label": "Image Width",
"parameter_name": "width",
"min_value": 256,
"max_value": 1024,
"step": 64
}
],
"collapsed_by_default": false
}

Note: A section must contain either controls or tabs, but cannot contain both. At least one of these fields must be present.


Tabs

Tabs group Controls together and live under Sections. They provide a convenient way to organize a long list of controls when you don't want to display them all simultaneously.

Fields

FieldTypeDescriptionRequired
nameStringThe name of the tab shown in the headerYes
controlsArrayList of Controls to show in this tabYes

Example

{
"name": "Advanced Settings",
"controls": [
{
"control": "slider",
"label": "Quality",
"parameter_name": "quality",
"min_value": 1,
"max_value": 10,
"step": 1,
"default_value": 5
},
{
"control": "toggle_switch",
"label": "High Resolution Mode",
"parameter_name": "high_res",
"default_value": false
}
]
}

Tabs must contain at least one control. They provide a way to organize related controls into separate views that users can switch between.


Control Reference

Divider

You can use dividers to visually group or separate controls in ways that are intuitive for users.

Fields

FieldTypeDescriptionRequired
controlStringThe type of control. For a divider, control is always "divider"Yes

Example

{
"control": "divider"
}

Text Field

Text fields allow users to enter short text values. They are best suited for single-line inputs like names, keywords, or short commands.

Fields

FieldTypeDescriptionRequired
controlStringThe type of control. For a text field, control is always "text_field"Yes
labelStringThe label text shown above the input fieldYes
descriptionStringOptional description text shown below the labelNo
parameter_nameStringName of the parameter to store the input valueYes
default_valueStringOptional default text for the input fieldNo
placeholderStringOptional placeholder text shown when field is emptyNo

Example

{
"control": "text_field",
"label": "Style prompt",
"description": "Define the visual style for your generated media",
"parameter_name": "style_prompt",
"default_value": "",
"placeholder": "Photorealistic, anime, oil painting, cyberpunk"
}

Text Area

Text areas allow users to enter longer text content. They are best suited for multi-line inputs like descriptions, prompts, or detailed instructions.

Fields

FieldTypeDescriptionRequired
controlStringThe type of control. For a text area, control is always "text_area"Yes
labelStringThe label text shown above the text areaYes
descriptionStringOptional description text shown below the labelNo
parameter_nameStringName of the parameter to store the input valueYes
default_valueStringOptional default text for the text areaNo
placeholderStringOptional placeholder text shown when field is emptyNo

Example

{
"control": "text_area",
"label": "Negative prompt",
"description": "Enter content you want to exclude from generation",
"parameter_name": "negative_prompt",
"default_value": "",
"placeholder": "Low quality, blurry, distorted"
}

Dropdowns allow users to select from a predefined list of options. They are ideal for scenarios where users need to choose one option from a limited set of choices.

Fields

FieldTypeDescriptionRequired
controlStringThe type of control. For a dropdown, control is always "drop_down"Yes
labelStringThe label text shown above the dropdownYes
descriptionStringOptional description text shown below the labelNo
parameter_nameStringName of the parameter to store the selected valueYes
default_valueStringOptional default selected valueNo
optionsArrayList of Options, which are value-name pairs representing the available optionsYes

Option fields

FieldTypeDescriptionRequired
valueStringThe internal value that will be stored in the parameterYes
nameStringThe display text shown to users in the dropdown menuYes

Each option in the options array must be an object containing both a value and name. The value is what gets stored in the parameter and used by your bot's logic, while the name is what's displayed to users in the UI.

Example

{
"control": "drop_down",
"label": "Model",
"description": "Select your preferred AI model",
"parameter_name": "model",
"default_value": "gpt4o",
"options": [
{"value": "gpt4o", "name": "GPT-4o"},
{"value": "claude4", "name": "Claude 4"},
{"value": "llama4", "name": "Llama 4"}
]
}

Toggle Switch

Toggle switches allow users to turn options on or off. They are ideal for boolean settings or enabling/disabling features.

Fields

FieldTypeDescriptionRequired
controlStringThe type of control. For a toggle switch, control is always "toggle_switch"Yes
labelStringThe label text shown next to the toggle switchYes
descriptionStringOptional description text shown below the labelNo
parameter_nameStringName of the parameter to store the boolean valueYes
default_valueBooleanOptional default state of the toggle (true/false)No

Example

{
"control": "toggle_switch",
"label": "Enable creative mode",
"description": "Generate more imaginative and diverse AI responses",
"parameter_name": "creative_mode_enabled",
"default_value": true
}

Slider

Sliders allow users to select a numeric value within a specified range. They are ideal for settings that require numerical input within defined boundaries.

Fields

FieldTypeDescriptionRequired
controlStringThe type of control. For a slider, control is always "slider"Yes
labelStringThe label text shown above the sliderYes
descriptionStringOptional description text shown below the labelNo
parameter_nameStringName of the parameter to store the numeric valueYes
default_valueNumberOptional default position of the sliderNo
min_valueNumberMinimum value of the slider rangeYes
max_valueNumberMaximum value of the slider rangeYes
stepNumberIncrement between values on the sliderYes

Example

{
"control": "slider",
"label": "Thinking budget",
"description": "Select the complexity level for your AI's reasoning",
"parameter_name": "thinking_budget",
"default_value": 50,
"min_value": 10,
"max_value": 100,
"step": 5
}

Conditional

Conditionals are control wrappers that dynamically hide or show other Controls based on parameter values.

Fields

FieldTypeDescriptionRequired
controlStringThe type of control. For a conditional, control is always "condition"Yes
conditionObjectContains the comparison logic (ComparatorCondition)Yes
controlsArrayList of controls to show/hide based on the conditionYes

Condition

FieldTypeDescriptionRequired
comparatorStringThe type of comparison. Currently only "equals" is supportedYes
leftObjectLeft side of comparison (LiteralValue or ParameterValue)Yes
rightObjectRight side of comparison (LiteralValue or ParameterValue)Yes

Parameter Value

FieldTypeDescriptionRequired
parameter_nameStringName of the parameter whose value to useYes

Literal Value

FieldTypeDescriptionRequired
literalString, Number, or BooleanThe literal value to use in the comparisonYes

Example

{
"control": "condition",
"condition": {
"comparator": "equals",
"left": {
"parameter_name": "output_type"
},
"right": {
"literal": "image"
}
},
"controls": [
{
"control": "slider",
"label": "Image Width",
"parameter_name": "width",
"min_value": 256,
"max_value": 1024,
"step": 64,
"default_value": 512
}
]
}

In this example, the slider control for image width is only shown when the output_type parameter equals "image". The condition can compare either literal values or parameter values on both sides of the comparison.


Aspect Ratio

The aspect ratio control lets users choose from predefined aspect ratios with visual previews for easy comparison—especially useful for image and video generation bots.

Fields

FieldTypeDescriptionRequired
controlStringThe type of control. For aspect ratio, control is always "aspect_ratio"Yes
labelStringThe label text shown above the aspect ratio selectorYes
descriptionStringOptional description text shown below the labelNo
parameter_nameStringName of the parameter to store the selected aspect ratioYes
default_valueStringOptional default selected aspect ratioNo
optionsArrayList of AspectRatioOptionDefinition objects representing the available optionsYes

AspectRatioOptionDefinition

FieldTypeDescriptionRequired
widthNumberThe width value for the aspect ratioYes
heightNumberThe height value for the aspect ratioYes
valueStringThe value to be passed when the option is selected. If not defined, a string with the following format will be passed as the value: [width]:[height] (e.g. "16:9")No

Example

{
"control": "aspect_ratio",
"label": "Aspect ratio",
"description": "Select the aspect ratio for your generated image",
"parameter_name": "aspect_ratio",
"default_value": "square",
"options": [
{"value": "square", "width": 1, "height": 1},
{"value": "landscape", "width": 16, "height": 9},
{"value": "portrait", "width": 9, "height": 16}
]
}

The aspect ratio control will display a visual preview of each ratio option to help users understand the proportions they're selecting.