Early accessGnani Evon v3.5 is now available as an API to early access registrants.
This recipe builds a command-line support bot for an online store. It answers in the customer’s language and uses tool calling to look up orders and open support tickets in your systems.
When to use this
- Customers ask questions that need live data from your systems, such as order status.
- The bot should take simple actions, such as opening a ticket, and confirm them in the chat.
- Customers write in Hindi, English or a mix, and expect a reply in the same language.
The complete bot
Each script keeps the conversation, runs the tools the model asks for, and loops until the model answers. The order data is synthetic; replace the two functions with calls to your own systems.support_bot.py or support-bot.mjs and run it with python support_bot.py or node support-bot.mjs. A session looks something like this (replies vary):
How it works
- The customer’s message is added to
messages, after thesystemmessage. - The request sends
tools. The model either answers, or replies withtool_calls. - For each call, your code parses
arguments, runs the function, and adds atoolmessage whosetool_call_idmatches the call’sid. - The conversation is sent again, with the same
tools, until the model answers incontent. - The answer is kept in
messages, so the next question has the whole conversation.
Options
Gotchas
- Validate arguments before you act. They are written by the model. Never pass them straight to a database query or a shell.
- Return errors as tool results, as
get_order_statusdoes for an unknown ID. The model can then explain the problem to the customer. - Tool results are screened like user messages. If a tool returns text from customers or the web that tries to instruct the model, the request can be refused with
400 content_filter. The scripts drop that turn so the chat can go on. - Personal data in replies is masked. If a tool returns a phone number or UPI ID and the model repeats it, the reply contains a placeholder such as
[REDACTED_PHONE]. See Safety and privacy. - Every tool round is a separate request. Each counts toward your rate limits and daily token quota. Trim old turns in long chats.
Related
Tool calling
The tool-calling flow, step by step.
Safety and privacy
Blocked requests and masked personal data.
Voice agent
Put the same bot behind Prisma and Timbre.
Errors
Status codes, error bodies and retries.