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

fix empty background issue #27

Merged
merged 2 commits into from
Mar 4, 2024
Merged

fix empty background issue #27

merged 2 commits into from
Mar 4, 2024

Conversation

bugsz
Copy link
Contributor

@bugsz bugsz commented Feb 4, 2024

Closes #24

📑 Description

Since in stranger relations the other's background is not visible, using and will wipe out all backgrounds. So we use or instead.
@XuhuiZhou Here is the fix. I will run experiments later and we can merge after it behaves correctly

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed
  • Branch name follows type/descript (e.g. feature/add-llm-agents)
  • Ready for code review

ℹ Additional Information

@bugsz
Copy link
Contributor Author

bugsz commented Feb 4, 2024

I think there are some conflicts with previous expectations?
In text_xml_renderer.py it seems that we are expecting backgrounds to be empty. Maybe we should also change that?
@ProKil @XuhuiZhou What do you think?
Here is the code

print(obs["John"].last_turn)
assert (
obs["John"].last_turn == "Here is the context of this interaction:\n"
"Scenario: test\n"
"Participants: John and Jane\n"
"John's goal: agent_1's goal\n"
"Jane's goal: Unknown"
)

@ProKil
Copy link
Member

ProKil commented Feb 4, 2024

@bugsz Thanks for your contribution. Can you describe the test case and what your expected outputs are?

@bugsz
Copy link
Contributor Author

bugsz commented Feb 4, 2024

I think what Xuhui wants is to make the speaker background visible while the listener invisible?
For example, in the test cases above, in which john and jane are strangers, we might want the following output

obs["John"].last_turn == "Here is the context of this interaction:\n" 
     "Scenario: test\n"
     "Participants: John and Jane\n" 
     "John's background: this is a background"
     "Jane's background: unknown"
     "John's goal: agent_1's goal\n" 
     "Jane's goal: Unknown"

@ProKil
Copy link
Member

ProKil commented Feb 5, 2024

@bugsz that makes sense. Would you mind updating that test case and reply me with a link to it?

@bugsz
Copy link
Contributor Author

bugsz commented Feb 5, 2024

@ProKil Here is the updated test case.

def test_renderer_in_env() -> None:
env = ParallelSotopiaEnv(
env_profile=EnvironmentProfile(
scenario="test",
agent_goals=["agent_1's goal", "agent_2's goal"],
)
)
agents = Agents(
{
"John": BaseAgent(
agent_profile=AgentProfile(
first_name="John",
last_name="Doe",
)
),
"Jane": BaseAgent(
agent_profile=AgentProfile(
first_name="Jane",
last_name="Doe",
)
),
}
)
obs = env.reset(agents=agents)
print(obs["John"].last_turn)
assert (
obs["John"].last_turn == "Here is the context of this interaction:\n"
"Scenario: test\n"
"Participants: John and Jane\n"
"John's background: John Doe is a 0-year-old . pronouns. Personality and values description: John's secrets: \n"
"Jane's background: Unknown\n"
"John's goal: agent_1's goal\n"
"Jane's goal: Unknown"
)

@ProKil ProKil merged commit f3e849c into main Mar 4, 2024
3 checks passed
@ProKil ProKil deleted the bug/missing_background branch March 11, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: potential buggy behavior in script background
2 participants