Find answers from the community

Updated 6 months ago

Where do you get/import the correct type

At a glance

The community member is having trouble importing the correct type for QueryType from the llama_index.schema module and is getting an error that QueryType is an unknown import symbol. The community members discuss that QueryType is a union of QueryBundle and str, and that the community member ended up using str instead because the LSP (Language Server Protocol) was complaining. The community member also mentions that they are using FastAPI.

Where do you get/import the correct type for QueryType?

Plain Text
from llama_index.schema import QueryType


I get the error

Plain Text
"QueryType" is unknown import symbol (reportGeneralTypeIssues)


Obs: I'm definitely not a Python developer, but Python is quite approachable
L
P
4 comments
Why do you need this? πŸ‘€ QueryType is just a union of QueryBundle and str
@Logan M The LSP was complaining. But end up making it str.
That is because I'm using fastapi
ah I see I see
Add a reply
Sign up and join the conversation on Discord