mail-ecnu / Text-Gym-Agents

This project provides a set of translators to convert OpenAI Gym environments into text-based environments. It is designed to investigate the capabilities of large language models in decision-making tasks within these text-based environments.
https://huggingface.co/spaces/MAIL-CS-ECNU/Text-Gym-Agents
Apache License 2.0
15 stars 2 forks source link

Usage Error of validator, field, config, and info in Pydantic V2 when running test_reflexion.sh #2

Closed ziyuwan closed 11 months ago

ziyuwan commented 11 months ago

Hi, I'm trying to run the testing scripts of test_reflexion.sh and I got the following error:

llm-gym/lib/python3.8/site-packages/pydantic/_internal/_decorators_v1.py", line 77, in make_generic_v1_field_validator
    raise PydanticUserError(
pydantic.errors.PydanticUserError: The `field` and `config` parameters are not available in Pydantic V2, please use the `info` parameter instead.

And on the doc of pydantic, there is also some description about the usage errors in Version 2:

The field argument is no longer available.

This indicates that in Pydantic V2 there are no longer field parameter, which is used in the code like here

however, when I check the environment.yml again, I find the required version is pydantic==2.3.0, pydantic-core==2.6.3 and I've got the above PydanticUserError with the required versions.

Therefore, is there any mistakes I've made during the environment setup or should I change the version of pydantic to V1?

ziyuwan commented 11 months ago

I've found an official code transformation tool here, which is helpful for migration from v1 to v2

hzxwonder commented 11 months ago

Hello, sorry about that, the new environment.yaml has fixed the problem by downgrading the version of pydantic to 1.10.11 at PR#3

ziyuwan commented 11 months ago

ok, thanks for your help! I'll close this issue