pydantic model llama_index.core.schema.BaseComponent#

Base component object to capture class names.

Show JSON schema
   "title": "BaseComponent",
   "description": "Base component object to capture class names.",
   "type": "object",
   "properties": {
      "class_name": {
         "title": "Class Name",
         "type": "string",
         "default": "base_component"

  • schema_extra: function = <function BaseComponent.Config.schema_extra at 0x7f8748f73880>

classmethod class_name() str#

Get the class name, used as a unique ID in serialization.

This provides a key that makes serialization robust against actual class name changes.

dict(**kwargs: Any) Dict[str, Any]#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_dict(data: Dict[str, Any], **kwargs: Any) Self#
classmethod from_json(data_str: str, **kwargs: Any) Self#
json(**kwargs: Any) str#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

to_dict(**kwargs: Any) Dict[str, Any]#
to_json(**kwargs: Any) str#