Simulate the agent configuration
(self, goal: str, description: str, world_info: str, functions: list, custom_functions: list, main_heartbeat: int, reaction_heartbeat: int)
| 91 | return response.json()["data"] |
| 92 | |
| 93 | def deploy(self, goal: str, description: str, world_info: str, functions: list, custom_functions: list, main_heartbeat: int, reaction_heartbeat: int): |
| 94 | """ |
| 95 | Simulate the agent configuration |
| 96 | """ |
| 97 | response = requests.post( |
| 98 | f"{self.api_url}/deploy", |
| 99 | json={ |
| 100 | "data": { |
| 101 | "goal": goal, |
| 102 | "description": description, |
| 103 | "worldInfo": world_info, |
| 104 | "functions": functions, |
| 105 | "customFunctions": custom_functions, |
| 106 | "gameState" : { |
| 107 | "mainHeartbeat" : main_heartbeat, |
| 108 | "reactionHeartbeat" : reaction_heartbeat, |
| 109 | } |
| 110 | } |
| 111 | }, |
| 112 | headers={"x-api-key": self.api_key} |
| 113 | ) |
| 114 | |
| 115 | if (response.status_code != 200): |
| 116 | raise Exception(response.json()) |
| 117 | |
| 118 | return response.json()["data"] |