class_docstr: Base class encapsulating related task metrics
  
  Attributes:
  -----------
  
  metrics:
      A list of configured metrics for task
class_docstr_tok: ["Base","class","encapsulating","related","task","metrics","Attributes",":","--","--","--","--","--","-","metrics",":","A","list","of","configured","metrics","for","task"]
docstr: Use this method is some configured metric requires additional
  records fields.
  
  Generated records will be persisted under ``metrics`` record path.
  For example, if you define a field called ``sentence_length`` like
  
  >>> def record_metrics(cls, record)-> Dict[str, Any]:
  ...     return { "sentence_length" : len(record.text) }
  
  The new field will be stored in elasticsearch in ``metrics.sentence_length``
  
  Parameters
  ----------
  record:
      The record used for calculate metrics fields
  
  Returns
  -------
      A dict with calculated metrics fields
docstr_tok: ["Use","this","method","is","some","configured","metric","requires","additional","records","fields",".","Generated","records","will","be","persisted","under","``","metrics","``","record","path",".","For","example",",","if","you","define","a","field","called","``","sentence_length","``","like",">",">",">","def","record_metrics","(","cls",",","record",")","-",">","Dict","[","str",",","Any","]",":","...","return","{","``","sentence_length","''",":","len","(","record.text",")","}","The","new","field","will","be","stored","in","elasticsearch","in","``","metrics.sentence_length","``","Parameters","--","--","--","--","--","record",":","The","record","used","for","calculate","metrics","fields","Returns","--","--","--","-","A","dict","with","calculated","metrics","fields"]
code: def record_metrics(cls, record: ServiceRecord) -> Dict[str, Any]:
      """
      Use this method is some configured metric requires additional
      records fields.
  
      Generated records will be persisted under ``metrics`` record path.
      For example, if you define a field called ``sentence_length`` like
  
      >>> def record_metrics(cls, record)-> Dict[str, Any]:
      ...     return { "sentence_length" : len(record.text) }
  
      The new field will be stored in elasticsearch in ``metrics.sentence_length``
  
      Parameters
      ----------
      record:
          The record used for calculate metrics fields
  
      Returns
      -------
          A dict with calculated metrics fields
      """
      return {}
  
file_path: argilla/src/argilla/server/services/metrics/models.py
imports: from typing import Any, ClassVar, Dict, Generic, Iterable, List, Optional, TypeVar, Union
  from argilla.server.pydantic_v1 import BaseModel, Field
  from argilla.server.services.search.model import ServiceRecordsQuery
  from argilla.server.services.tasks.commons import ServiceRecord
label_desc: Use image node_id 2 for calling the ServiceBaseTaskMetrics obj's underlying member method code with example usage: obj.record_metrics(cls, record) and returns: dict