The OpenAI messages format is a solid baseline. It’s common to extend it by adding a tool_calls list to the assistant message and a tool_outputs list to a subsequent tool role message. For metadata, track the original task_description, the full tool_definitions available, and a final outcome status (e.g., success, failure). This structure is flexible and maps well to most inference APIs.
Definitely keep failed attempts and dead ends; they are your most valuable negative examples. A dataset of only “golden paths” produces brittle agents that can’t recover from errors. For generation, model-generated trajectories with human review and correction is the most scalable approach. Purely human-authored data is too slow and expensive for large-scale SFT or preference tuning.
The ToolBench dataset and its accompanying paper (“ToolLLM”) are a comprehensive reference. They detail a full pipeline for instruction generation, response generation with a solver model, and evaluation. The GAIA benchmark is another good example of complex, multi-step tasks requiring robust trajectories for both training and evaluation.