Skip to content

Commit

Permalink
Merge branch 'multi-agents' of https://github.com/csunny/DB-GPT into …
Browse files Browse the repository at this point in the history
…multi-agents
  • Loading branch information
yhjun1026 committed Dec 26, 2023
2 parents e5b8eff + b0593da commit e1e43c6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
20 changes: 17 additions & 3 deletions examples/agents/auto_plan_agent_dialogue_example.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
"""Agents: auto plan agents example?
Examples:
Execute the following command in the terminal:
Set env params.
.. code-block:: shell
export OPENAI_API_KEY=sk-xx
export OPENAI_API_BASE=https://xx:80/v1
run example.
..code-block:: shell
python examples/agents/auto_plan_agent_dialogue_example.py
"""


from dbgpt.agent.agents.planner_agent import PlannerAgent
from dbgpt.agent.agents.user_proxy_agent import UserProxyAgent
from dbgpt.agent.agents.plan_group_chat import PlanChat, PlanChatManager
Expand Down Expand Up @@ -39,9 +56,6 @@

user_proxy = UserProxyAgent(memory=default_memory, agent_context=context)

os.environ["OPENAI_API_KEY"] = "sk-xx"
os.environ["OPENAI_API_BASE"] = "https://xx:80/v1"

asyncio.run(
user_proxy.a_initiate_chat(
recipient=manager,
Expand Down
20 changes: 17 additions & 3 deletions examples/agents/single_agent_dialogue_example.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
"""Agents: single agents about CodeAssistantAgent?
Examples:
Execute the following command in the terminal:
Set env params.
.. code-block:: shell
export OPENAI_API_KEY=sk-xx
export OPENAI_API_BASE=https://xx:80/v1
run example.
..code-block:: shell
python examples/agents/single_agent_dialogue_example.py
"""

from dbgpt.agent.agents.expand.code_assistant_agent import CodeAssistantAgent
from dbgpt.agent.agents.user_proxy_agent import UserProxyAgent
from dbgpt.agent.memory.gpts_memory import GptsMemory
from dbgpt.agent.agents.agent import AgentContext
import asyncio
import os


if __name__ == "__main__":

from dbgpt.model import OpenAILLMClient
Expand All @@ -18,9 +35,6 @@

user_proxy = UserProxyAgent(memory=default_memory, agent_context=context)

os.environ["OPENAI_API_KEY"] = "sk-xx"
os.environ["OPENAI_API_BASE"] = "https://xx:80/v1"

asyncio.run(
user_proxy.a_initiate_chat(
recipient=coder,
Expand Down

0 comments on commit e1e43c6

Please sign in to comment.