This Jupyter Notebook demonstrates the usage of Anthropic's Tool use (function calling) feature with the Claude 3 model. The purpose of this exercise is to explore how Claude 3 can interact with external tools and retrieve relevant information based on user queries.
This section provides an overview of the notebook's purpose and capabilities, highlighting its focus on demonstrating the Claude 3 model's interaction with function calling.
Before running this notebook, ensure the following are installed:
- Python
- Jupyter Notebook (install via
pip install jupyter
) - Anthropic Claude 3 API Key (get it here)
- Ninja API Key (get a free key here)
-
Clone this repository or download as a ZIP.
-
Navigate to the directory in your terminal.
-
Create a
.env
file with your Anthropic and Ninja API keys: -
Launch Jupyter Notebook by running the following command in your terminal:
jupyter notebook
-
Open the
Claude 3 Function Call.ipynb.ipynb
file in Jupyter Notebook.
-
Once you have the notebook open, you can run each cell in sequential order by clicking on the cell and pressing
Shift + Enter
. -
The notebook will execute the code, set up the necessary configurations, and define the required functions.
-
At the end of the notebook, there are two example queries;
- "do you know anything about United Kingdom"
- "do you know anything about London"
-
The final answers will be printed with colored formatting for better readability.
-
Feel free to explore the code and modify the queries to experiment with different inputs and observe how Claude 3 responds.