hsahovic / poke-env

A python interface for training Reinforcement Learning bots to battle on pokemon showdown
https://poke-env.readthedocs.io/
MIT License
293 stars 98 forks source link

Exposing the battle logs in the Battle object to support LLM agents. #502

Closed SirSkaro closed 4 months ago

SirSkaro commented 7 months ago

I've noticed there have been a few attempts to create LLM agents using this poke-env. A more recent one is PokeLLMon. However, in their project (not saying I condone this at all), they literally copy/pasted all of poke-env to modify Player to get access to the Showdown message.

A more appropriate, less drastic approach would be to extend Player and override _handle_battle_message (or some other internal function), but this obviously isn't ideal either because you're overriding an internal function.

So this is a feature request is to add the raw Showdown message to the Battle object (the battle_info or split_messages data in Player#_handle_battle_message) to better support LLM agents.

caymansimpson commented 5 months ago

Nice, was going to ask for this one as well. @hsahovic is there any way you'd like to do this? I was thinking about just adding a flag that stores all unparsed logs in a vector of strings as a property of the battle object

caymansimpson commented 4 months ago

This is submitted in the new PR. You can check out the new battle.observations property. Battle Logs are stored in the events property of each Observation object

hsahovic commented 4 months ago

Thanks @caymansimpson !