class_docstr: Group of functions related to elasticsearch aggregations requests
class_docstr_tok: ["Group","of","functions","related","to","elasticsearch","aggregations","requests"]
code: def histogram_aggregation(
      field_name: str = None,
      script: Union[str, Dict[str, Any]] = None,
      interval: float = 0.1,
  ):
      assert (
          field_name or script
      ), "Either field name or script must be provided"
  
      if script:
          query_part = {"script": script}
      else:
          query_part = {"field": field_name}
  
      return {
          "meta": {
              "kind": "histogram",
          },
          "histogram": {
              **query_part,
              "interval": interval or 0.1,
          },
      }
  
imports: from enum import Enum
  from typing import Any, Dict, List, Optional, Type, Union
  from argilla.server.commons.models import TaskStatus
  from argilla.server.daos.backend.mappings.helpers import mappings
  from argilla.server.pydantic_v1 import BaseModel
label_desc: Use image node_id 4 for calling the aggregations obj's underlying member method code with example usage: obj.histogram_aggregation(field_name, script, interval) and returns: dict