elevenlabs / elevenlabs-python

The official Python API for ElevenLabs Text to Speech.
https://elevenlabs.io/docs/api-reference/getting-started
MIT License
2.18k stars 251 forks source link

Eleven Labs and Pydantic issue #334

Closed Chandrakanth-AIGenMedia closed 1 month ago

Chandrakanth-AIGenMedia commented 3 months ago

UserWarning: Valid config keys have changed in V2:

lib/python3.11/site-packages/pydantic/_internal/_fields.py:127: UserWarning: Field "modelid" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = (). warnings.warn(

horizon0708 commented 3 months ago

Looks like it was introduced in 1.6.0.

For now, I've downgraded my elevenlabs package to 1.5.0 with

pip install --force-reinstall elevenlabs==1.5.0
Chandrakanth-AIGenMedia commented 3 months ago

Okay, I will give it a try.

C0rn3j commented 3 months ago

More info about the _model protected namespace - https://github.com/pydantic/pydantic/discussions/7121

They are warnings - why would you downgrade?

horizon0708 commented 2 months ago

@C0rn3j correct me if I'm wrong (I'm a Python newbie), but wouldn't that need to be set in this package?

They are warnings - why would you downgrade?

At the time I was using it, I had a CLI POC app and the warnings were getting a bit annoying.

PvanHengel commented 1 month ago

I'm seeing these warnings as well, whats the plan to resolve?

* 'allow_population_by_field_name' has been renamed to 'populate_by_name'
* 'smart_union' has been removed
  warnings.warn(message, UserWarning)

UserWarning: Field "model_id" in SpeechHistoryItemResponse has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.

UserWarning: Field "model_id" in Model has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.

Using latest SDK (1.7.0 + pydantic latest as well 2.9.0)

Chandrakanth-AIGenMedia commented 1 month ago

I'm seeing these warnings as well, whats the plan to resolve?

* 'allow_population_by_field_name' has been renamed to 'populate_by_name'
* 'smart_union' has been removed
  warnings.warn(message, UserWarning)

UserWarning: Field "model_id" in SpeechHistoryItemResponse has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.

UserWarning: Field "model_id" in Model has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.

Using latest SDK (1.7.0 + pydantic latest as well 2.9.0)

The one that worked is to downgrade the package as stated by @horizon0708

dsinghvi commented 1 month ago

@Chandrakanth-AIGenMedia these warnings should now be fixed on the latest SDK