Aller directement au contenu principal

openhands.runtime.utils.files

resolve_path

def resolve_path(file_path: str, working_directory: str, workspace_base: str,
workspace_mount_path_in_sandbox: str)

Resolve a file path to a path on the host filesystem.

Arguments:

  • file_path - The path to resolve.
  • working_directory - The working directory of the agent.
  • workspace_mount_path_in_sandbox - The path to the workspace inside the sandbox.
  • workspace_base - The base path of the workspace on the host filesystem.

Returns:

The resolved path on the host filesystem.

insert_lines

def insert_lines(to_insert: list[str],
original: list[str],
start: int = 0,
end: int = -1)

Insert the new content to the original content based on start and end