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

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