-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_agent.py
More file actions
38 lines (27 loc) · 896 Bytes
/
update_agent.py
File metadata and controls
38 lines (27 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
"""
Update Agent Example
This example demonstrates how to update, duplicate, and delete agents.
"""
import os
from roe import RoeClient
AGENT_ID = os.getenv("AGENT_ID", "your-agent-uuid-here")
def main():
client = RoeClient()
# Update agent settings
updated = client.agents.update(
agent_id=AGENT_ID,
name="Renamed Agent",
disable_cache=False,
cache_failed_jobs=True,
)
print(f"Updated agent: {updated.name}")
# Duplicate an agent (creates a new agent with different ID)
new_agent = client.agents.duplicate(agent_id=AGENT_ID)
print(f"Duplicated agent, new agent ID: {new_agent.id}")
print(f"New agent name: {new_agent.name}")
# Delete an agent (uncomment to use)
# client.agents.delete(agent_id="agent-to-delete-uuid")
# print("Agent deleted")
if __name__ == "__main__":
main()