trinity.common.workflows.customized_toolcall_workflows module
We include the customized toolcall workflows in this file. Code adapted from https://github.com/NVlabs/Tool-N1 Reference Paper https://arxiv.org/pdf/2505.00024 for further details.
- trinity.common.workflows.customized_toolcall_workflows.compute_score_v0(solution_str, ground_truth, do_print=False)[source]
- trinity.common.workflows.customized_toolcall_workflows.compute_toolcall_reward(solution_str: str, ground_truth: str) float [source]
- class trinity.common.workflows.customized_toolcall_workflows.ToolCallWorkflow(*, task: Task, model: ModelWrapper, auxiliary_models: List[OpenAI] | None = None)[source]
Bases:
SimpleWorkflow
A workflow for toolcall tasks. Prompt construction and reward function from https://github.com/NVlabs/Tool-N1
Only support qwen model for now. You can change the prompt construction and reward calculation by yourself for other models.
- run() List[Experience] [source]
Run workflow and return a list of experiences.