Open torvalds-dev opened 7 months ago
torvalds.dev is analyzing the ticket
torvalds.dev is analyzing the ticket
The issue you're facing is a TypeError
when trying to import the RetrieverQueryEngine
from llama_index.query_engine
. The error occurs when the aiostream
package is being imported somewhere in the call stack. The specific line causing the error is class OperatorType(Protocol[P, T]):
where P
and T
are ParamSpecs
.
The error message TypeError: Parameters to Protocol[...] must all be type variables
suggests that the parameters provided to the Protocol
are not all type variables, which is a requirement.
The traceback shows that the error originates from the aiostream
package, specifically from the core.py
file. This suggests that the issue might be with the aiostream
package itself, or how it's being used within the llama_index
package.
The user has tried installing different versions of typing-extensions
but it didn't resolve the issue. This suggests that the problem might not be related to the typing-extensions
package.
The relevant files to this issue are:
llama_index/query_engine/__init__.py
: This file imports the RetrieverQueryEngine
which is causing the error when imported.
llama_index/retrievers/__init__.py
: This file might be relevant as it could be importing or using the aiostream
package that's causing the error.
To address this issue, the following actions could be taken:
Check the version of aiostream
package installed and try updating or downgrading it.
Check if aiostream
package has any known issues with Python 3.9.16.
Review the usage of aiostream
within the llama_index
package to ensure it's being used correctly.
If the issue persists, consider reaching out to the maintainers of aiostream
or llama_index
with a detailed bug report.
Bug Description
Python: 3.9.16
This is the lowest level failure of importing a class from llama_index that depends on import from aiostream somwhere down the call stack. The offending line is class OperatorType(Protocol[P, T]): where P and T are ParamSpecs
I tried installing the different versions of typing-extentions but that does not change anything.
Expected behavior: imports without TypeError
Version
0.9.8.post1
Steps to Reproduce
from llama_index.query_engine import RetrieverQueryEngine
Relevant Logs/Tracbacks