Pausing, turning back on or deleting an agent, and the agent_paused error

All in One AICreating AI Agents·· 12 views· 3 min read

An agent is either active or paused. Pausing stops the answers without losing anything; deleting removes the agent for good. The buttons are on each row of the Your agents list and at the top of each agent, on the Agents tab of All in One AI.

Pausing

1 Click Pause and confirm with Yes, pause.
2 From then on, API requests to that agent are refused with 409 and the code agent_paused.
3 The agent keeps its model, instructions, knowledge and id. While it is paused, it cannot be tried.

Pausing is useful, for example, when your website chat starts getting strange requests and you want to stop the spending at once. Or when you are going to redo the knowledge and do not want answers halfway through the change.

Turning it back on

Click Activate and confirm with Yes, activate. The agent answers through the API again with the same id, so your programs do not need to change anything.

Deleting

Delete removes the agent and all its knowledge, and it cannot be undone. API requests with that id stop working. Before deleting, copy the instructions and keep the knowledge files, if you want to use them in another agent. Deleting frees a place among the account's 50 agents.

The agent_paused error in your program

With the OpenAI SDK, the error arrives as an exception with the HTTP status. In Python it is APIStatusError, with status_code equal to 409:

import os
from openai import OpenAI, APIStatusError

client = OpenAI(base_url="https://api.mozout.co.mz/v1", api_key=os.environ["MOZOUT_API_KEY"])

try:
completion = client.chat.completions.create(
model="agent/7c1e9a42-b35d8f06-a2c4e719-5d0b3f8e",
messages=[{"role": "user", "content": "What are your opening hours on Saturday?"}],
max_tokens=400,
)
print(completion.choices[0].message.content)
except APIStatusError as e:
if e.status_code == 409:
print("The assistant is paused. Please try again later.")
else:
raise

Show the customer a simple sentence, not the technical error. To know the status before you open the chat, use GET /v1/models?type=agent: the status field comes as active or paused. See listing your agents through the API.

Want to control when your agent answers? See All in One AI.

See All in One AI

SEE ALSO

Creating an AI agent in All in One AI, step by step

Agent errors through the API: agent_paused and model_not_found

Listing your agents through the API: type=agent, base_model and status

Using your AI agent through the API: agent/ in the model field

All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from 396,00 MT/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.