Skip to main content

openhands.core.config.config_utils

get_field_info

def get_field_info(field: FieldInfo) -> dict[str, Any]

Extract information about a dataclass field: type, optional, and default.

Arguments:

  • field - The field to extract information from.

  • Returns - A dict with the field's type, whether it's optional, and its default value.

model_defaults_to_dict

def model_defaults_to_dict(model: BaseModel) -> dict[str, Any]

Serialize field information in a dict for the frontend, including type hints, defaults, and whether it's optional.