SnowPro Specialty: Gen AI Question 226
Single answerCOMPLETE (SNOWFLAKE.CORTEX)A retail analytics team wants to generate short, customer-facing summaries of support cases directly in Snowflake using COMPLETE from SNOWFLAKE.CORTEX. They already store case details in a table and need a solution that minimizes SQL complexity while ensuring each summary is generated from a prompt built from multiple columns such as issue_type, product_name, and resolution_notes. The team also wants to avoid manually assembling JSON request bodies for every call. Which approach is the most appropriate?
- A
Use COMPLETE with a SQL string prompt constructed from the relevant columns, and optionally supply model parameters such as temperature in the function call.
- B
Use COMPLETE only with staged files as input because COMPLETE cannot accept prompts built from table columns.
- C
Call COMPLETE by first converting each row into a VECTOR embedding, because COMPLETE requires vector input rather than text input.
- D
Use COMPLETE only through Python stored procedures, because SQL cannot invoke SNOWFLAKE.CORTEX functions directly.
Show answer and explanation
Correct answer: A
Explanation
The best answer is to call COMPLETE directly in SQL using prompts dynamically constructed from table columns. This is a common real-world pattern for batch summarization, classification, and content generation inside Snowflake. COMPLETE is intended for prompt-based text generation and integrates naturally with SQL expressions, which lets teams apply it across many rows without external orchestration. This also aligns with Snowflake best practices of keeping data processing in-platform and using Cortex AISQL functions directly where possible. By contrast, staged files are not required for normal COMPLETE usage, embeddings are used for semantic similarity rather than prompt generation, and Python stored procedures are optional orchestration tools rather than a requirement. Candidates should recognize that COMPLETE supports practical, row-wise generation workloads directly from relational data in SQL.
- A. Correct.
Correct. COMPLETE is designed to generate text from a prompt and can be called directly in SQL. In a practical pattern, the prompt can be assembled from table columns using standard SQL string concatenation or formatting logic, which keeps the solution simple and set-based. Teams can also provide model options such as temperature through the function interface rather than building custom JSON payloads for each row. This is the most appropriate approach for generating row-level summaries from relational data.
- B. Incorrect.
Incorrect. This reflects a common misconception that Cortex functions require file-based input. COMPLETE does not require staged files and can work directly with text prompts created from table data. Staged files may be relevant in other workflows, but they are not required for standard prompt-based text generation from relational columns.
- C. Incorrect.
Incorrect. VECTOR embeddings are associated with semantic search and similarity workflows, not a prerequisite for text generation with COMPLETE. COMPLETE accepts natural-language prompts, so converting each row into an embedding first would add unnecessary complexity and would not be the correct input pattern for generating summaries.
- D. Incorrect.
Incorrect. SNOWFLAKE.CORTEX functions, including COMPLETE, are available directly in SQL. While Python stored procedures can orchestrate workflows, they are not required just to invoke COMPLETE. Choosing a stored procedure-only approach would increase implementation overhead and does not address the team's goal of minimizing SQL complexity.