Learn how to do function calling for Llama 3.1 models!
tool_choice
parameter like traditional function calling, it works with a special prompt syntax. Let’s take a look at how to do function calling with Llama 3.1 models – strictly with a custom prompt!
According to Meta, if you want to do a full conversation with tool calling, Llama 3.1 70B and Llama 3.1 405B are the two recommended options. Llama 3.1 8B is good for zero shot tool calling, but can’t hold a full conversation at the same time.
weatherTool
and want to pass it to LLama 3.1 to be able to call it when it sees fit. We’ll define the function attributes, use the special prompt from llama-agentic-system (from Meta) to pass the function to the model in the system prompt, and send in a prompt asking how the weather is in Tokyo.