API call to create an agent instance (worker or agent with task generator)
(
base_url: str,
api_key: str,
name: str,
description: str,
goal: str)
| 49 | |
| 50 | |
| 51 | def create_agent( |
| 52 | base_url: str, |
| 53 | api_key: str, |
| 54 | name: str, |
| 55 | description: str, |
| 56 | goal: str) -> str: |
| 57 | """ |
| 58 | API call to create an agent instance (worker or agent with task generator) |
| 59 | """ |
| 60 | |
| 61 | create_agent_response = post( |
| 62 | base_url, |
| 63 | api_key, |
| 64 | endpoint="/v2/agents", |
| 65 | data={ |
| 66 | "name": name, |
| 67 | "description": description, |
| 68 | "goal": goal, |
| 69 | } |
| 70 | ) |
| 71 | |
| 72 | return create_agent_response["id"] |
| 73 | |
| 74 | |
| 75 | def create_workers(base_url: str, |