Export the agent configuration as JSON string
(self)
| 272 | ) |
| 273 | |
| 274 | def export(self) -> str: |
| 275 | """Export the agent configuration as JSON string""" |
| 276 | export_dict = { |
| 277 | "goal": self.goal, |
| 278 | "description": self.description, |
| 279 | "worldInfo": self.world_info, |
| 280 | "functions": self.enabled_functions, |
| 281 | "customFunctions": [ |
| 282 | { |
| 283 | "id": func.id, |
| 284 | "fn_name": func.fn_name, |
| 285 | "fn_description": func.fn_description, |
| 286 | "args": [asdict(arg) for arg in func.args], |
| 287 | "hint": func.hint, |
| 288 | "config": asdict(func.config) |
| 289 | } |
| 290 | for func in self.custom_functions |
| 291 | ] |
| 292 | } |
| 293 | agent_json = json.dumps(export_dict, indent=4) |
| 294 | |
| 295 | # save to file |
| 296 | with open('agent.json', 'w') as f: |
| 297 | f.write(agent_json) |
| 298 | |
| 299 | return agent_json |
nothing calls this directly
no outgoing calls
no test coverage detected