import datasets

swe_smith_traj = datasets.load_dataset("SWE-bench/SWE-smith-trajectories", split="train")


example = swe_smith_traj[0]["messages"]


command_list = []
for chat in example:
    if chat["role"] == "assistant":
        command = (
            "<function=" + \
            chat["content"].split("<function=")[-1].split("</function>")[0] + \
            "</function>"
        )
        command_list.append(command)


print("Number of commands:", len(command_list))

for idx, command in enumerate(command_list):
    print(f"{idx} : {command}\n")
