Method
queryFeatureGroupCodeGenerator GET
Copy GET

Send a query to the feature group code generator tool to generate code for the query.

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes query str A natural language query which specifies what the user wants out of the feature group or its code.
Yes language str The language in which code is to be generated. One of 'sql' or 'python'.
No projectId str A unique string identifier of the project in context of which the query is.
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 LlmResponse
KEY TYPE Description
content str Full response from LLM.
tokens int The number of tokens in the response.
stopReason str The reason due to which the response generation stopped.
llmName str The name of the LLM model used to generate the response.
inputTokens int The number of input tokens used in the LLM call.
outputTokens int The number of output tokens generated in the LLM response.
totalTokens int The total number of tokens (input + output) used in the LLM interaction.
codeBlocks LlmCodeBlock A list of parsed code blocks from raw LLM Response
KEY TYPE Description
language str The language of the code block. Eg - python/sql/etc.
code str source code string
start int index of the starting character of the code block in the original response
end int index of the last character of the code block in the original response
valid bool flag denoting whether the soruce code string is syntactically valid

Exceptions:

TYPE WHEN
DataNotFoundError

projectId is not found.

InvalidEnumParameterError

An invalid value is passed for language.

Language: