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 Details

  • 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