Function Calling datasets for PaddleFormers must follow a specific format containing messages and tools fields.
Data Schema
messages: A list of conversation turns. Each turn contains:role: One of system, user, assistant, or tool. Note that system should only appear in the first turn.content: The text content of the message.tool_calls (optional): Used in assistant roles to specify structured tool calls. Each call includes a type (e.g., function) and the function definition (name and arguments).
tools (optional): A list of available tools. Each tool is defined as an object with a type (e.g., function) and a function object containing the tool's name, description, and parameters.
Example JSONL Entry
{
"messages": [
{
"role": "user",
"content": "I need to generate an invoice for a customer named John Doe..."
},
{
"role": "assistant",
"content": "<think>\n</think>",
"tool_calls": [
{
"type": "function",
"function": {
"name": "generate_invoice",
"arguments": {"customer_name": "John Doe", "items": [...]}
}
}
]
}
],
"tools": [
{
"type": "function",
"function": {
"name": "generate_invoice",
"description": "Generate an invoice for a customer",
"parameters": { ... }
}
}
]
}
{"messages": [{"role": "user", "content": "I need to generate an invoice for a customer named John Doe. He bought 2 apples for $1 each and 3 oranges for $2 each."}, {"role": "assistant", "content": "<think>\n</think>", "tool_calls": [{"type": "function", "function": {"name": "generate_invoice", "arguments": {"customer_name": "John Doe", "items": [{"name": "apple", "quantity": 2, "price": 1}, {"name": "orange", "quantity": 3, "price": 2}]}}}]}], "tools": [{"type": "function", "function": {"name": "generate_invoice", "description": "Generate an invoice for a customer", "parameters": {"type": "object", "properties": {"customer_name": {"type": "string", "description": "Name of the customer"}, "items": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string", "description": "Name of the item"}, "quantity": {"type": "integer", "description": "Quantity of the item"}, "price": {"type": "number", "description": "Price of the item"}}, "required": ["name", "quantity", "price"], "description": "List of items in the invoice"}}, "required": ["customer_name", "items"]}}}]}]}