In the Inspector
Without code: under Game Actions of the LokutorAgent add aLokutorAction.
In code, with arguments
paramsmaps each argument to a description ({"item": "Which item"}) or to a JSON-schema dictionary withtype,description,enum… Every argument is required unless its dictionary says"optional": true.- The handler runs on the main thread with the arguments the character chose, and returns a sentence saying what happened. The character answers with it, so write facts: what changed, what failed and why.
- Check the arguments. They come from a language model: an item that does not exist, a price it made up. The game decides; the sentence tells the character.
Actions that take time
A handler mayawait. The character waits for the result, and stays in THINKING:
set_context.