sotopia-lab / sotopia

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

[FEAT]: Use pydantic validate call instead of beartype #115

Open ProKil opened 2 weeks ago

ProKil commented 2 weeks ago

Description

Due to the unstable status of beartype, we could use Pydantic's function call validation feature.

In theory, this could be:

  1. more powerful, since we can also use the various features like before/after validator of pydantic etc.
  2. less performant, since beartype is claimed to be O(1).

However, if we only use this in the APIs to, the overhead could be minimal as the performance of the pydantic increases, and we have already heavily used it anyway.

This is an experimental feature, which will not be a part of v0.1, but could be part of v0.2

Additional Information

No response

lwaekfjlk commented 1 week ago

may I ask what is the instability within beartype?

ProKil commented 1 week ago

It is stable performance-wise, but unstable api-wise.