Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from OpenBMB:main #8

Open
wants to merge 115 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
aa54608
feat: add azure openai
JetSquirrel Oct 7, 2023
6045f49
fix miss register
JetSquirrel Oct 8, 2023
e762c1e
Update README.md
chenweize1998 Oct 8, 2023
4f76ad6
Merge pull request #49 from JetSquirrel/azure_openai
chenweize1998 Oct 8, 2023
f717bc0
fix: openai llm default parameter and the missing import of bmtools #46
chenweize1998 Oct 8, 2023
62676a1
fix: critic agent initialization argument error
chenweize1998 Oct 8, 2023
ad67c70
ci: add a Github Actions workflow for smoke test
minleminzui Oct 8, 2023
e7acdd4
Merge pull request #50 from minleminzui/main
chenweize1998 Oct 8, 2023
5bbd355
report spend at the end of a task solving session
kierangilliam Oct 8, 2023
031d3d9
remove abstract requirement
kierangilliam Oct 8, 2023
f6d60c0
report metrics for simulations
kierangilliam Oct 8, 2023
abd444e
Merge pull request #52 from kierangilliam/report-usage
chenweize1998 Oct 9, 2023
bc58c02
update README.md
chenweize1998 Oct 9, 2023
d359c76
fix: allows users to customize config.yaml of the task (#53)
minleminzui Oct 9, 2023
ff67cff
ci skip. Update README.md
chenweize1998 Oct 9, 2023
0360286
fix: fix the incompatible simulation configs. ci skip
chenweize1998 Oct 10, 2023
8107ee4
Merge branch 'main' of github.com:OpenBMB/AgentVerse into main
chenweize1998 Oct 10, 2023
ccf4319
fix: complete the command line (#55)
minleminzui Oct 10, 2023
6bdce1d
refactor: reorganize script location
chenweize1998 Oct 10, 2023
6d42bb6
bump version to 0.1.5
chenweize1998 Oct 10, 2023
7954f21
ci skip. Update README.md
chenweize1998 Oct 10, 2023
7c8dbca
ci skip. Update README.md
chenweize1998 Oct 10, 2023
63b2d33
ci skip. Update README.md
chenweize1998 Oct 10, 2023
c4205bd
manually merge #19.
chenweize1998 Oct 10, 2023
9b03c91
fix: format error in some benchmark configs
chenweize1998 Oct 11, 2023
0208699
fix: update MANIFEST.in [ci skip]
chenweize1998 Oct 11, 2023
88744f1
fix: arrange output parser classes (#59)
minleminzui Oct 11, 2023
7739cba
bump version to 0.1.8 #60
chenweize1998 Oct 12, 2023
7aeed34
fix: fix a bug about updating kwargs
minleminzui Oct 13, 2023
3af33f8
Merge pull request #62 from OpenBMB/gyt_dev
minleminzui Oct 13, 2023
af34300
update
yushengsu-thu Oct 14, 2023
0a1a225
update
yushengsu-thu Oct 14, 2023
362dfce
update
yushengsu-thu Oct 14, 2023
86f10c3
update
yushengsu-thu Oct 14, 2023
1b2a86b
update
yushengsu-thu Oct 14, 2023
f1261cf
update
yushengsu-thu Oct 14, 2023
e477d7e
update
yushengsu-thu Oct 14, 2023
0b1ed5e
update
yushengsu-thu Oct 14, 2023
b529052
update
yushengsu-thu Oct 14, 2023
51f4c8b
update
yushengsu-thu Oct 14, 2023
bc9216e
update
yushengsu-thu Oct 14, 2023
dd49c21
update
yushengsu-thu Oct 14, 2023
558e8b2
update
yushengsu-thu Oct 14, 2023
7733c92
update
yushengsu-thu Oct 14, 2023
c853084
update
yushengsu-thu Oct 14, 2023
b0b018a
update
yushengsu-thu Oct 14, 2023
d13c412
update
yushengsu-thu Oct 14, 2023
af4b455
update
yushengsu-thu Oct 14, 2023
e72820a
update
yushengsu-thu Oct 14, 2023
5292621
add simulation ui params (#63)
JetSquirrel Oct 15, 2023
5b5f7fe
feat: agent order independence in config (#65)
1rubbishyuan Oct 16, 2023
519701e
update
yushengsu-thu Oct 16, 2023
7738f85
update
yushengsu-thu Oct 16, 2023
927955c
update
yushengsu-thu Oct 16, 2023
8a9a6b6
update
yushengsu-thu Oct 16, 2023
7209df3
update
yushengsu-thu Oct 16, 2023
d738273
Update README.md
yushengsu-thu Oct 16, 2023
fef985b
update
yushengsu-thu Oct 16, 2023
4bced67
update
yushengsu-thu Oct 16, 2023
eea1a8c
Merge pull request #66 from OpenBMB/56-to-do-update-the-readme
yushengsu-thu Oct 16, 2023
8a9f38e
Update README.md
yushengsu-thu Oct 16, 2023
31dc92d
Update README.md
yushengsu-thu Oct 16, 2023
6493304
doc: modify README.md (#67) [ci skip]
ASL-r Oct 17, 2023
b001a32
update requirements.txt [ci skip]
chenweize1998 Oct 18, 2023
53f2ec0
fix: session expired bug in tool calling
chenweize1998 Oct 18, 2023
39faec3
feat: support local llms (#68)
cheesewafer Oct 19, 2023
2b67776
Update README.md [ci skip]
chenweize1998 Oct 20, 2023
f50dbe9
Update README.md [ci skip]
chenweize1998 Oct 20, 2023
4451c41
Update README.md
yushengsu-thu Oct 21, 2023
03fdab7
Update README.md
yushengsu-thu Oct 22, 2023
d861178
Merge pull request #71 from OpenBMB/yushengsu-thu-patch-1
yushengsu-thu Oct 22, 2023
d108100
Update README.md [ci skip]
chenweize1998 Oct 22, 2023
f4718a5
Update README.md
yushengsu-thu Oct 22, 2023
7cabb5b
Merge pull request #74 from OpenBMB/yushengsu-thu-patch-1
yushengsu-thu Oct 22, 2023
193088a
Update README.md
yushengsu-thu Oct 22, 2023
dd4e651
fix: typo in logger call and error path in gui [ci skip]
chenweize1998 Oct 23, 2023
118c5fe
add PR template
yushengsu-thu Oct 23, 2023
970f344
Merge pull request #78 from OpenBMB/77-pull_request_templatemd
yushengsu-thu Oct 23, 2023
fb02336
Update README.md
yushengsu-thu Oct 23, 2023
eb6109b
Merge pull request #79 from OpenBMB/yushengsu-thu-patch-1
yushengsu-thu Oct 23, 2023
78387ee
Update README.md
yushengsu-thu Oct 23, 2023
dc0921b
Merge pull request #80 from OpenBMB/yushengsu-thu-patch-1
yushengsu-thu Oct 23, 2023
5fab7fc
fix: import error in alice home task #76
chenweize1998 Oct 23, 2023
0c1e7f2
Update README.md
yushengsu-thu Oct 25, 2023
0f82e26
Merge pull request #85 from OpenBMB/yushengsu-thu-patch-1
yushengsu-thu Oct 25, 2023
14a8f34
fix: bug in simulation gui. [ci skip]
chenweize1998 Oct 25, 2023
641290d
fix: bug in simulation gui.
chenweize1998 Oct 25, 2023
fab0ab8
Update agentverse.py
Kunlun-Zhu Oct 26, 2023
c9c0dbe
bump: 0.1.8.1
chenweize1998 Oct 27, 2023
64db306
feat: add tool support (#86)
minleminzui Oct 27, 2023
81a964c
doc: update readme on multi-agent tool using.
chenweize1998 Oct 27, 2023
f0ddd0e
Merge branch 'main' of github.com:OpenBMB/AgentVerse into main
chenweize1998 Oct 27, 2023
8ad97cb
doc: update installation and dependency
chenweize1998 Oct 30, 2023
067aae4
fix: remove debugging code. [ci skip]
chenweize1998 Oct 31, 2023
b0eeeea
fix: update outdated configs and fix logging #95
chenweize1998 Nov 7, 2023
42e5799
fix: some bugs in config file
chenweize1998 Nov 7, 2023
38cc573
feat: improve local model support and doc #96
chenweize1998 Nov 7, 2023
ddd9a88
doc: Update config.yaml typo [ci skip]
Divine-Shadow Nov 8, 2023
2e59ccb
doc: Fix typo in README.md (#90) [ci skip]
eltociear Nov 8, 2023
d882566
doc: update README.md (#92) [ci skip]
eltociear Nov 8, 2023
2557283
doc: update README.md [ci skip]
chenweize1998 Nov 10, 2023
abacf5a
fix: encoding for local llm. #100
chenweize1998 Nov 12, 2023
ffc3d39
Update README.md
yushengsu-thu Nov 12, 2023
c16ee0a
fix: local llm support #100
chenweize1998 Nov 13, 2023
d434c5a
fix: output parser error in demo case [ci skip]
chenweize1998 Nov 15, 2023
1c92dbe
doc: add a simple documentation (#91)
elolelo Nov 20, 2023
33e61d1
feat: support docker (#107)
soulteary Dec 28, 2023
5fb1f77
feat: allow custom openai base url (#108)
soulteary Dec 28, 2023
4c16c42
Update README.md on the news (#118)
Kunlun-Zhu Jan 18, 2024
ebcf88b
fix: dependency and typing error #120
chenweize1998 Mar 6, 2024
fa916e1
Update README.md
yushengsu-thu Mar 21, 2024
c7e5c1c
OpenAI 1.0 and vLLMs support (#127)
chenweize1998 Mar 24, 2024
6e6dff6
fix: github action
chenweize1998 Mar 24, 2024
c755193
Update openai.py
1ring2rta Apr 25, 2024
4dd772d
fix: openai async client bug #130
chenweize1998 Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.github
.gitignore
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Cancel previous run
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Upgrade pip
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
- name: Test
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_ORGANIZATION: ${{ secrets.OPENAI_ORGANIZATION }}
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
run: |
python setup.py develop
python agentverse_command/benchmark.py --task tasksolving/mgsm/gpt-3.5 --dataset_path data/mgsm/test_sample.jsonl --overwrite --output_path ci_smoke_test_output --tasks_dir ./agentverse/tasks
python scripts/evaluate_math.py --path ci_smoke_test_output/results.jsonl --ci_smoke_test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,6 @@ raw/
results
tmp/
data/toolbench
logs/
logs/
ci_smoke_test_output/
.env
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM python:3.10 as Builder
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list.d/debian.sources
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
pip3 install --upgrade pip # enable PEP 660 support
WORKDIR /app
# install libGL.so.1
RUN apt-get update && apt-get install libgl1 -y
# install BMTools
RUN git clone https://github.com/OpenBMB/BMTools.git --depth=1
RUN cd BMTools && \
pip install -r requirements.txt && \
python setup.py develop
# install AgentVerse
WORKDIR /app/AgentVerse
COPY requirements*.txt ./
RUN pip install -r requirements.txt
RUN pip install -r requirements_local.txt
COPY . .
RUN pip install -e .
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include agentverse/tasks/*/*
include agentverse/tasks/*/*/*
include agentverse/tasks/*/*/*/*
32 changes: 32 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

<!--
First of all, thank you for your contribution! 😄
-->


### 🤔 What is the nature of this change?

- [ ] New feature
- [ ] Fix bug / bug
- [ ] Style optimization
- [ ] Code style optimization
- [ ] Performance optimization
- [ ] Build optimization
- [ ] Website, documentation, demo improvements
- [ ] Refactor code or style
- [ ] Test related
- [ ] Solved proposed issues
- [ ] Other

### 🔗 Related Issue

(Describe the source of related requirements, such as the related issue discussion link. Example: close #123, close #456.)

### 💡 Background or solution

(The specific problem solved.)

### 📝 Changelog

(Describe changes from the user side, and list all potential break changes or other risks.)

373 changes: 300 additions & 73 deletions README.md

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions README_simulation_cases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

## 👾 Simple Demo Video

We demonstrate the following cases that are expertly crafted by AgentVerse.


#### NLP Classroom
In the NLP class, the professor and students engage in interactive communication. When students have a question, they raise their hands and patiently wait for the professor to call on them. Only after being called on by the professor, can students speak and ask their questions.

Use the following command to launch the NLP Classroom example:
```bash
python agentverse_command/main_simulation_gui.py --task simulation/nlp_classroom_9players
```

https://github.com/OpenBMB/AgentVerse/assets/11704492/6ea07850-595e-4a28-a82e-f863011353c2


#### Prisoner Dilemma
A prisoner's Dilemma is a thought experiment that challenges two completely rational agents to a dilemma: they can cooperate with their partner for mutual benefit or betray their partner ("defect") for individual reward.

Use the following command to launch the Prisoner Dilemma example:
```bash
python agentverse_command/main_simulation_gui.py --task simulation/prisoner_dilemma
```

https://github.com/OpenBMB/AgentVerse/assets/11704492/017c46e5-c738-4fca-9352-b008e2d518bd


#### Software Design
In the Software Design example, a code writer, a code tester and a code reviewer collaborate on the code generation problem. Given a problem, the code writer first composes the code implementation. The code tester runs the unit tests and provides the feedback. The code viewer then generates a review. After collecting the test feedback and review, the code writer iteratively refines the code.

Use the following command to launch the Software Design example:
```bash
python agentverse_command/main_simulation_gui.py --task simulation/sde_team/sde_team_2players
```

https://github.com/OpenBMB/AgentVerse/assets/11704492/5058066a-abee-490d-8659-b4e54661626a


#### [Database Administrator (DBA)](https://github.com/TsinghuaDatabaseGroup/DB-GPT)

In the database diagnosis scenario, the Chief DBA monitors the system anomalies (e.g., slow queries, locks, crash down). If detected, the domain experts are alerted to analyze root causes, share insights, and suggest optimization solutions together. The Chief DBA then provides a summarized report to the user.

```bash
python agentverse_command/main_simulation_gui.py --task simulation/db_diag
```

https://github.com/OpenBMB/AgentVerse/assets/11704492/c633419d-afbb-47d4-bb12-6bb512e7af3a

#### [Text Evaluation (ChatEval)](https://github.com/chanchimin/ChatEval)
In the context of the text evaluation scenario, we recommend users explore the [ChatEval](https://github.com/chanchimin/ChatEval) repo. They've implemented a multi-agent referee team on AgentVerse to assess the quality of text generated by different models. When given two distinct pieces of text, roles within ChatEval can autonomously debate the nuances and disparities, drawing upon their assigned personas, and subsequently provide their judgments. Experiments indicate that their referee team, enriched with diverse roles specified in [config.yaml](#2-configuring-the-agents), aligns more closely with human evaluations. This demo is built upon the [Fastchat](https://github.com/lm-sys/FastChat) repo, and we'd like to express our appreciation for their foundational work.


https://github.com/OpenBMB/AgentVerse/assets/75533759/58f33468-f15b-4bac-ae01-8d0780019f85

#### Pokemon
**Currently available only in [`release-0.1`](https://github.com/OpenBMB/AgentVerse/tree/release-0.1)**. In the game, agents can walk around the game world, and interact with one another. As a player, you take on the role of an agent and can engage with others at any time. There are 6 characters in the Pokémon environment who appeared in Pokemon Emerald: [May](https://bulbapedia.bulbagarden.net/wiki/May_(game)), [Professor Birch](https://bulbapedia.bulbagarden.net/wiki/Professor_Birch), [Steven Stone](https://bulbapedia.bulbagarden.net/wiki/Steven_Stone), [Maxie](https://bulbapedia.bulbagarden.net/wiki/Maxie), [Archie](https://bulbapedia.bulbagarden.net/wiki/Archie) and [Joseph](https://bulbapedia.bulbagarden.net/wiki/Mr._Stone).

To launch the Pokemon game, first launch a local server with the following command:
```bash
uvicorn pokemon_server:app --reload --port 10002
```
Then open another terminal in the project's root path and run the following command:
```bash
cd ui
# If you do not have npm installed, you need to install it before running the following commands
# https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
# We have tested on [email protected], [email protected]
npm install
npm run watch
```
Wait for the compilation to complete, and have fun! (WASD for moving around, and SPACE for launching a conversation.)

https://github.com/OpenBMB/AgentVerse/assets/11704492/4d07da68-f942-4205-b558-f155e95782e7

Empty file added README_tasksolving_cases.md
Empty file.
10 changes: 10 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<a href="https://www.python.org/downloads/release/python-3916/">
<img alt="Documentation" src="https://img.shields.io/badge/python-3.9+-blue.svg">
</a>
<a href="https://huggingface.co/spaces/AgentVerse/agentVerse">
<img alt="Hugging Face" src="https://img.shields.io/badge/hugging_face-play-yellow">
</a>
</p>

<p align="center">
Expand All @@ -33,6 +36,8 @@
- 🛠 **工具(插件)利用**: AgentVerse支持多智能体环境的工具。目前,AgentVerse支持[BMTools](https://github.com/OpenBMB/BMTools)中提供的工具。

## 📰 最新消息
- [2023/10/17] 我们很高兴来分享我们AI开源社区 hugging face: [`AgentVerse`](https://huggingface.co/spaces/AgentVerse/agentVerse). 在你提供openai API 密钥 and the openai 组织码之后,你可以体验NLP教室和囚徒困境两个模拟应用程序。祝你玩得开心!

- [2023/8/22] 📝 我们很高兴分享与此仓库相关的正在进行中的论文[AgentVerse: Facilitating Multi-Agent Collaboration and Exploring Emergent Behaviors in Agents](https://arxiv.org/abs/2308.10848).
<img width="616" alt="Screen Shot 2023-09-01 at 12 08 57 PM" src="https://github.com/OpenBMB/AgentVerse/assets/11704492/6db1c907-b7fc-42f9-946c-89853a28f386">

Expand Down Expand Up @@ -198,6 +203,11 @@ pip install -r requirements.txt
# 导出你的OpenAI API密钥
export OPENAI_API_KEY="your_api_key_here"
```
或者您想使用 Azure OpenAI 服务,请按照以下方式配置 OpenAI API 密钥和 API base:
```bash
export AZURE_OPENAI_API_KEY="your_api_key_here"
export AZURE_OPENAI_API_BASE="your_api_base_here"
```

如果您想使用BMTools提供的工具,您需要按如下方式安装BMTools:
```bash
Expand Down
5 changes: 1 addition & 4 deletions agentverse/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from .tasks import *


# from .agents import Agent
from .output_parser import output_parser_registry
from .environments import env_registry
from .environments.simulation_env.rules.order import order_registry
from .environments.simulation_env.rules.describer import describer_registry
Expand Down
1 change: 1 addition & 0 deletions agentverse/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .base import BaseAgent
from agentverse.agents.simulation_agent.conversation import ConversationAgent
from agentverse.agents.simulation_agent.tool import ToolAgent
from agentverse.agents.simulation_agent.reflection import ReflectionAgent
from agentverse.agents.simulation_agent.prisoner_dilemma import (
PoliceAgent,
PrisonerAgent,
Expand Down
32 changes: 28 additions & 4 deletions agentverse/agents/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
from string import Template

from pydantic import BaseModel, Field

from agentverse.llms import BaseLLM

from agentverse.logging import logger
from agentverse.llms.utils import count_string_tokens
from agentverse.memory import BaseMemory, ChatHistoryMemory
from agentverse.message import Message
from agentverse.parser import OutputParser
from agentverse.output_parser import OutputParser
from agentverse.memory_manipulator import BaseMemoryManipulator


Expand Down Expand Up @@ -48,12 +50,34 @@ def add_message_to_memory(self, messages: List[Message]) -> None:
"""Add a message to the memory"""
pass

def get_spend(self) -> float:
return self.llm.get_spend()

def get_spend_formatted(self) -> str:
two_trailing = f"${self.get_spend():.2f}"
if two_trailing == "$0.00":
return f"${self.get_spend():.6f}"
return two_trailing

def get_all_prompts(self, **kwargs):
prepend_prompt = Template(self.prepend_prompt_template).safe_substitute(
**kwargs
)
append_prompt = Template(self.append_prompt_template).safe_substitute(**kwargs)
return prepend_prompt, append_prompt

# TODO: self.llm.args.model is not generalizable
num_prepend_prompt_token = count_string_tokens(
prepend_prompt, self.llm.args.model
)
num_append_prompt_token = count_string_tokens(
append_prompt, self.llm.args.model
)

return (
prepend_prompt,
append_prompt,
num_prepend_prompt_token + num_append_prompt_token,
)

def get_receiver(self) -> Set[str]:
return self.receiver
Expand Down Expand Up @@ -83,7 +107,7 @@ def remove_receiver(self, receiver: Union[Set[str], str]) -> None:
try:
self.receiver.remove(receiver)
except KeyError as e:
logging.warning(f"Receiver {receiver} not found.")
logger.warn(f"Receiver {receiver} not found.")
elif isinstance(receiver, set):
self.receiver = self.receiver.difference(receiver)
else:
Expand Down
Empty file.
6 changes: 3 additions & 3 deletions agentverse/agents/simulation_agent/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

from agentverse.message import Message

#from . import agent_registry
#from .base import BaseAgent
# from . import agent_registry
# from .base import BaseAgent
from agentverse.agents import agent_registry
from agentverse.agents.base import BaseAgent

Expand Down Expand Up @@ -66,7 +66,7 @@ async def astep(self, env_description: str = "") -> Message:
raise
except Exception as e:
logger.error(e)
logger.warning("Retrying...")
logger.warn("Retrying...")
continue

if parsed_response is None:
Expand Down
18 changes: 9 additions & 9 deletions agentverse/agents/simulation_agent/prisoner_dilemma.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from __future__ import annotations

import logging
from string import Template
from typing import TYPE_CHECKING, List

from agentverse.message import Message
from agentverse.logging import logger

#from . import agent_registry
#from .base import BaseAgent
# from . import agent_registry
# from .base import BaseAgent
from agentverse.agents import agent_registry
from agentverse.agents.base import BaseAgent

Expand All @@ -30,12 +30,12 @@ def step(
parsed_response = self.output_parser.parse(self, environment, response)
break
except Exception as e:
logging.error(e)
logging.warning("Retrying...")
logger.error(e)
logger.warn("Retrying...")
continue

if parsed_response is None:
logging.error(f"{self.name} failed to generate valid response.")
logger.error(f"{self.name} failed to generate valid response.")

message = Message(
content=""
Expand All @@ -59,12 +59,12 @@ async def astep(
parsed_response = self.output_parser.parse(self, environment, response)
break
except Exception as e:
logging.error(e)
logging.warning("Retrying...")
logger.error(e)
logger.warn("Retrying...")
continue

if parsed_response is None:
logging.error(f"{self.name} failed to generate valid response.")
logger.error(f"{self.name} failed to generate valid response.")

message = Message(
content=""
Expand Down
2 changes: 1 addition & 1 deletion agentverse/agents/simulation_agent/reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from agentverse.llms import BaseLLM
from agentverse.memory import BaseMemory, ChatHistoryMemory
from agentverse.message import Message
from agentverse.parser import OutputParser
from agentverse.output_parser import OutputParser

from agentverse.message import Message
from agentverse.agents.base import BaseAgent
Expand Down
Loading