Trying to fix this:
@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:
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 =====================