πŸ“„ Get SqlΒΆ

processors.text2sql.get_sql

SequentialOperator(
    steps=[
        GetSQL(
            field="prediction",
        ),
    ],
)
[source]

from unitxt.processors import GetSQL

Explanation about SequentialOperatorΒΆ

A class representing a sequential operator in the streaming system.

A sequential operator is a type of MultiStreamOperator that applies a sequence of other operators to a MultiStream. It maintains a list of StreamingOperator`s and applies them in order to the `MultiStream.

Explanation about GetSQLΒΆ

Operator to extract the most likely SQL query from text, often generated by language models.

It prioritizes SQL within markdown code blocks (`sql or `) and defaults to finding the last SELECT statement in the text if no code blocks are found. It attempts to remove trailing text after the first semicolon in the identified query.

Read more about catalog usage here.