Translate plain English into HQL
POST /Platform/query/translate
Translate plain English into HQL. An LLM writes the query from your
text and the type's schema; nothing is run. Check the returned
hql and warnings before running it with run_hql.
To query a list inside a stored value, pass its handle (and
path, plus headers_path for list-shaped rows), or a
current_hql that starts with handle(...). The model then sees
the value's columns (name, original header, kind, sample values) and
writes a query that starts with that source; the result is checked
against the columns without running it, and any problem is returned
in warnings.
Body parameters
entity_type: optional str. Target entity type (e.g. "Call"). If omitted, the LLM infers it.text: optional str. Natural language description of the query.schema_summary: optional str. Optional pre-built schema summary string (legacy fallback).schema: optional List[Any]. Structured schema field list from the frontend.entity_types: optional List[Any]. List of available entity type names for inference.current_hql: optional str. The current HQL query (if any) for follow-up refinements. One that starts withhandle(...)sets the source whenhandleis not given.handle: optional str. Handle of a stored value (tree-...) whose list the query should read as a table, instead of an entity type.path: optional str. Path to the list of rows inside the value, in the dtypes path syntax (/result/rows, or a glob such asitems[*]); only withhandle.headers_path: optional str. Path to the list of column names, for rows that are lists rather than objects; only withhandle.
Returns
QueryTranslation
entity_type: str. Inferred or requested entity class name; "handle" for a query over a stored value.conditions: List[QueryCondition]. Conditions extracted from the generated HQL.selected_fields: List[str]. Projected fields other than id, name, and entity_type.hql: str. Complete generated HQL statement.warnings: optional List[str]. Why the generated HQL would fail or mislead when run (a parse error, an unknown column), word for word; empty when it checked out.
Example request
curl -X POST "https://api.hilus.ai/Platform/query/translate" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'