elevenlabs-python icon indicating copy to clipboard operation
elevenlabs-python copied to clipboard

Eleven Labs and Pydantic issue

Open Chandrakanth-AIGenMedia opened this issue 1 year ago • 4 comments

UserWarning: Valid config keys have changed in V2:

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

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

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

Chandrakanth-AIGenMedia avatar Jul 30 '24 11:07 Chandrakanth-AIGenMedia

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

horizon0708 avatar Jul 31 '24 08:07 horizon0708

Okay, I will give it a try.

Chandrakanth-AIGenMedia avatar Aug 01 '24 05:08 Chandrakanth-AIGenMedia

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

They are warnings - why would you downgrade?

C0rn3j avatar Aug 02 '24 13:08 C0rn3j

@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.

horizon0708 avatar Aug 08 '24 02:08 horizon0708

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)

PvanHengel avatar Sep 08 '24 11:09 PvanHengel

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

Chandrakanth-AIGenMedia avatar Sep 08 '24 13:09 Chandrakanth-AIGenMedia

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

dsinghvi avatar Oct 02 '24 11:10 dsinghvi