Skip to content

Instantly share code, notes, and snippets.

@zackangelo
Created December 13, 2024 19:39
Show Gist options
  • Save zackangelo/8862ec433eaf419122a5dc69e9f228d9 to your computer and use it in GitHub Desktop.
Save zackangelo/8862ec433eaf419122a5dc69e9f228d9 to your computer and use it in GitHub Desktop.
Llama 3.3 Multi-tool Use Context Window
<|begin_of_text|><|start_header_id|>system<|end_header_id|>Environment: ipython
Cutting Knowledge Date: December 2023
Today Date: 13 Dec 2024
# Tool Instructions
You may optionally call functions that you have been given access to. You DO NOT have
to call a function if you do not require it. ONLY call functions if you need them. Do NOT call
functions that you have not been given access to.
If a you choose to call a function ONLY reply in the following format:
<{start_tag}={function_name}>{parameters}{end_tag}
where
start_tag => `<function`
parameters => a JSON dict with the function argument name as key and function argument value as value.
end_tag => `</function>`
Here is an example,
<function=example_function_name>{"example_name": "example_value"}</function>
Reminder:
- Function calls MUST follow the specified format
- Required parameters MUST be specified
- You MUST only call functions you have been given access to.
- Only call one function at a time
- Put the entire function call reply on one line
<|eot_id|><|start_header_id|>user<|end_header_id|><|eot_id|><|start_header_id|>system<|end_header_id|>Use the function 'get_current_weather' to: Retrieves the current weather for a city
{
"name": "get_current_weather",
"description": "Retrieves the current weather for a city",
"parameters": {
"location": {
"param_type": "string",
"description": "City and State to retrieve the weather for",
"required": true
}
}
}
Use the function 'calculator' to: Evaluate mathematical expressions
{
"name": "calculator",
"description": "Evaluate mathematical expressions",
"parameters": {
"expression": {
"param_type": "string",
"description": "Math problem to evaluate",
"required": true
}
}
}
<|eot_id|><|start_header_id|>user<|end_header_id|>what is 96 * 124 and the weather in nyc, austin and sf?<|eot_id|><|start_header_id|>assistant<|end_header_id|>
<function=calculator>{"expression": "96 * 124"}</function><|eot_id|><|start_header_id|>ipython<|end_header_id|>{"answer":11904}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
<function=get_current_weather>{"location": "New York City, NY"}</function><|eot_id|><|start_header_id|>ipython<|end_header_id|>{"temperature":33,"units":"F"}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
<function=get_current_weather>{"location": "Austin, TX"}</function><|eot_id|><|start_header_id|>ipython<|end_header_id|>{"temperature":59,"units":"F"}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
<function=get_current_weather>{"location": "San Francisco, CA"}</function><|eot_id|><|start_header_id|>ipython<|end_header_id|>{"temperature":52,"units":"F"}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
The result of the mathematical expression 96 * 124 is 11904. The current weather in New York City, NY is 33°F, in Austin, TX is 59°F, and in San Francisco, CA is 52°F.<|eot_id|>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment