From the course: Intro to Snowflake for Devs, Data Scientists, Data Engineers

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Snowflake Cortex LLM functions: Part 2

Snowflake Cortex LLM functions: Part 2

- We just learned how to use Snowflake Cortex COMPLETE inside a select statement. Now we're going to cover how you can give the model context when you call COMPLETE, specifically, how you can feed in the past history of your prompts and the responses you got. For this, let's expand the worksheet so it fills the whole screen. That will make this easier to see. Okay, so let's take a look at the code we're about to run. Select snowflake.cortex.COMPLETE, and then we have the model we want to use, and it's got role and content, and role and content, and then it at the end it says, as response. This might look confusing, but I promise it's not bad at all. We're still just doing two basic things. One, we're telling COMPLETE the name of the model we wanted to use. Two, we're giving it an array with our instructions. You can see it's an array because we're using brackets. Inside that array are objects. You can see that they're objects because we have braces. Each object lists a role and…

Contents