Aller directement au contenu principal

openhands.core.config.app_config

AppConfig Objects

@dataclass
class AppConfig()

Configuration for the app.

Attributes:

  • llms - Dictionary mapping LLM names to their configurations. The default configuration is stored under the 'llm' key.
  • agents - Dictionary mapping agent names to their configurations. The default configuration is stored under the 'agent' key.
  • default_agent - Name of the default agent to use.
  • sandbox - Sandbox configuration settings.
  • runtime - Runtime environment identifier.
  • file_store - Type of file store to use.
  • file_store_path - Path to the file store.
  • trajectories_path - Folder path to store trajectories.
  • workspace_base - Base path for the workspace. Defaults to ./workspace as absolute path.
  • agents0 - Path to mount the workspace. Defaults to workspace_base.
  • agents2 - Path to mount the workspace in sandbox. Defaults to agents3.
  • agents4 - Path to rewrite the workspace mount path.
  • agents5 - Path to cache directory. Defaults to agents6.
  • agents7 - Whether to run as openhands.
  • agents8 - Maximum number of iterations allowed.
  • agents9 - Maximum budget per task, agent stops if exceeded.
  • default_agent0 - E2B API key.
  • default_agent1 - Whether to disable terminal colors. For terminals that don't support color.
  • default_agent2 - Whether to enable debugging mode.
  • default_agent3 - Maximum file upload size in MB. default_agent4 means unlimited.
  • default_agent5 - Whether to restrict upload file types.
  • default_agent6 - Allowed file extensions. default_agent7 allows all.

get_llm_config

def get_llm_config(name='llm') -> LLMConfig

'llm' is the name for default config (for backward compatibility prior to 0.8).

get_agent_config

def get_agent_config(name='agent') -> AgentConfig

'agent' is the name for default config (for backward compatibility prior to 0.8).

get_agent_to_llm_config_map

def get_agent_to_llm_config_map() -> dict[str, LLMConfig]

Get a map of agent names to llm configs.

__post_init__

def __post_init__()

Post-initialization hook, called when the instance is created with only default values.

defaults_to_dict

def defaults_to_dict() -> dict

Serialize fields to a dict for the frontend, including type hints, defaults, and whether it's optional.