From the course: Level up LLM applications development with LangChain and OpenAI
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Define tools
From the course: Level up LLM applications development with LangChain and OpenAI
Define tools
- [Instructor] So for the first parts to get started, we want to define the tools. We're going to define some tools to use, and we're going to start by a very simple example, which is to write a simple python function that we use to calculate the length of a word that we pass in as a parameter. And here, so the way that it is defined, we are going to define it as get word length. We're going to pass in a word, in a string format, and then calculate the length of the number of characters for this word that you pass in as a parameter. So, first you need to add this to the scope. Let's do this so it is already added. You're going to see, you're going to find it here. And so next we're going to actually add this decorator in order to make it a tool. Okay, so we're going to see that more in details and how it works, and I'm going to start by copying this function and add it here. And remember also to add tool, alright? And that's going to allow to give it a specific format and actually…
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Using agents to perform actions in chains1m 36s
-
(Locked)
Define tools5m 37s
-
(Locked)
Select the perfect prompt1m 12s
-
(Locked)
Bind tools and create agent2m 19s
-
(Locked)
Create and run the agent executor4m 41s
-
(Locked)
Challenge: Create a multitask agent5m 31s
-
(Locked)
Solution: Define tools and functions6m 9s
-
(Locked)
-
-
-