Method
generateCodeForDataQueryUsingLLM POST
Copy POST

Execute a data query using a large language model in an async fashion.

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes query str The natural language query to execute. The query is converted to a SQL query using the language model.
No featureGroupIds List[str] A list of feature group IDs that the query should be executed against.
No externalDatabaseSchemas List[DatabaseConnectorSchema] A list of schmeas from external database that the query should be executed against.
No promptContext str The context message used to construct the prompt for the language model. If not provide, a default context message is used.
No llmName LLMName The name of the language model to use. If not provided, the default language model is used.
No temperature float The temperature to use for the language model if supported. If not provided, the default temperature is used.
No sqlDialect str The dialect of sql to generate sql for. The default is Spark.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
result LlmGeneratedCode
KEY TYPE Description
sql str SQL query generated by LLM.

Exceptions:

TYPE WHEN
DataNotFoundError

featureGroupIds is not found.

InvalidEnumParameterError

An invalid value is passed for llmName.

Language: