fix: make max_budget_per_task optional in run_agent_controller (#3071)

* fix: make max_budget_per_task optional in `run_agent_controller`

* update arg for each run infer
This commit is contained in:
Xingyao Wang
2024-07-23 09:47:00 +08:00
committed by GitHub
parent 4099e48122
commit da17665cab
17 changed files with 21 additions and 2 deletions

View File

@@ -122,6 +122,7 @@ def process_instance(
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN[
agent.__class__.__name__
],

View File

@@ -116,6 +116,7 @@ def process_instance(
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=FAKE_RESPONSES[agent.__class__.__name__],
sandbox=sandbox,
sid=inst_id,

View File

@@ -169,6 +169,7 @@ def process_instance(
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN[
agent.__class__.__name__
],

View File

@@ -213,6 +213,7 @@ def process_instance(
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN[
agent.__class__.__name__
],

View File

@@ -67,7 +67,11 @@ def process_instance(
state: State | None = asyncio.run(
run_agent_controller(
agent, instruction, max_iterations=metadata.max_iterations, sid=env_id
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
sid=env_id,
)
)

View File

@@ -119,6 +119,7 @@ def process_instance(
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN[
agent.__class__.__name__
],

View File

@@ -113,6 +113,7 @@ def process_instance(agent, question_id, question, metadata, reset_logger: bool
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN.get(
agent.__class__.__name__
),

View File

@@ -229,6 +229,7 @@ Ok now its time to start solving the question. Good luck!
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN.get(
agent.__class__.__name__
),

View File

@@ -182,6 +182,7 @@ def process_instance(
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN.get(
agent.__class__.__name__
),

View File

@@ -180,6 +180,7 @@ def process_instance(
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN.get(
agent.__class__.__name__
),

View File

@@ -81,6 +81,7 @@ def process_instance(
agent,
'PLACEHOLDER_GOAL',
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
runtime_tools_config=runtime_tools_config,
sandbox=get_sandbox(),
sid=env_id,

View File

@@ -143,6 +143,7 @@ def process_instance(
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=fake_user_response_fn,
sandbox=sandbox,
sid=sid,

View File

@@ -150,6 +150,7 @@ def process_instance(instance: Any, metadata: EvalMetadata, reset_logger: bool =
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN.get(
agent.__class__.__name__
),

View File

@@ -282,6 +282,7 @@ IMPORTANT TIPS:
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN[
agent.__class__.__name__
],

View File

@@ -79,6 +79,7 @@ def process_instance(instance: Any, metadata: EvalMetadata, reset_logger: bool =
agent,
instruction,
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN[
agent.__class__.__name__
],

View File

@@ -82,6 +82,7 @@ def process_instance(
agent,
'PLACEHOLDER_GOAL',
max_iterations=metadata.max_iterations,
max_budget_per_task=config.max_budget_per_task,
runtime_tools_config=runtime_tools_config,
sandbox=get_sandbox(),
sid=env_id,

View File

@@ -34,7 +34,7 @@ async def run_agent_controller(
agent: Agent,
task_str: str,
max_iterations: int,
max_budget_per_task: float,
max_budget_per_task: float | None = None,
exit_on_message: bool = False,
fake_user_response_fn: Callable[[State | None], str] | None = None,
sandbox: Sandbox | None = None,