Hi! We have a field where we want to store a country, but we want it to be stored in ISO 3166 two-character code format. We experimented with adding this info to the step instructions, but is there a way to constrain the Thunk so it can only store ISO 3166 two-character code format? Thanks!
Hi @jrozen!
I was able to get this working by doing this…
First, I added a country code column to my data. And then navigated to column properties:
Then, in the column description I told it to use the ISO format:
Then, in one of my steps, I told it to update the country to Brazil:
I clicked to expand the details and saw this:
So what happened was:
- The column description is included in the AI’s context when working.
- The LLM has general “knowledge” about country codes.
An alternative way to do this would be to list out all of the 195 country codes as “enum” options for the column. But just instructing the AI to do it was easier and worked.
Let me know how it goes.
The difference between putting it in the column description and step instructions…
Step instructions = only available for that particular step
Column description = available wherever that column is used
Thank you! Two more questions, if you don’t mind:
- I also tried to update the MaxLength attribute for the field to 2, but I don’t seem to be able to enter anything in that field in the column properties
- This data ultimately will flow from Thunk into AppSheet. Is it possible to also add this same restriction to the update_appsheet_row tool definition?
Thank you!
Will check on the MaxLength attribute of the column definition. That’s a bug in the editor component and should have a quick fix.
In the same way that Tony pointed out that you can tell the AI agent that the column should have an ISO code, you can do the same thing in a tool defiition that expects to take a value and use it (in your case, to make an API call to an AppSheet app).
The tool inputs are represented in a JSON syntax … so something like this …
“country”: {
“type”: “string”,
}
You can change that to ..
“country”: {
“type”: “string”,
“description”: “Country code in ISO 3166 format”
}
Please note, very soon we’ll be changing this sort of obscure JSON-style syntax to somethign more user-friendly for the tool call inputs. These will also have the same format as the column definitions.