From the course: Building Generative AI Apps to Talk to Your Data
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Working with the semantic model - Snowflake Tutorial
From the course: Building Generative AI Apps to Talk to Your Data
Working with the semantic model
- Welcome back. In this video we'll learn how to use the Cortex Analyst API. We'll start by calling the REST API, so if your notebook is not already open, open it up again and rewind it to this cell, using semantic models to share context with LLMs. Ready? Let's go. (graphic whooshing) The reason that we use semantic models is to improve the SQL generated by our LLMs. These models give us a structured way to capture the information that we need from our data which relates to our business. When we pass this information to the LLM with the request, the SQL generation improves. Now, take a look. Here, we're choosing our semantic model and naming it Revenue. From there, we are updating semantic_model_name to add it to the semantic model. In the next part, we're defining our semantic model base_table and the primary keys for these tables. We define our dimensions, time_dimensions, and our measures. As we go through this, we see that for our base_table, daily_revenue, we also provide a…
Contents
-
-
-
-
-
(Locked)
Avoiding death by dashboard4m 51s
-
(Locked)
Setting up the app4m 58s
-
(Locked)
Understanding the semantic model8m 18s
-
(Locked)
Working with the semantic model4m 37s
-
(Locked)
Using Cortex Analyst5m 56s
-
(Locked)
From text-to-SQL to TAG: Creating table-assisted generation3m 17s
-
(Locked)
Expanding the scope of the semantic model12m 11s
-
(Locked)
Building the Streamlit app11m 41s
-
(Locked)
Congratulations!3m 6s
-
(Locked)