From the course: Creating Advanced AI Applications with Python, APIs, and GitHub Models
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Solution: Using tools when required
From the course: Creating Advanced AI Applications with Python, APIs, and GitHub Models
Solution: Using tools when required
(upbeat music) - [Instructor] Now as part of our solution, we need to be able to distinguish between when we're using function calling and tools versus when we can just use the large language model. So let's go ahead and update our run_pipeline function. So this is what my run_pipeline function currently looks like, so it looks like there's a section for if I'm going to be using tool_calls or if I'm going to be using just the large language model, and this is this section over here. So let's move some of the code from here to the pipeline function, so response and the call to the large language model. And so we need to provide the input as a parameter. And so in this case, we're just going to be calling the run_pipeline instead. Now let's head over to the OpenAI documentation, and in the function calling section under the Advanced usage, if you scroll down to the bottom, you can see that if we have the finish_reason as being tool_calls, that means we are using function callings and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Using GitHub Codespaces3m 32s
-
Using ExchangeRate-API.com4m 56s
-
(Locked)
Challenge: Get_exchange_rate21s
-
(Locked)
Solution: Get_exchange_rate5m 46s
-
(Locked)
Challenge: Choose an LLM supporting multiple languages24s
-
(Locked)
Solution: Choose an LLM supporting multiple languages3m 27s
-
(Locked)
Challenge: Create an app layout37s
-
(Locked)
Solution: Create an app layout3m 56s
-
(Locked)
Challenge: LLM API call58s
-
(Locked)
Solution: LLM API call6m 28s
-
(Locked)
Function calling: Add function calling code1m 43s
-
(Locked)
Challenge: Function calling1m 12s
-
(Locked)
Solution: Function calling8m 57s
-
(Locked)
Challenge: Using tools when required52s
-
(Locked)
Solution: Using tools when required8m 44s
-
(Locked)
Deploy the app to production6m 10s
-
(Locked)
Working with LangSmith8m 22s
-
-