Creating agents in Acumatica is always easy
A few clicks is all it takes. In this series, we show how, one small agent at a time.
What agent are we building today:
This agent adds a Canadian French description to any stock item. Open the item, click Generate French description, and the French appears below the English. The English stays untouched, nothing else on the record changes, and a second click won't add a duplicate.
How to build this agent:
A few clicks to build it:
- Open the Agents screen and click +
- Add an ID, a name, your LLM connection and the Target Form (Stock Items)
- Name the button
- Write the instructions in plain English
- Tick Active and save
Here are the instructions from the video, so you can copy them and make them your own:
Translate the Content field into Canadian French and add it below the English.
- If Content is empty, say there is nothing to translate and stop.
- If Content already has a horizontal line followed by French text, say a French version already exists and stop.
- Keep the original English exactly as it is. Do not change any word, tag or space.
- After the English, add a line, then the French translation.
- Use the same HTML tags in the French as in the English.
- Keep product names, model numbers, sizes and units as written.
- Do not add information that is not in the English text.
- Do not change any other field.Check out the video below to see how it's done.
Tips for writing agent instructions
Good instructions are short, specific and protective. Here are six tips, using our French agent as the example.
- Start with one clear sentence. Say what the agent does and where the result goes. "Translate the Content field into Canadian French and add it below the English."
- Name the exact fields. Use the field names as they appear on the screen, like "the Content field", not "the description".
- Protect what must not change. "Keep the original English exactly as it is. Do not change any word, tag or space." and "Do not change any other field."
- Handle the edge cases. Say what happens when there is nothing to do or the work is already done. "If Content is empty, say there is nothing to translate and stop." and "If a French version already exists, say so and stop." The second one prevents duplicates when someone clicks twice.
- Say what the result should look like. Give the order and format. "After the English, add a line, then the French translation. Use the same HTML tags." Add what must stay as written, such as product names, model numbers, sizes and units.
- Keep it short, then test. Use one rule per line. Try the agent on an empty record, a record that already has the result, and a messy one. Add a rule for each surprise.