Skip to content

Commit

Permalink
fix: import error in alice home task #76
Browse files Browse the repository at this point in the history
  • Loading branch information
chenweize1998 committed Oct 23, 2023
1 parent dc0921b commit 5fab7fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
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
1 change: 1 addition & 0 deletions agentverse/environments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# from .basic import PipelineEnvironment
from .simulation_env.basic import BasicEnvironment
from .simulation_env.reflection import ReflectionEnvironment
from .simulation_env.pokemon import PokemonEnvironment
from .simulation_env.prisoner_dilemma import PrisonerDilemmaEnvironment
from .simulation_env.sde_team import SdeTeamEnvironment
Expand Down
9 changes: 5 additions & 4 deletions agentverse/environments/simulation_env/reflection.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import asyncio
import logging
from typing import Any, Dict, List

from datetime import datetime as dt
import datetime

from pydantic import Field

from agentverse.logging import logger
from agentverse.environments import env_registry as EnvironmentRegistry
from agentverse.agents.simulation_agent.conversation import BaseAgent

# from agentverse.environments.simulation_env.rules.base import Rule
from agentverse.environments.simulation_env.rules.base import SimulationRule as Rule
from agentverse.message import Message

from . import env_registry as EnvironmentRegistry
# from . import env_registry as EnvironmentRegistry
from ..base import BaseEnvironment

from pydantic import validator
Expand Down Expand Up @@ -70,7 +71,7 @@ def __init__(self, rule, **kwargs):
async def step(self) -> List[Message]:
"""Run one step of the environment"""

logging.log(logging.INFO, f"Tick tock. Current time: {self.current_time}")
logger.info(f"Tick tock. Current time: {self.current_time}")

# Get the next agent index
agent_ids = self.rule.get_next_agent_idx(self)
Expand Down Expand Up @@ -107,7 +108,7 @@ async def step(self) -> List[Message]:
def print_messages(self, messages: List[Message]) -> None:
for message in messages:
if message is not None:
logging.info(f"{message.sender}: {message.content}")
logger.info(f"{message.sender}: {message.content}")

def reset(self) -> None:
"""Reset the environment"""
Expand Down

0 comments on commit 5fab7fc

Please sign in to comment.