togethercomputer / together-python

The Official Python Client for Together's API
https://pypi.org/project/together/
Apache License 2.0
33 stars 8 forks source link

Exception raised when trying to get list of models #176

Closed kumaranvpl closed 2 months ago

kumaranvpl commented 2 months ago

Describe the bug When trying to get list of models, it raises the following pydantic exception:

return [ModelObject(**model) for model in response.data]
E   pydantic_core._pydantic_core.ValidationError: 1 validation error for ModelObject
E   type
E     Input should be 'chat', 'language', 'code', 'image', 'embedding' or 'moderation' [type=enum, input_value='rerank', input_type=str]

I believe this is happening because in the recent release some changes are not included, especially this one - https://github.com/togethercomputer/together-python/blob/main/src/together/types/models.py#L17. So please make a new release for the recent code changes.

To Reproduce Run the following piece of code:

from together import Together
client = Together()
print(client.models.list())

Expected behavior This code should run without exceptions

### Tasks
orangetin commented 2 months ago

fixed in #174 . please upgrade to v1.2.9 of the library! https://pypi.org/project/together/1.2.9/