Farama-Foundation / chatarena

ChatArena (or Chat Arena) is a Multi-Agent Language Game Environments for LLMs. The goal is to develop communication and collaboration capabilities of AIs.
Apache License 2.0
1.33k stars 129 forks source link

Optional dependencies required even for environments which do not use them #58

Closed elliottower closed 10 months ago

elliottower commented 1 year ago

I believe this is a problem with the init.py importing all of the sub-environments at the same time, meaning that to import one environment you need the modules to import all of them. For example, for the Umshini environments all you need is PettingZoo with no optional dependencies, but for the PettingZoo chess example you need pettingzoo[classic].

Simplest solution would be to have PettingZoo be a core requirement, if all environments importing will require that same init file which import them (https://github.com/chatarena/chatarena/blob/fa6b374bb62fa7070454962eec6a9c88bc584d63/chatarena/environments/__init__.py#L4), otherwise the init could be changed and they could be put in separate subfolders perhaps? I put the umshini environments in a separate folder as I wanted it to be clear that they are separate and don't require the same dependencies.

An alternative is to put the existing environments into a new directory called core or something like that? That would break backwards compatibility though, as it would require people to do from chatarena.environments.core import PettingZooChess or something. But it's probably good to categorize the environments in the long run if there are going to be others added.

elliottower commented 10 months ago

This has been solved