A user opened the Snowflake Cortex LLM Playground in the AI & ML Studio within Snowsight, selected gemma-7b from the Standard models drop-down list, and typed "What is Gen AI?" into the dialog box.
Which SQL statement will achieve the same result?
The Cortex LLM Playground in Snowsight provides an interactive graphical interface for experimenting with foundation models available within Snowflake Cortex. When a user selects a model from the Standard models drop-down (such as `gemma-7b`) and enters an input prompt, the underlying web interface executes a completion request.
The SQL programmatic equivalent of this playground interaction is `SNOWFLAKE.CORTEX.COMPLETE`. Its two-argument signature accepts:
1. The target model identifier string (`'gemma-7b'`).
2. The user-supplied input prompt (`'What is Gen AI?'`).
The function passes the prompt to the selected model and returns the generated text completion, matching the behavior of the Playground UI.
The other functions serve different tasks:
* `CLASSIFY_TEXT` assigns text to predefined taxonomy labels.
* `EXTRACT_ANSWER` searches an input document to answer a specific factual question.
* `SUMMARIZE` condenses long text passages into shorter summaries.
None of these alternatives provide open-ended prompt completion against a chosen model. References & Study Guide Topics:
* Snowflake Gen AI Functions: `SNOWFLAKE.CORTEX.COMPLETE` Syntax and Invocation
* Snowsight Tooling: Cortex LLM Playground Mechanics and SQL Equivalents
Currently there are no comments in this discussion, be the first to comment!