class_docstr: The main argilla client.
class_docstr_tok: ["The","main","argilla","client","."]
docstr: Inits `Argilla` instance.
  
  If called with `api_url=None` and `api_key=None` and no values have been set for the environment variables
  `ARGILLA_API_URL` and `ARGILLA_API_KEY`, then the local credentials stored by a previous call to `argilla login`
  command will be used. If local credentials are not found, then `api_url` and `api_key` will fallback to the
  default values.
  
  Args:
      api_url: Address of the REST API. If `None` (default) and the env variable ``ARGILLA_API_URL`` is not set,
          it will default to `http://localhost:6900`.
      api_key: Authentication key for the REST API. If `None` (default) and the env variable ``ARGILLA_API_KEY``
          is not set, it will default to `argilla.apikey`.
      workspace: The workspace to which records will be logged/loaded. If `None` (default) and the
          env variable ``ARGILLA_WORKSPACE`` is not set, it will default to the private user workspace.
      timeout: Wait `timeout` seconds for the connection to timeout. Default: 60.
      extra_headers: Extra HTTP headers sent to the server. You can use this to customize
          the headers of argilla client requests, like additional security restrictions. Default: `None`.
      httpx_extra_kwargs: Extra kwargs passed to the `httpx.Client` constructor. For more information about the
          available arguments, see https://www.python-httpx.org/api/#client. Defaults to `None`.
docstr_tok: ["Inits","`","Argilla","`","instance",".","If","called","with","`","api_url=None","`","and","`","api_key=None","`","and","no","values","have","been","set","for","the","environment","variables","`","ARGILLA_API_URL","`","and","`","ARGILLA_API_KEY","`",",","then","the","local","credentials","stored","by","a","previous","call","to","`","argilla","login","`","command","will","be","used",".","If","local","credentials","are","not","found",",","then","`","api_url","`","and","`","api_key","`","will","fallback","to","the","default","values",".","Args",":","api_url",":","Address","of","the","REST","API",".","If","`","None","`","(","default",")","and","the","env","variable","``","ARGILLA_API_URL","``","is","not","set",",","it","will","default","to","`","http",":","\/\/localhost:6900","`",".","api_key",":","Authentication","key","for","the","REST","API",".","If","`","None","`","(","default",")","and","the","env","variable","``","ARGILLA_API_KEY","``","is","not","set",",","it","will","default","to","`","argilla.apikey","`",".","workspace",":","The","workspace","to","which","records","will","be","logged\/loaded",".","If","`","None","`","(","default",")","and","the","env","variable","``","ARGILLA_WORKSPACE","``","is","not","set",",","it","will","default","to","the","private","user","workspace",".","timeout",":","Wait","`","timeout","`","seconds","for","the","connection","to","timeout",".","Default",":","60.","extra_headers",":","Extra","HTTP","headers","sent","to","the","server",".","You","can","use","this","to","customize","the","headers","of","argilla","client","requests",",","like","additional","security","restrictions",".","Default",":","`","None","`",".","httpx_extra_kwargs",":","Extra","kwargs","passed","to","the","`","httpx.Client","`","constructor",".","For","more","information","about","the","available","arguments",",","see","https",":","\/\/www.python-httpx.org\/api\/","#","client",".","Defaults","to","`","None","`","."]
code: def __init__(
      self,
      api_url: Optional[str] = None,
      api_key: Optional[str] = None,
      workspace: Optional[str] = None,
      timeout: int = 120,
      extra_headers: Optional[Dict[str, str]] = None,
      httpx_extra_kwargs: Optional[Dict[str, Any]] = None,
  ):
      """
      Inits `Argilla` instance.
  
      If called with `api_url=None` and `api_key=None` and no values have been set for the environment variables
      `ARGILLA_API_URL` and `ARGILLA_API_KEY`, then the local credentials stored by a previous call to `argilla login`
      command will be used. If local credentials are not found, then `api_url` and `api_key` will fallback to the
      default values.
  
      Args:
          api_url: Address of the REST API. If `None` (default) and the env variable ``ARGILLA_API_URL`` is not set,
              it will default to `http://localhost:6900`.
          api_key: Authentication key for the REST API. If `None` (default) and the env variable ``ARGILLA_API_KEY``
              is not set, it will default to `argilla.apikey`.
          workspace: The workspace to which records will be logged/loaded. If `None` (default) and the
              env variable ``ARGILLA_WORKSPACE`` is not set, it will default to the private user workspace.
          timeout: Wait `timeout` seconds for the connection to timeout. Default: 60.
          extra_headers: Extra HTTP headers sent to the server. You can use this to customize
              the headers of argilla client requests, like additional security restrictions. Default: `None`.
          httpx_extra_kwargs: Extra kwargs passed to the `httpx.Client` constructor. For more information about the
              available arguments, see https://www.python-httpx.org/api/#client. Defaults to `None`.
      """
      from argilla.client.login import ArgillaCredentials
  
      api_url = api_url or os.getenv("ARGILLA_API_URL")
      api_key = api_key or os.getenv("ARGILLA_API_KEY")
      workspace = workspace or os.getenv("ARGILLA_WORKSPACE")
      extra_headers = extra_headers or {}
  
      if api_url is None and api_key is None:
          try:
              credentials = ArgillaCredentials.load()
              api_url = credentials.api_url
              api_key = credentials.api_key
              if not workspace:
                  workspace = credentials.workspace
              extra_headers = credentials.extra_headers
          except FileNotFoundError:
              pass
  
      api_url = api_url or DEFAULT_API_URL
      api_key = api_key or DEFAULT_API_KEY
  
      # Checking that the api_url does not end in '/'
      api_url = re.sub(r"\/$", "", api_url)
      headers = extra_headers or {}
  
      self._client: AuthenticatedClient = AuthenticatedClient(
          base_url=api_url,
          token=api_key,
          timeout=timeout,
          headers=headers.copy(),
          httpx_extra_kwargs=httpx_extra_kwargs,
      )
  
      self._user = users_api.whoami(client=self.http_client)  # .parsed
  
      if (
          not workspace
          and self._user.username == DEFAULT_USERNAME
          and DEFAULT_USERNAME in self._user.workspaces
      ):
          warnings.warn(
              "Default user was detected and no workspace configuration was provided,"
              f" so the default {DEFAULT_USERNAME!r} workspace will be used. If you"
              " want to setup another workspace, use the `rg.set_workspace` function"
              " or provide a different one on `rg.init`",
              category=UserWarning,
          )
          workspace = DEFAULT_USERNAME
      if workspace:
          self.set_workspace(workspace or self._user.username)
      else:
          warnings.warn(
              "No workspace configuration was detected. To work with Argilla"
              " datasets, specify a valid workspace name on `rg.init` or set it"
              " up through the `rg.set_workspace` function.",
              category=UserWarning,
          )
  
      self._check_argilla_versions()
  
