parkervg / blendsql

Query language for blending SQL logic and LLM reasoning across structured + unstructured data. [Findings of ACL 2024]
https://parkervg.github.io/blendsql/
Apache License 2.0
72 stars 4 forks source link

`options` Accepts Query #4

Closed parkervg closed 8 months ago

parkervg commented 8 months ago

Did a little rework so that the options argument can be one of 3 things:

For example, the following is now possible:

SELECT DISTINCT merchant FROM transactions WHERE
merchant = {{
    LLMQA(
        'Which merchant is most likely to sell italian food?',
        (SELECT merchant FROM transactions),
        options=(SELECT merchant FROM transactions WHERE amount > 100)
    )
}}

The selected merchant will now be restricted to the subset where amount > 100.

I added test_query_options_arg in test_single_table_blendsql.py for this change.