SQL template

Updated at:

If the SQL that Chatbot automatically generates does not accurately match a user's query, you can create an SQL template. This lets you manually map the question to the correct SQL logic for precise control and improved response accuracy.

Access

Important

As of January 2, 2025, you can no longer configure SQL templates in Chatbot.

In your Chatbot workspace, go to Table Management > SQL Template to access the SQL template management page.

image

Manage SQL templates

Create an SQL template

On the SQL template management page, click New SQL Template to create an SQL template.

  • Intervention table: The data table to be queried for the user question.

  • User question: The user's original question.

  • SQL statement: The SQL statement that corresponds to the user's question.

    Note

    For guidelines on how to write SQL statements, see SQL Statement Examples.

  • Similar questions: Alternative phrasings of the user question.

    image

Configure SQL template status

New SQL templates are enabled by default. To disable a template, click the Enabled toggle.

image

Delete an SQL template

On the SQL template management page, click Delete next to the template you want to remove, and then confirm the action.

image