MCPcopy Create free account
hub / github.com/Virtual-Protocol/virtuals-python / export

Method export

src/virtuals_sdk/twitter_agent/agent.py:274–299  ·  view source on GitHub ↗

Export the agent configuration as JSON string

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected