Find answers from the community

Updated 3 months ago

Trying to fix this:

Trying to fix this:

Plain Text
@app.post("/query")
def query(query: str = Body(..., embed=True)):
    response = composable_graph.search(query)
    return {"response": response.response}

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)


Getting this:

Plain Text
        if not self.create and original is DEFAULT:
>           raise AttributeError(
                "%s does not have the attribute %r" % (target, name)
            )
E           AttributeError: <llama_index.core.indices.composability.graph.ComposableGraph object at 0x7fce4d9bbd60> does not have the attribute 'search'

/usr/local/python/3.10.13/lib/python3.10/unittest/mock.py:1420: AttributeError
================================ warnings summary ================================
tests.py::test_ingest
  /home/codespace/.local/lib/python3.10/site-packages/httpx/_client.py:680: DeprecationWarning: The 'app' shortcut is now deprecated. Use the explicit style 'transport=WSGITransport(app=...)' instead.
    warnings.warn(message, DeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================ short test summary info =============================
FAILED tests.py::test_query - AttributeError: <llama_index.core.indices.composability.graph.ComposableGraph...
===================== 1 failed, 1 passed, 1 warning in 3.51s =====================
L
L
10 comments
composable graph is low-key deprecated lol (so docs got phased out)

It seems like you are calling composable_graph.search() which is not a function

Normally you'd do composable_graph.as_query_engine().query()
Do you have any suggestions on what to use instead?
I I'd rather use the up to date tooling haha
Depends I suppose. What are you using the graph for now?
Welp. Uhhh because Mistral told me to :3.
The goal is to make a general Q&A tool on data from tools from LlamaHub such as Salesforce, Slack, and GraphQL. What I've got is a chrome extension called Bloom that I'm trying to set up to allow people to ingest data from any source, and ask questions for GTM research.
Disclosure: I'm new to the whole RAG thing, but I have autistic pattern recog so I've been trying to get by with just putting things together haha. But the docs issue has been making it tough 😭 .
Sounds like you should use an agent then? πŸ‘€
Add a reply
Sign up and join the conversation on Discord