imports: import logging
  import os
  import re
  import warnings
  from asyncio import Future
  from concurrent.futures import ThreadPoolExecutor
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  import backoff
  import httpx
  from rich import print
  from rich.progress import Progress
  from argilla._constants import DATASET_NAME_REGEX_PATTERN, DEFAULT_API_KEY, DEFAULT_API_URL, DEFAULT_USERNAME, WORKSPACE_HEADER_NAME, WORKSPACE_NAME_REGEX_PATTERN
  from argilla.client.apis.datasets import Datasets
  from argilla.client.apis.metrics import MetricsAPI
  from argilla.client.apis.search import Search, VectorSearch
  from argilla.client.apis.status import Status
  from argilla.client.datasets import Dataset, DatasetForText2Text, DatasetForTextClassification, DatasetForTokenClassification
  from argilla.client.metrics.models import MetricResults
  from argilla.client.models import BulkResponse, Record, Text2TextRecord, TextClassificationRecord, TokenClassificationRecord
  from argilla.client.sdk.client import AuthenticatedClient
  from argilla.client.sdk.commons.api import bulk
  from argilla.client.sdk.commons.errors import AlreadyExistsApiError, InputValueError, NotFoundApiError
  from argilla.client.sdk.datasets import api
  from argilla.client.sdk.datasets.models import CopyDatasetRequest, TaskType
  from argilla.client.sdk.datasets.models import Dataset
  from argilla.client.sdk.metrics import api
  from argilla.client.sdk.metrics.models import MetricInfo
  from argilla.client.sdk.text2text.models import CreationText2TextRecord, Text2TextBulkData
  from argilla.client.sdk.text2text.models import Text2TextRecord
  from argilla.client.sdk.text_classification import api
  from argilla.client.sdk.text_classification.models import CreationTextClassificationRecord, LabelingRule, LabelingRuleMetricsSummary, TextClassificationBulkData
  from argilla.client.sdk.text_classification.models import TextClassificationRecord
  from argilla.client.sdk.token_classification.models import CreationTokenClassificationRecord, TokenClassificationBulkData
  from argilla.client.sdk.token_classification.models import TokenClassificationRecord
  from argilla.client.sdk.users import api
  from argilla.client.sdk.v1.workspaces import api
  from argilla.client.sdk.v1.workspaces.models import WorkspaceModel
label_desc: Use image node_id 1 to create a new Argilla object  with example: obj = Argilla(api_url, api_key, workspace, timeout, extra_headers, httpx_extra_kwargs)