-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_agent.py
More file actions
50 lines (42 loc) · 1.38 KB
/
create_agent.py
File metadata and controls
50 lines (42 loc) · 1.38 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
#!/usr/bin/env python3
"""
Create Agent Example
This example demonstrates how to create a new agent with configuration.
"""
from roe import RoeClient
def main():
client = RoeClient()
# Create a multimodal extraction agent
agent = client.agents.create(
name="Document Summarizer",
engine_class_id="MultimodalExtractionEngine",
input_definitions=[
{
"key": "document",
"data_type": "application/pdf",
"description": "PDF document to summarize",
},
],
engine_config={
"model": "gpt-4.1-2025-04-14",
"instruction": "Summarize the key points of this document.",
"output_schema": {
"type": "object",
"properties": {
"summary": {"type": "string", "description": "Document summary"},
"key_points": {
"type": "array",
"items": {"type": "string"},
"description": "Key points from the document",
},
},
},
},
version_name="v1",
description="Initial version",
)
print(f"Created agent: {agent.name}")
print(f"Agent ID: {agent.id}")
print(f"Current version ID: {agent.current_version_id}")
if __name__ == "__main__":
main()