Find answers from the community

Updated 2 months ago

Hello everyone!

Hello everyone!

Does anyone have any suggestions on how to resolve this error? I'm trying to enable my Discord bot to access a vector index in Qdrant and respond to questions about it.

Plain Text
async def process_with_llm(query):
    query_engine_tools = [
        QueryEngineTool(
            query_engine=index,
            metadata=ToolMetadata(
                name="charlie_munger",
                description=(
                    "Provides information about Charlie Munger. "
                    "Use a detailed plain text question as input to the tool."
                ),
            ),
        ),
    ]

    agent = OpenAIAgent.from_tools(query_engine_tools, verbose=True)
    response = agent.query(query)

    return response


Plain Text
Got output: Error: 'VectorStoreIndex' object has no attribute 'query'
L
D
5 comments
query_engine=index, --> query_engine=index.as_query_engine()
Thank you, @Logan M, it works πŸ™. Do you have any suggestions that would allow me to avoid bothering you and solve these problems by myself? I tried using the documentation, but it seems not enough.
No worries about bothering me, its what I am around for πŸ™‚
I do know that mendable on our docs has gotten a bit better (the bottom right icon in the docs page)
Thank you so much; it seems helpful.
Add a reply
Sign up and join the conversation on Discord