RecentReviewsSummarizer

InfoGenerateCreated ByPackages

This code snippet is an SQL query that retrieves the most recent 20 reviews from a table named 'reviews' and uses a function `SNOWFLAKE.CORTEX.COMPLETE` to summarize the content of these reviews. The function `COMPLETE` seems to leverage a pre-trained language model 'mistral-large' for generating the summaries. The query orders the reviews by their creation date in descending order before applying the summarization function.

SELECT SNOWFLAKE.CORTEX.COMPLETE(
    'mistral-large',
    CONCAT('Summarize this review: <review>', review_content, '</review>')
) FROM reviews
ORDER BY created_at DESC
LIMIT 20;