QuestionQ62

Snowflake Gen AI & LLM Functions

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?

  • A SELECT SNOWFLAKE.CORTEX.CLASSIFY_TEXT(‘gemma-7b’, ‘What is Gen AI?’);
  • B SELECT SNOWFLAKE.CORTEX.COMPLETE(‘gemma-7b’, ‘What is Gen AI?’);
  • C SELECT SNOWFLAKE.CORTEX.EXTRACT_ANSWER(‘gemma-7b’, ‘What is Gen AI?’);
  • D SELECT SNOWFLAKE.CORTEX.SUMMARIZE(‘gemma-7b’, ‘What is Gen AI?’);
Explanation

The Cortex LLM Playground lets users submit a free-text prompt to a chosen LLM and receive a generated response, which is exactly what SNOWFLAKE.CORTEX.COMPLETE does — it generates a response (completion) from a specified large language model given a prompt. The other functions serve different purposes: CLASSIFY_TEXT assigns categories to text, EXTRACT_ANSWER pulls a specific answer from a provided passage, and SUMMARIZE condenses a document into a shorter summary. Only COMPLETE performs open-ended prompt-response generation matching the Playground's behavior.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!