Closed pprados closed 12 months ago
🤖
Hello,
Thank you for reaching out. I understand you're having issues with mypy when trying to update the LangChain dependencies to version 0.0.278 in your experimental project.
Unfortunately, without the specific error messages, it's difficult to diagnose the exact issue. However, I can provide some general advice that might help.
Firstly, please ensure that all the dependencies of LangChain version 0.0.278 are correctly installed and are compatible with each other. You can find the list of dependencies in the pyproject.toml
file in the LangChain repository.
Secondly, it's possible that the mypy errors are due to type hinting issues in the LangChain code or in your own code. You might want to check the type hints in your code and ensure they are compatible with the types expected by the LangChain functions you are using.
Lastly, it's also possible that the issue is due to some changes made in LangChain version 0.0.278. Unfortunately, without more information, I can't provide specific advice on this. However, you might want to check the commit history of the LangChain repository to see what changes were made in this version.
If none of these suggestions help, could you please provide more information about the specific mypy errors you are encountering? This would greatly help in diagnosing and resolving the issue.
Best regards, Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
To reproduce this bug:
git checkout
cd /libs/experimental
make lint
Result
poetry run mypy .
langchain_experimental/cpal/models.py:142: error: No overload variant of "root_validator" matches argument type "Callable[[StoryModel, Dict[Any, Any]], Dict[Any, Any]]" [call-overload]
langchain_experimental/cpal/models.py:142: note: Possible overload variants:
langchain_experimental/cpal/models.py:142: note: def root_validator(*, skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/cpal/models.py:142: note: def root_validator(*, pre: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/cpal/models.py:142: note: def root_validator(*, pre: Literal[False], skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/smart_llm/base.py:86: error: No overload variant of "root_validator" matches argument type "Callable[[Type[SmartLLMChain], Dict[str, Any]], Dict[str, Any]]" [call-overload]
langchain_experimental/smart_llm/base.py:86: note: Possible overload variants:
langchain_experimental/smart_llm/base.py:86: note: def root_validator(*, skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/smart_llm/base.py:86: note: def root_validator(*, pre: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/smart_llm/base.py:86: note: def root_validator(*, pre: Literal[False], skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/llms/rellm_decoder.py:42: error: No overload variant of "root_validator" matches argument type "Callable[[RELLM, Dict[Any, Any]], Dict[Any, Any]]" [call-overload]
langchain_experimental/llms/rellm_decoder.py:42: note: Possible overload variants:
langchain_experimental/llms/rellm_decoder.py:42: note: def root_validator(*, skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/llms/rellm_decoder.py:42: note: def root_validator(*, pre: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/llms/rellm_decoder.py:42: note: def root_validator(*, pre: Literal[False], skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/llms/jsonformer_decoder.py:40: error: No overload variant of "root_validator" matches argument type "Callable[[JsonFormer, Dict[Any, Any]], Dict[Any, Any]]" [call-overload]
langchain_experimental/llms/jsonformer_decoder.py:40: note: Possible overload variants:
langchain_experimental/llms/jsonformer_decoder.py:40: note: def root_validator(*, skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/llms/jsonformer_decoder.py:40: note: def root_validator(*, pre: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/llms/jsonformer_decoder.py:40: note: def root_validator(*, pre: Literal[False], skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType]
langchain_experimental/autonomous_agents/baby_agi/baby_agi.py:22: error: Definition of "__private_attributes__" in base class "BaseModel" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/baby_agi/baby_agi.py:22: error: Definition of "__repr_str__" in base class "Representation" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/baby_agi/baby_agi.py:22: error: Definition of "__rich_repr__" in base class "Representation" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/baby_agi/baby_agi.py:22: error: Definition of "__repr_name__" in base class "Representation" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/baby_agi/baby_agi.py:22: error: Definition of "__pretty__" in base class "Representation" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/baby_agi/baby_agi.py:22: error: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases [misc]
langchain_experimental/autonomous_agents/autogpt/prompt.py:15: error: Definition of "__private_attributes__" in base class "BaseModel" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/autogpt/prompt.py:15: error: Definition of "__repr_str__" in base class "Representation" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/autogpt/prompt.py:15: error: Definition of "__rich_repr__" in base class "Representation" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/autogpt/prompt.py:15: error: Definition of "__repr_name__" in base class "Representation" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/autogpt/prompt.py:15: error: Definition of "__pretty__" in base class "Representation" is incompatible with definition in base class "BaseModel" [misc]
langchain_experimental/autonomous_agents/autogpt/prompt.py:15: error: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases [misc]
Found 16 errors in 6 files (checked 128 source files)
make: *** [Makefile:32 : lint] Erreur 1
It's fixed
System Info
langchain 0.0.278.
I try to publish a pull request in the project experimental. I must update the dependencies of langchain, but I receive a lot of errors. See here, outside of my code.
Who can help?
@hwchase17
Information
Related Components
Reproduction
In the libs/experimental/pyproject.toml, change: langchain = ">=0.0.278"
then
Expected behavior
No error