run-llama / llama_index

LlamaIndex is a data framework for your LLM applications
https://docs.llamaindex.ai
MIT License
36.69k stars 5.26k forks source link

[Bug]: markdown_response doesn't work for BaseSQLTableQueryEngine async calls #16720

Open pesua opened 2 weeks ago

pesua commented 2 weeks ago

Bug Description

If I create NLSQLTableQueryEngine(synthesize_response=False, markdown_response=True) Then query() method will return markdown while the aquery() will return a string of tuples.

Version

0.11.17

Steps to Reproduce

engine = NLSQLTableQueryEngine(
            synthesize_response=False,
            markdown_response=True,
            ...
        )

engine.query() gives a proper markdown and await engine.aquery() gives string of touples

Relevant Logs/Tracbacks

No response

dosubot[bot] commented 2 weeks ago

Hello @pesua! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve the issue you're facing.

The issue you're encountering seems to be related to the handling of the markdown_response parameter in the asynchronous aquery() method of the NLSQLTableQueryEngine class. While the query() method correctly formats the response as markdown, the aquery() method returns a string of tuples instead.

This discrepancy suggests that the markdown_response parameter might not be properly implemented or handled in the acustom_query() method, which is used by aquery(). It would be beneficial to review the implementation of acustom_query() to ensure that it formats the response as markdown when markdown_response=True is set.

If this behavior is unintended, it might require a code update to align the behavior of aquery() with query() regarding markdown formatting.

To continue talking to Dosu, mention @dosu.