sotopia-lab / sotopia

Sotopia: an Open-ended Social Learning Environment (ICLR 2024 spotlight)
https://docs.sotopia.world
MIT License
164 stars 20 forks source link

fix empty background issue #27

Closed bugsz closed 8 months ago

bugsz commented 9 months ago

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

ℹ Additional Information

bugsz commented 9 months ago

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 https://github.com/sotopia-lab/sotopia/blob/eac12c8cf34b1e8bc52a22ad81e2a3843ca12885/tests/renderers/test_xml_renderer.py#L90-L97

ProKil commented 9 months ago

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

bugsz commented 9 months ago

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 commented 9 months ago

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

bugsz commented 9 months ago

@ProKil Here is the updated test case. https://github.com/sotopia-lab/sotopia/blob/fd6700a889548b003b316857fff60f1d6e4577f7/tests/renderers/test_xml_renderer.py#L64-L99