-
Notifications
You must be signed in to change notification settings - Fork 80
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
update: llamaindex_conversable_agent.py #130
base: main
Are you sure you want to change the base?
Conversation
Hey @lazToum! Thanks for putting these PRs through. Are you on Discord? If so can you connect to me, |
Hi @marklysze, sure, it's laztoum at discord. I have already signed one that Qingyun Wu sent me. |
else: | ||
|
||
class Config: | ||
arbitrary_types_allowed = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lazToum...
Can we provide a stricter comparison rather than directly with a string (e.g. 11.0 won't be greater 2.0):
from packaging import version
from pydantic import __version__ as pydantic_version
# This will correctly handle all future versions including v11+
if version.parse(pydantic_version) >= version.parse("2.0.0"):
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I tried to change my pydantic version to a lower version and it had an issue with llama index. I think it's because BeforeValidator isn't available in older versions of pydantic and the current llamaindex libraries use it.
For llamaindex do you think it would be better to force a minimum version of 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this sounds good. Ideally, pydantic >=2 should be in the whole project, but I don't know if this is feasible (haven't checked all the extras).
Why are these changes needed?
If using pydantic > 2, we get
AttributeError: type object 'Config' has no attribute 'copy'
A simple check is added to avoid this.
Related issue number
Checks