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

Issue with first launching pair (deprecated pydantic?) #11

Open
ascamara opened this issue Jul 19, 2023 · 0 comments
Open

Issue with first launching pair (deprecated pydantic?) #11

ascamara opened this issue Jul 19, 2023 · 0 comments

Comments

@ascamara
Copy link

I am running into an issue: I installed pair with pip and there appeared to be no problem. I try to launch (exporting the necessary variables) and then get this error, whether I try to open a pair or with a file. Can you please advise?

(pair) antonio @ ~/Documents/endorse $ pair 
Traceback (most recent call last):
  File "/Users/antonio/anaconda3/envs/pair/bin/pair", line 5, in <module>
    from pair_ai.pair import repl
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pair_ai/pair.py", line 4, in <module>
    from chatstack import ChatContext, UserMessage
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/__init__.py", line 2, in <module>
    from .chatstack import SystemMessage, ContextMessage, UserMessage, ChatRoleMessage, AssistantMessage, ChatContext
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/chatstack.py", line 14, in <module>
    class ChatRoleMessage(BaseModel):
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/chatstack.py", line 23, in ChatRoleMessage
    def compute_tokens(cls, values) -> int:
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py", line 222, in root_validator
    return root_validator()(*__args)  # type: ignore
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py", line 228, in root_validator
    raise PydanticUserError(
pydantic.errors.PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.


For further information visit https://errors.pydantic.dev/2.0.3/u/root-validator-pre-skip
(pair) antonio @ ~/Documents/endorse $ pair test.py 
Traceback (most recent call last):
  File "/Users/antonio/anaconda3/envs/pair/bin/pair", line 5, in <module>
    from pair_ai.pair import repl
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pair_ai/pair.py", line 4, in <module>
    from chatstack import ChatContext, UserMessage
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/__init__.py", line 2, in <module>
    from .chatstack import SystemMessage, ContextMessage, UserMessage, ChatRoleMessage, AssistantMessage, ChatContext
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/chatstack.py", line 14, in <module>
    class ChatRoleMessage(BaseModel):
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/chatstack.py", line 23, in ChatRoleMessage
    def compute_tokens(cls, values) -> int:
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py", line 222, in root_validator
    return root_validator()(*__args)  # type: ignore
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py", line 228, in root_validator
    raise PydanticUserError(
pydantic.errors.PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.

For further information visit https://errors.pydantic.dev/2.0.3/u/root-validator-pre-skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant