autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Autogen Studio Feature Request]: The ability to export agents and workflows as python code.

Open tjthejuggler opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

I want to create workflows in Studio and then be able to export them to be used in other programs. Sorry if this is already a feature, but I've been unable to find any way to do it.

Describe the solution you'd like

No response

Additional context

No response

tjthejuggler avatar Jan 16 '24 18:01 tjthejuggler

Hi @tjthejuggler ,

Thanks for opening this issue. I agree that it is important and we are already thinking of this. Currently, we have an example notebook that shows how you can load a workflow spec (json) and run tasks against it in python code.

What we will need to add is the ability to download the workflow created in the UI.

import json

from autogenstudio import AgentWorkFlowConfig, AutoGenWorkFlowManager

# load an agent specification in JSON
agent_spec = json.load(open("agent_spec.json"))

# Creat a An AutoGen Workflow Configuration from the agent specification
agent_work_flow_config = AgentWorkFlowConfig(**agent_spec)

# # Create a Workflow from the configuration 
agent_work_flow = AutoGenWorkFlowManager(agent_work_flow_config) 

# # Run the workflow on a task
task_query = "What is the height of the Eiffel Tower?. Dont write code, just respond to the question."
agent_work_flow.run(message=task_query)

Does this address the use case you have in mind?

Image

I have added a work item to the task #1285 to track this.

victordibia avatar Jan 16 '24 18:01 victordibia

Yes, that is exactly what I was imagining, that would be awesome! Thanks so much for the response and for working on this awesome project!

tjthejuggler avatar Jan 16 '24 19:01 tjthejuggler

Thank you for making this awesome tool.

rmtbb avatar Feb 09 '24 04:02 rmtbb

Also would like to see this. Autogenstudio is a great nocode way to get hooked but now finding myself wanting to step into the code for some deeper POCs but would be great to have a path from the Studio to help me achieve that.

monkeydust avatar Mar 17 '24 18:03 monkeydust