class_docstr: Record for a text to text task
  
  Args:
      text:
          The input of the record
      prediction:
          A list of strings or tuples containing predictions for the input text.
          If tuples, the first entry is the predicted text, the second entry is its corresponding score.
      prediction_agent:
          Name of the prediction agent. By default, this is set to the hostname of your machine.
      annotation:
          A string representing the expected output text for the given input text.
      annotation_agent:
          Name of the prediction agent. By default, this is set to the hostname of your machine.
      vectors:
          Embedding data mappings of the natural language text containing class attributes'
      id:
          The id of the record. By default (None), we will generate a unique ID for you.
      metadata:
          Metadata for the record. Defaults to `{}`.
      status:
          The status of the record. Options: 'Default', 'Edited', 'Discarded', 'Validated'.
          If an annotation is provided, this defaults to 'Validated', otherwise 'Default'.
      event_timestamp:
          The timestamp for the creation of the record. Defaults to `datetime.datetime.now()`.
      metrics:
          READ ONLY! Metrics at record level provided by the server when using `rg.load`.
          This attribute will be ignored when using `rg.log`.
      search_keywords:
          READ ONLY! Relevant record keywords/terms for provided query when using `rg.load`.
          This attribute will be ignored when using `rg.log`.
  
  Examples:
      >>> import argilla as rg
      >>> record = rg.Text2TextRecord(
      ...     text="My name is Sarah and I love my dog.",
      ...     prediction=["Je m'appelle Sarah et j'aime mon chien."],
      ...     vectors = {
      ...         "bert_base_uncased": [1.2, 2.3, 3.4, 5.2, 6.5],
      ...         "xlm_multilingual_uncased": [2.2, 5.3, 5.4, 3.2, 2.5]
      ...     }
      ... )
class_docstr_tok: ["Record","for","a","text","to","text","task","Args",":","text",":","The","input","of","the","record","prediction",":","A","list","of","strings","or","tuples","containing","predictions","for","the","input","text",".","If","tuples",",","the","first","entry","is","the","predicted","text",",","the","second","entry","is","its","corresponding","score",".","prediction_agent",":","Name","of","the","prediction","agent",".","By","default",",","this","is","set","to","the","hostname","of","your","machine",".","annotation",":","A","string","representing","the","expected","output","text","for","the","given","input","text",".","annotation_agent",":","Name","of","the","prediction","agent",".","By","default",",","this","is","set","to","the","hostname","of","your","machine",".","vectors",":","Embedding","data","mappings","of","the","natural","language","text","containing","class","attributes'","id",":","The","id","of","the","record",".","By","default","(","None",")",",","we","will","generate","a","unique","ID","for","you",".","metadata",":","Metadata","for","the","record",".","Defaults","to","`","{","}","`",".","status",":","The","status","of","the","record",".","Options",":","'Default","'",",","'Edited","'",",","'Discarded","'",",","'Validated","'",".","If","an","annotation","is","provided",",","this","defaults","to","'Validated","'",",","otherwise","'Default","'",".","event_timestamp",":","The","timestamp","for","the","creation","of","the","record",".","Defaults","to","`","datetime.datetime.now","(",")","`",".","metrics",":","READ","ONLY","!","Metrics","at","record","level","provided","by","the","server","when","using","`","rg.load","`",".","This","attribute","will","be","ignored","when","using","`","rg.log","`",".","search_keywords",":","READ","ONLY","!","Relevant","record","keywords\/terms","for","provided","query","when","using","`","rg.load","`",".","This","attribute","will","be","ignored","when","using","`","rg.log","`",".","Examples",":",">",">",">","import","argilla","as","rg",">",">",">","record","=","rg.Text2TextRecord","(","...","text=","''","My","name","is","Sarah","and","I","love","my","dog",".","``",",","...","prediction=","[","``","Je","m'appelle","Sarah","et","j'aime","mon","chien",".","``","]",",","...","vectors","=","{","...","``","bert_base_uncased","''",":","[","1.2",",","2.3",",","3.4",",","5.2",",","6.5","]",",","...","``","xlm_multilingual_uncased","''",":","[","2.2",",","5.3",",","5.4",",","3.2",",","2.5","]","...","}","...",")"]
docstr: Preprocess the predictions and wraps them in a tuple if needed
docstr_tok: ["Preprocess","the","predictions","and","wraps","them","in","a","tuple","if","needed"]
code: def prediction_as_tuples(
      cls, prediction: Optional[List[Union[str, Tuple[str, float]]]]
  ):
      """Preprocess the predictions and wraps them in a tuple if needed"""
      if prediction is None:
          return prediction
      return [
          (pred, 1.0) if isinstance(pred, str) else pred
          for pred in prediction
      ]
  
imports: import datetime
  import logging
  import uuid
  import warnings
  from enum import Enum
  from typing import Any, Dict, List, Optional, Tuple, Union
  import pandas
  from deprecated import deprecated
  from argilla import _messages
  from argilla._constants import DEFAULT_MAX_KEYWORD_LENGTH
  from argilla.pydantic_v1 import BaseModel, Field, PrivateAttr, root_validator, validator
  from argilla.utils.span_utils import SpanUtils
label_desc: Use image node_id 1 for calling the Text2TextRecord obj's underlying member method code with example usage: obj.prediction_as_tuples(cls, prediction) and returns: unknown, prediction