langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
92.26k stars 14.73k forks source link

autonomous_agents : poetry run mypy . with experimental fails with langchain version 0.0.278 #10088

Closed pprados closed 12 months ago

pprados commented 1 year ago

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

 poetry run mypy .

Expected behavior

No error

dosubot[bot] commented 1 year 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

Sources


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.

pprados commented 1 year ago

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
pprados commented 12 months ago

It's fixed