1
Import the libraries
2
Define the function call generator
Set
return_completions_object = True so that parse gets the full API response. The model may return a tool call or a plain message, so parse handles both.3
Define the tools
This list defines two tools. The first gets the weather for a location, and the second gets the local time.
4
Create the generator with default parameters
By default, every request can use both tools.
5
Set generation parameters for each row
Add a Here the first row can use only the weather tool, and the second row can use only the time tool.
generation_params column to the dataset. For each row, Curator starts from the default generation parameters and replaces the keys that the row sets.6
Run the generator
parse, always handle both tool calls and plain messages.