controller.utilities.configuration.CustomEnvModel.model_rebuild

classmethod CustomEnvModel.model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool, default: False) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool, default: True) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int, default: 2) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (dict[str, Any] | None, default: None) – The types namespace, defaults to None.

Return type:

bool | None

Returns:

Returns None if the schema is already “complete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.