Aller directement au contenu principal

openhands.resolver.resolve_issue

initialize_runtime

def initialize_runtime(runtime: Runtime)

Initialize the runtime for the agent.

This function is called before the runtime is used to run the agent. Currently it does nothing.

complete_runtime

async def complete_runtime(runtime: Runtime,
base_commit: str) -> dict[str, Any]

Complete the runtime for the agent.

This function is called before the runtime is used to run the agent. If you need to do something in the sandbox to get the correctness metric after the agent has run, modify this function.

resolve_issue

async def resolve_issue(owner: str,
repo: str,
token: str,
username: str,
max_iterations: int,
output_dir: str,
llm_config: LLMConfig,
runtime_container_image: str,
prompt_template: str,
issue_type: str,
repo_instruction: str | None,
issue_number: int,
comment_id: int | None,
target_branch: str | None = None,
reset_logger: bool = False) -> None

Resolve a single github issue.

Arguments:

  • owner - Github owner of the repo.
  • repo - Github repository to resolve issues in form of owner/repo.
  • token - Github token to access the repository.
  • username - Github username to access the repository.
  • max_iterations - Maximum number of iterations to run.
  • output_dir - Output directory to write the results.
  • llm_config - Configuration for the language model.
  • runtime_container_image - Container image to use.
  • prompt_template - Prompt template to use.
  • repo0 - Type of issue to resolve (issue or pr).
  • repo1 - Repository instruction to use.
  • repo2 - Issue number to resolve.
  • repo3 - Optional ID of a specific comment to focus on.
  • repo4 - Optional target branch to create PR against (for PRs).
  • repo5 - Whether to reset the logger for multiprocessing.