This tutorial walks through creating an action that converts a temperature from Fahrenheit to Celsius at the click of a button. It’s a simple example, but it demonstrates the pattern for building any kind of calculator or structured tool with agent actions.Documentation Index
Fetch the complete documentation index at: https://docs.circuit.ai/llms.txt
Use this file to discover all available pages before exploring further.
What we’re building
A single-button action that:- Asks the user for a temperature in Fahrenheit
- Converts it to Celsius
- Returns the result
Create the action
Open the agent's Actions tab
Navigate to the agent you want to add the calculator to and open its configuration. Go to the Actions tab and click Add action.Choose Form template as the action type.
Set the basics
Configure the action’s identity:
- Title: Temperature Converter
- Description: Convert a temperature from Fahrenheit to Celsius
- Icon:
thermometer
Add the input field
Add a single form field:
- Label: Temperature (°F)
- Name:
temperature_f - Type: number
- Required: yes
- Placeholder: e.g. 72
Write the prompt template
Set the prompt template to:The
{{temperature_f}} placeholder gets replaced with whatever the user types into the form.How it works
When a user clicks the Temperature Converter button and enters a value, Circuit substitutes the value into the prompt template and sends it to the agent as a chat message. The agent processes it like any other question — but because the prompt is structured and specific, the output is consistent every time.Taking it further
This same pattern works for any calculation or structured task:- Unit conversions — add a select field for source and target units to build a general-purpose converter
- Quoting calculators — collect dimensions, material type, and quantity, then prompt the agent to compute a price using reference data from its indexes
- Checklists — use checkbox fields to capture inputs and generate a formatted report