Letting an assistant calculate with files¶
An assistant can answer questions about a CSV or Excel file by running code over it: totals, counts, comparisons, a chart or a cleaned-up file to download. It does so on a computer of its own, which starts fresh for every answer, has no internet and disappears after the answer. The assistant needs three tools for this. This page says where to find them and how to give them to an assistant, and what you see when your organisation cannot run code. What members do in the chat is in Analysing a spreadsheet.
Questions about a spreadsheet belong with these tools, not with a datastore: a datastore keeps records that an application writes and reads, not a file someone has a question about.
The three tools¶
| Tool | What it does |
|---|---|
| Run code | Runs a command on the assistant's computer, such as a Python script over a file sent in the chat, and reads back what it printed. |
| Write a file on the computer | Writes a text file on the computer, such as a script the assistant then runs. |
| Read or export a file from the computer | Reads a file from the computer, or hands it back in the answer to download, such as a chart or a cleaned-up spreadsheet. |
Give an assistant all three. With only Run code it does calculate, and charts and tables appear in the text of its answer, but pictures and files the code makes do not reach the answer.
Who may do what¶
- Seeing the tools in the Engine room is for whoever may change the toolbox: the organisation's administrators and a role of your own with the right to change the toolbox.
- Giving the tools to an assistant is for whoever may change that assistant.
- Using them is for everyone who may chat with the assistant. A rule that forbids someone these tools also holds when that person chats with the assistant.
Where to find the tools¶
The three tools are for assistants only: a person cannot use them in the AI Toolbox themselves. They are part of every organisation's toolbox, with nothing anyone has to switch on first. You find them on every assistant's Tools tab, and in the Engine room as Assistants only; under For whom, choose Assistants only to see just those tools. They have no Also for people switch, because a person cannot use them.
You can put them in a group in the Engine room to keep them together; on an assistant's Tools tab you activate each one separately.
Giving the tools to an assistant¶
- Open the assistant's settings and choose the Tools tab.
- Search for computer or code and choose Activate on Run code, Write a file on the computer and Read or export a file from the computer. Each choice saves a new version of the assistant straight away.
- Check on the Settings tab that Allow file upload in chat messages is on; otherwise people cannot send the assistant files.
A virtual employee of the assistant can use the same tools for the files its run is given.
Two notices on the Tools tab¶
One of these notices may appear above the tools. Saving still works; they only say what the assistant cannot do.
- The assistant can run code but cannot hand back files. The assistant has Run code without Read or export a file from the computer. Choose the button in the notice to activate that tool.
- People cannot send this assistant files. Allow file upload in chat messages is off. Choose Go to Settings and turn it on, unless the assistant only needs to calculate with what is in the conversation.
When the tools are not available¶
If your organisation cannot run code, the three tools are greyed out on the Tools tab, with not available instead of Activate, and a line saying why:
| Line | What it means | Whom to ask |
|---|---|---|
| Not available: your organisation cannot run code. | Computers are not allowed for your organisation. | The administrators of the organisation above yours, or Artific if there is none. |
| Not available: this installation of Artific Core runs no computers. | The installation OS runs on for your organisation has no computers. | Artific. |
The same reason appears on Organization settings, in the notice that your organisation does not make Word, Excel or PowerPoint files, with when OS last tried. OS checks again every day. Once computers are allowed you can activate the tools straight away; it can take up to about a day before they work in the chat.
If your organisation loses computers while an assistant already has the tools, they stay activated and the card says Not working now: your organisation can no longer run code. The chat shows why. Deactivate still works. Whoever tries to activate a tool while that is not possible gets Run code is not available: your organisation cannot run code.
What it costs¶
An answer in which the assistant ran code uses computer time on top of the model's tokens: the seconds its computer was running. That time counts towards your organisation's usage and its monthly budget, like all usage. An answer without code uses no computer time. OS does not show the computer time yet: not in the chat and not on a page of its own.
What is recorded¶
- Activating is in your organisation's audit trail, as a change to the assistant, with the version it wrote.
- Every computer is recorded by Artific Core: when it was made and when it went, how long it ran, and for each step what kind of step it was, how long it took and its exit code. The commands themselves, their output and file names are not recorded there; they are only in the chat and in the assistant's Session logs. OS records nothing per answer, so nothing is recorded twice.
Data and network¶
The computer has no internet, and OS never turns it on. Code the model writes therefore cannot send a file anywhere, whatever a cell says. A file from the chat is copied to a computer in the region where your organisation gets computers; if your policy does not allow that region, every step is refused and the chat says so.
Through the API¶
GET /api/v1/organisations/{id}/assistants/tool-choicesanswersunavailableon each of the three tools:null,not_permittedorno_computers.- A save of the assistant that adds one of the three while your organisation cannot run code gets
422; the error'stypefield is the reason. GET /api/v1/organisations/{id}/toolbox/elements?offered_to=agentsincludes the three tools, withfixed: false, for whoever may change the toolbox.