Skip to content

Commit 52ea2d9

Browse files
authored
Merge pull request #23 from AgentOps-AI/autogen-research
added some autogen template code and readme
2 parents ce67f51 + 240e19e commit 52ea2d9

File tree

6 files changed

+97
-15
lines changed

6 files changed

+97
-15
lines changed

README.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ If you have questions or need help, please ask in our [Discord community](https:
1313

1414
> 🛠️🚨 AgentStack is in open preview. We're building in public, use at your own risk but have fun :)
1515
16+
AgentStack serves as a great tool for starting your agent project and offers many CLI utilities for easy code-gen throughout the development process.
17+
18+
AgentStack is _not_ a low-code alternative to development. Developers will still need an understanding of how to build with their selected agent framework.
19+
1620
## Quick Overview
1721

1822
```sh
@@ -73,12 +77,14 @@ Runs the agent project in development mode.<br>
7377

7478
## Philosophy
7579

76-
- **Agents should be easy:** There are so many frameworks out there, but starting from scratch is a pain. Similar to Create React App, AgentStack aims to simplify the "from scratch" process by giving you a simple boilerplate of an agent. It uses popular agent frameworks and LLM providers, but provides a cohesive curated experience on top of them.
80+
- **Agents should be easy:** There are so many frameworks out there, but starting from scratch is a pain. Similar to `create-react-app`, AgentStack aims to simplify the "from scratch" process by giving you a simple boilerplate of an agent. It uses popular agent frameworks and LLM providers, but provides a cohesive curated experience on top of them.
7781

7882
- **No Configuration Required:** You don't need to configure anything. A reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.
7983

8084
- **No Lock-In:** You can customize your setup at any time. AgentStack is designed to make it easy to get the components you need running right off the bat; it's up to you what to do next.
8185

86+
AgentStack is not designed to be a low-code solution to building agents. Instead it is a great head-start for starting an agent project from scratch.
87+
8288
## What's Included?
8389

8490
Your environment will have everything you need to build a modern AI agent project:
@@ -92,16 +98,24 @@ Your environment will have everything you need to build a modern AI agent projec
9298
- Hassle-free updates for the above tools with a single dependency.
9399

94100
## Roadmap
95-
* Frameworks
96-
* Autogen
97-
* LiteLLM
98-
* Swarms (OpenAI)
99-
* Tools
100-
* MultiOn
101-
* Firecrawl
102-
* Anon
103-
* E2B
104-
* More
101+
102+
### Frameworks
103+
104+
#### CrewAI
105+
Development of AgentStack is being done primarily on [CrewAI](https://crewai.com).
106+
107+
#### AutoGen
108+
Some work has been done to add Microsoft's [AutoGen](https://microsoft.github.io/autogen/0.2/), although these efforts have been paused. AutoGen is currently in the process of making [large design decisions](https://microsoft.github.io/autogen/dev/) that will effect the integration with AgentStack.
109+
110+
### Tools
111+
Many tools are currently supported. The short-term roadmap includes:
112+
* MultiOn
113+
* Firecrawl
114+
* Anon
115+
* E2B
116+
* More
117+
118+
### Other Features
105119
* Generated testing
106120
* Integrated benchmarking
107121

agentstack/generation/agent_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def generate_crew_agent(
9292
f"def {name}(self) -> Agent:",
9393
" return Agent(",
9494
f" config=self.agents_config['{name}'],",
95-
" tools=[], # add tools here or use `agentstack tools add <tool_name>",
95+
" tools=[], # add tools here or use `agentstack tools add <tool_name>", # TODO: Add any tools in agentstack.json
9696
" verbose=True",
9797
" )",
9898
""

agentstack/templates/autogen/{{cookiecutter.project_metadata.project_slug}}/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,4 @@ cython_debug/
162162
#.idea/
163163

164164
.agentops/
165+
OAI_CONFIG_LIST
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"model": "gpt-4",
4+
"api_key": "<your_key>",
5+
"tags": ["gpt-4", "tool"]
6+
}
7+
]

agentstack/templates/autogen/{{cookiecutter.project_metadata.project_slug}}/pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,4 @@ license = "{{cookiecutter.project_metadata.license}}"
88
[tool.poetry.dependencies]
99
python = "^3.11"
1010
agentops = "^0.3.12"
11-
{%- if cookiecutter.framework == "crewai" %}
12-
crewai = "^0.63.6"
13-
{%- endif %}
11+
autogen-agentchat = "~0.2"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
from typing import Annotated, Literal
2+
3+
import agentops
4+
5+
from autogen import ConversableAgent, UserProxyAgent, config_list_from_json, register_function
6+
7+
agentops.init()
8+
9+
10+
def main():
11+
# Load LLM inference endpoints from an env variable or a file
12+
# See https://microsoft.github.io/autogen/docs/FAQ#set-your-api-endpoints
13+
# and OAI_CONFIG_LIST_sample.
14+
# For example, if you have created a OAI_CONFIG_LIST file in the current working directory, that file will be used.
15+
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")
16+
17+
{%- for agent in cookiecutter.structure.agents %}
18+
19+
{{agent.name}}_agent = ConversableAgent(
20+
name="{{agent.name}}",
21+
system_message="""
22+
role:
23+
{{agent.role}}
24+
goal:
25+
{{agent.goal}}
26+
backstory:
27+
{{agent.backstory}}
28+
""",
29+
llm_config={"config_list": config_list}, # TODO: support other models
30+
)
31+
{%- endfor %}
32+
33+
# # The user proxy agent is used for interacting with the assistant agent
34+
# # and executes tool calls.
35+
user_proxy = ConversableAgent(
36+
name="User",
37+
llm_config=False,
38+
is_termination_msg=lambda msg: msg.get("content") is not None and "TERMINATE" in msg["content"],
39+
human_input_mode="NEVER",
40+
)
41+
42+
# TODO: use this as tool add example
43+
# assistant.register_for_llm(name="calculator", description="A simple calculator")(calculator)
44+
# user_proxy.register_for_execution(name="calculator")(calculator)
45+
46+
# Register the calculator function to the two agents.
47+
# register_function(
48+
# calculator,
49+
# caller=assistant, # The assistant agent can suggest calls to the calculator.
50+
# executor=user_proxy, # The user proxy agent can execute the calculator calls.
51+
# name="calculator", # By default, the function name is used as the tool name.
52+
# description="A simple calculator", # A description of the tool.
53+
# )
54+
55+
# Let the assistant start the conversation. It will end when the user types exit.
56+
# user_proxy.initiate_chat(assistant, message="What is (1423 - 123) / 3 + (32 + 23) * 5?")
57+
58+
agentops.end_session("Success")
59+
60+
61+
if __name__ == "__main__":
62+
main()

0 commit comments

Comments
 (0)