Find answers from the community

Updated last year

Output

At a glance
Router Query Engine will output the completed query to the response, is that my problem?
L
C
2 comments
I'm not sure what you mean here. Do you have an example?
just like this
Plain Text
@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
Add a reply
Sign up and join the conversation on Discord