Replies: 1 comment
-
Hello, do you get the solution on this ask to create Rest API? I am looking for same. I do see doc in DEPLOY Section of Studio but I need more details. Please let me know on this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
So I wanted to know how we could use the json script that we can extract when creating a system on Autogen Studio UI.
Because I want to see whether I can make use of the UI in order to easily create agents to deploy for production.
But I am not well versed in json.
So if someone could provide some insight on how to do so. It would help alot.
`{
"provider": "autogen_agentchat.teams.RoundRobinGroupChat",
"component_type": "team",
"version": 1,
"component_version": 1,
"description": "A single AssistantAgent (with a calculator tool) in a RoundRobinGroupChat team. ",
"label": "RoundRobin Team_17531",
"config": {
"participants": [
{
"provider": "autogen_agentchat.agents.AssistantAgent",
"component_type": "agent",
"version": 1,
"component_version": 1,
"description": "An agent that provides assistance with tool use.",
"label": "AssistantAgent",
"config": {
"name": "assistant_agent",
"model_client": {
"provider": "autogen_ext.models.openai.AzureOpenAIChatCompletionClient",
"component_type": "model",
"version": 1,
"component_version": 1,
"description": "GPT-4o Mini Azure OpenAI model client.",
"label": "AzureOpenAI GPT-4o-mini",
"config": {
"model": "gpt-4o",
"api_key": "2a926b69bbe44671a4ffd1fdea6c1ab6",
"azure_endpoint": "https://tcgai-OpenAI-01.openai.azure.com/",
"azure_deployment": "gpt-4o",
"api_version": "2024-06-01"
}
},
"workbench": {
"provider": "autogen_core.tools.StaticWorkbench",
"component_type": "workbench",
"version": 1,
"component_version": 1,
"description": "A workbench that provides a static set of tools that do not change after\n each tool execution.",
"label": "StaticWorkbench",
"config": {
"tools": [
{
"provider": "autogen_core.tools.FunctionTool",
"component_type": "tool",
"version": 1,
"component_version": 1,
"description": "Create custom tools by wrapping standard Python functions.",
"label": "FunctionTool",
"config": {
"source_code": "def calculator(a: float, b: float, operator: str) -> str:\n try:\n if operator == "+":\n return str(a + b)\n elif operator == "-":\n return str(a - b)\n elif operator == "*":\n return str(a * b)\n elif operator == "/":\n if b == 0:\n return "Error: Division by zero"\n return str(a / b)\n else:\n return "Error: Invalid operator. Please use +, -, *, or /"\n except Exception as e:\n return f"Error: {str(e)}"\n",
"name": "calculator",
"description": "A simple calculator that performs basic arithmetic operations",
"global_imports": [],
"has_cancellation_support": false
}
}
]
}
},
"model_context": {
"provider": "autogen_core.model_context.UnboundedChatCompletionContext",
"component_type": "chat_completion_context",
"version": 1,
"component_version": 1,
"description": "An unbounded chat completion context that keeps a view of the all the messages.",
"label": "UnboundedChatCompletionContext",
"config": {}
},
"description": "An agent that provides assistance with ability to use tools.",
"system_message": "You are a helpful assistant. Solve tasks carefully. When done, say TERMINATE.",
"model_client_stream": false,
"reflect_on_tool_use": false,
"tool_call_summary_format": "{result}",
"metadata": {}
}
}
],
"termination_condition": {
"provider": "autogen_agentchat.base.OrTerminationCondition",
"component_type": "termination",
"version": 1,
"component_version": 1,
"label": "OrTerminationCondition",
"config": {
"conditions": [
{
"provider": "autogen_agentchat.conditions.TextMentionTermination",
"component_type": "termination",
"version": 1,
"component_version": 1,
"description": "Terminate the conversation if a specific text is mentioned.",
"label": "TextMentionTermination",
"config": {
"text": "TERMINATE"
}
},
{
"provider": "autogen_agentchat.conditions.MaxMessageTermination",
"component_type": "termination",
"version": 1,
"component_version": 1,
"description": "Terminate the conversation after a maximum number of messages have been exchanged.",
"label": "MaxMessageTermination",
"config": {
"max_messages": 10,
"include_agent_event": false
}
}
]
}
},
"emit_team_events": false}
}`
above is the basic code for default round robin team.
So I want to know how to deploy this as a REST API. And posting question to the API URL that the system is linked to.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions