Find answers from the community

Updated last year

Demo

Hi all - I'm experimenting with Sub Question Query Engine as per https://gpt-index.readthedocs.io/en/latest/examples/query_engine/sub_question_query_engine.html. I've adapted the code to work with Vertex AI, but (Langchain LLMs/embedding). I'm struggling to make the demo work: SyntaxError: 'await' outside function caused by the line response = await query_engine.aquery(.... Any ideas what I'm doing wrong? Feels like this might be a really stupid question...
L
R
2 comments
This works in a notebook, but we should really update that example


Do response = query_engine.query(...)

And for extra speedup, make sure use_async=True is set in the engine definition
Thanks again Logan - that's done it.
Add a reply
Sign up and join the conversation on Discord