Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: silence pydantic warning about protected namespace #1116

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

cpacker
Copy link
Owner

@cpacker cpacker commented Mar 8, 2024

@sarahwooders we probably want to change the fields to not start with model_, but this works for now

Based on instructions here: https://docs.pydantic.dev/latest/api/config/#pydantic.config.ConfigDict.protected_namespaces

Warning in reference in this:

$ memgpt server

/Users/loaner/Library/Caches/pypoetry/virtualenvs/pymemgpt-PCQPn4ce-py3.10/lib/python3.10/site-packages/pydantic/_internal/_fields.py:151: UserWarning: Field "model_endpoint_type" has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
  warnings.warn(
/Users/loaner/Library/Caches/pypoetry/virtualenvs/pymemgpt-PCQPn4ce-py3.10/lib/python3.10/site-packages/pydantic/_internal/_fields.py:151: UserWarning: Field "model_endpoint" has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
  warnings.warn(
/Users/loaner/Library/Caches/pypoetry/virtualenvs/pymemgpt-PCQPn4ce-py3.10/lib/python3.10/site-packages/pydantic/_internal/_fields.py:151: UserWarning: Field "model_wrapper" has conflict with protected namespace "model_".

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

Copy link
Collaborator

@sarahwooders sarahwooders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@sarahwooders sarahwooders merged commit 435ac90 into main Mar 8, 2024
5 checks passed
@sarahwooders sarahwooders deleted the tools-api-provide-tag branch March 8, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants