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

Function fetch_data

AgentBench.old/src/tasks/mind2web/task.py:15–24  ·  view source on GitHub ↗
(session: Session, prompt_template, max_attempts=20)

Source from the content-addressed store, hash-verified

13
14
15def fetch_data(session: Session, prompt_template, max_attempts=20):
16 for attempt in range(max_attempts):
17 try:
18 output = session.action(prompt_template)
19 assert output is not None
20 return output
21 except AssertionError:
22 print(f"Output is None! Retrying...({attempt + 1}/{max_attempts})")
23 time.sleep(3)
24 raise RuntimeError("Failed to fetch data after several attempts")
25
26class Mind2Web(Task):
27 def __init__(self, **config):

Callers 1

predict_singleMethod · 0.85

Calls 1

actionMethod · 0.80

Tested by

no test coverage detected