| 4 | |
| 5 | |
| 6 | class ToolSummaryDataset(ToolDataset): |
| 7 | def __init__(self, dataset_name, tool_task, filepath): |
| 8 | self.dataset_name = dataset_name |
| 9 | self.tool_task = tool_task |
| 10 | self.filepath = filepath |
| 11 | self.datas = self.load_data() |
| 12 | |
| 13 | def load_data(self, ) -> list: |
| 14 | if self.filepath: |
| 15 | return self.load_data_from_local(self.filepath) |
| 16 | elif self.dataset_name and self.tool_task: |
| 17 | return self.load_data_from_hf(self.tool_task) |
| 18 | return [] |
| 19 | |
| 20 | def load_data_from_local(self, filepath): |
| 21 | if "jsonl" in filepath: |
| 22 | return read_jsonl_file(filepath) |
| 23 | elif "json" in filepath: |
| 24 | return read_json_file(filepath) |
| 25 | return [] |
| 26 | |
| 27 | def load_data_from_hf(self, tool_task): |
| 28 | pass |
nothing calls this directly
no outgoing calls
no test coverage detected