(example)
| 19 | test_sets = ["G1_instruction", "G1_category", "G1_tool", "G2_instruction", "G2_category", "G3_instruction"] |
| 20 | |
| 21 | def get_steps(example): |
| 22 | answer_details = example["answer"]["answer_details"][0] |
| 23 | answer_steps = [] |
| 24 | step_cnt = 1 |
| 25 | final_step = "" |
| 26 | |
| 27 | while "next" in answer_details: |
| 28 | answer_str = answer_details["message"] |
| 29 | role_str = answer_details["role"] |
| 30 | |
| 31 | if answer_str and role_str == "tool": |
| 32 | step_text = f"Step {step_cnt}: {answer_str}" |
| 33 | answer_steps.append(step_text) |
| 34 | final_step = f"Final step: {answer_str}" |
| 35 | step_cnt += 1 |
| 36 | |
| 37 | if not answer_details["next"]: |
| 38 | break |
| 39 | |
| 40 | answer_details = answer_details["next"][0] |
| 41 | |
| 42 | return "\n".join(answer_steps), final_step |
| 43 | |
| 44 | |
| 45 | def generate_init_message_node(eg:ExecutionGraph,functions,query): |
no outgoing calls
no test coverage detected