mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 07:18:10 -05:00
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:
@@ -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__
|
||||
],
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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__
|
||||
],
|
||||
|
||||
@@ -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__
|
||||
],
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -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__
|
||||
],
|
||||
|
||||
@@ -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__
|
||||
),
|
||||
|
||||
@@ -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__
|
||||
),
|
||||
|
||||
@@ -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__
|
||||
),
|
||||
|
||||
@@ -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__
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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__
|
||||
),
|
||||
|
||||
@@ -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__
|
||||
],
|
||||
|
||||
@@ -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__
|
||||
],
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user