MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / get_data

Method get_data

AgentBench.old/src/tasks/example_task.py:21–27  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

19 super().__init__(**configs)
20
21 def get_data(self) -> Dataset[str, str]:
22 data = Dataset()
23 for _ in range(self.count):
24 x = random.randint(self.range_min, self.range_max)
25 y = random.randint(self.range_min, self.range_max)
26 data.append(DataPiece("Your answer should only contain the integer number (without comma), for example, for a question 'what is the answer of 5000 + 5000?', your should print only '10000'. Now, answer the question: What is the answer of {} + {}?".format(x, y), str(x + y)))
27 return data
28
29 def predict_single(self, session: Session, data_item: str) -> str:
30 return session.action({"role": "user", "content": data_item})

Callers

nothing calls this directly

Calls 2

DatasetClass · 0.90
DataPieceClass · 0.90

Tested by

no test coverage detected