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

[BUG]: Reinitialized agents #84

Closed
XuhuiZhou opened this issue May 31, 2024 · 4 comments
Closed

[BUG]: Reinitialized agents #84

XuhuiZhou opened this issue May 31, 2024 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@XuhuiZhou
Copy link
Member

Description of the bug

The agents have been reinitialized here, which is a problematic behavior since the agents have been initialized before:

for agent_name, agent_model in zip(env.agents, agents_model_names):

Steps To Reproduce

Just need to look at it

Additional Information

No response

@XuhuiZhou XuhuiZhou added the bug Something isn't working label May 31, 2024
@XuhuiZhou
Copy link
Member Author

@ProKil

I am proposing removing these lines:

    agents_model_names = [model_dict["agent1"], model_dict["agent2"]]
    for agent_name, agent_model in zip(env.agents, agents_model_names):
        if agent_model == "human":
            agents[agent_name] = HumanAgent(agent_name)
        elif agent_model == "redis":
            agents[agent_name] = RedisAgent(agent_name)
        elif script_like and not json_in_script:
            agents[agent_name] = ScriptWritingAgent(
                agent_name,
                model_name=agent_model,
                background=env.background,
                agent_names=env.agents,
            )
        else:
            agents[agent_name] = LLMAgent(
                agent_name, model_name=agent_model, script_like=script_like
            )

@ProKil
Copy link
Member

ProKil commented Jun 1, 2024

Yes.

More generally, we can modularize the server behavior:

  1. EnvironmentAgentCombo comes with initialized agents and environments, which will not be initialized for the second time in the server,
  2. A static class method EnvironmentAgentCombo.new() returns a new EnvironmentAgentCombo which takes a configuration object as input and initialize the agents and the environment.

@XuhuiZhou
Copy link
Member Author

Not sure if I understand the 2 point. But here's the branch for the purpose of making Sotopia more organic for other applications. #86

@ProKil ProKil added this to the 0.2.0 Release milestone Jun 2, 2024
@ProKil
Copy link
Member

ProKil commented Jun 19, 2024

Has this already been solved in #69 ?

@ProKil ProKil closed this as completed Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants