-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanage_versions.py
More file actions
60 lines (48 loc) · 1.58 KB
/
manage_versions.py
File metadata and controls
60 lines (48 loc) · 1.58 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env python3
"""
Manage Versions Example
This example demonstrates how to create, update, and delete agent versions.
"""
import os
from roe import RoeClient
AGENT_ID = os.getenv("AGENT_ID", "your-agent-uuid-here")
def main():
client = RoeClient()
# Create a new version with updated config
version = client.agents.versions.create(
agent_id=AGENT_ID,
version_name="v2",
description="Improved extraction with better prompts",
input_definitions=[
{
"key": "text",
"data_type": "text/plain",
"description": "Text to process",
},
],
engine_config={
"model": "gpt-4.1-2025-04-14",
"instruction": "Extract structured data from the text.",
"temperature": "0",
},
)
print(f"Created version: {version.version_name}")
print(f"Version ID: {version.id}")
# Update version metadata
client.agents.versions.update(
agent_id=AGENT_ID,
version_id=str(version.id),
version_name="v2-final",
description="Production-ready version",
)
print("Version updated")
# List all versions
versions = client.agents.versions.list(AGENT_ID)
print(f"\nAll versions ({len(versions)}):")
for v in versions:
print(f" - {v.version_name}: {v.description or 'No description'}")
# Delete a version (uncomment to use)
# client.agents.versions.delete(agent_id=AGENT_ID, version_id="version-uuid")
# print("Version deleted")
if __name__ == "__main__":
main()