just like this
@graph_app.post("/query_router")
async def query_router(query: str = Form()):
query_engine_tools = generate_query_engine_tools(indexes)
query_engine = RouterQueryEngine(
selector=PydanticMultiSelector.from_defaults(),
query_engine_tools=query_engine_tools,
)
customer_logger.info(f"query_router: {query}")
res = query_engine.query(query)
customer_logger.info(f"res: {res}")
return StreamingResponse(res.response_gen, media_type="text/plain")
Customer - INFO - query_router: what is cuit
INFO: 127.0.0.1:64532 - "POST /graph/query_router HTTP/1.1" 200 OK
Customer INFO - res: 's main governing body for the college of atmospheric science?,When I query, it completes the query, and it also generates the completed content into res