Package com.xebialabs.xlrelease.api.v1

# Interface Nl2SqlApi

All Superinterfaces:
  `ApiService`

@Path("/api/v1/nl2sql") @Produces("application/json") @Consumes("application/json") public interface Nl2SqlApi extends ApiService
NL-to-SQL pipeline: schema classification and semantic-model-driven query execution.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `SERVICE_NAME`

  ### Fields inherited from interface com.xebialabs.xlrelease.api.ApiService

  `DEFAULT_RESULTS_PER_PAGE, DEFAULT_RESULTS_PER_PAGE_STRING, DEPTH, ORDER_BY, PAGE, PAGE_IS_OFFSET, RESULTS_PER_PAGE, ROLE_IDS_DATA`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Nl2SqlExecuteResult`
  `execute(Nl2SqlExecuteRequest request)`
  Compile a semantic model into parameterized SQL and execute it against the target database.
  `Object`
  `health()`
  Health check.
  `Nl2SqlSchemaResult`
  `schema(Nl2SqlSchemaRequest request)`
  Classify a natural-language query to identify the domain, required scope, and matching database schema.
  `default String`
  `serviceName()`

- ## Field Details

  - ### SERVICE_NAME

    static final String SERVICE_NAME
    See Also:
      - Constant Field Values

- ## Method Details

  - ### serviceName

    default String serviceName()
    Specified by:
      `serviceName` in interface `ApiService`

  - ### schema

    @POST @Path("schema") Nl2SqlSchemaResult schema(Nl2SqlSchemaRequest request)
    Classify a natural-language query to identify the domain, required scope, and matching database schema. This is a lightweight, keyword-based step — no LLM call is made. ]
    Parameters:
      `request` - the schema request containing the query and required scope
    Returns:
      the matched domain, scope, confidence, and full schema definition

  - ### execute

    @POST @Path("execute") Nl2SqlExecuteResult execute(Nl2SqlExecuteRequest request)
    Compile a semantic model into parameterized SQL and execute it against the target database. Expects a structured semantic model (filters, columns, aggregation, ordering) — not free text.
    Parameters:
      `request` - the execute request containing domain, scope, and semantic model
    Returns:
      the query result with columns, rows, and metadata

  - ### health

    @GET @Path("health") Object health()
    Health check.
    Returns:
      status map