class_docstr: Interact with Weaviate database to store vectors. This hook uses the 'conn_id'.
  
  :param conn_id: The connection id to use when connecting to Weaviate. <howto/connection:weaviate>
class_docstr_tok: ["Interact","with","Weaviate","database","to","store","vectors",".","This","hook","uses","the","'conn_id","'",".",":","param","conn_id",":","The","connection","id","to","use","when","connecting","to","Weaviate",".","<","howto\/connection",":","weaviate",">"]
docstr: Get or Create a new object.
  
  Returns the object if already exists
  
  :param data_object: Object to be added. If type is str it should be either a URL or a file. This is required
      to create a new object.
  :param class_name: Class name associated with the object given. This is required to create a new object.
  :param vector: Vector associated with the object given. This argument is only used when creating object.
  :param consistency_level: Consistency level to be used. Applies to both create and get operations.
  :param tenant: Tenant to be used. Applies to both create and get operations.
  :param kwargs: Additional parameters to be passed to weaviate_client.data_object.create() and
      weaviate_client.data_object.get()
code: def get_or_create_object(
      self,
      data_object: dict | str | None = None,
      class_name: str | None = None,
      vector: Sequence | None = None,
      consistency_level: ConsistencyLevel | None = None,
      tenant: str | None = None,
      **kwargs,
  ) -> str | dict[str, Any] | None:
      """Get or Create a new object.
  
      Returns the object if already exists
  
      :param data_object: Object to be added. If type is str it should be either a URL or a file. This is required
          to create a new object.
      :param class_name: Class name associated with the object given. This is required to create a new object.
      :param vector: Vector associated with the object given. This argument is only used when creating object.
      :param consistency_level: Consistency level to be used. Applies to both create and get operations.
      :param tenant: Tenant to be used. Applies to both create and get operations.
      :param kwargs: Additional parameters to be passed to weaviate_client.data_object.create() and
          weaviate_client.data_object.get()
      """
      obj = self.get_object(
          class_name=class_name,
          consistency_level=consistency_level,
          tenant=tenant,
          **kwargs,
      )
      if not obj:
          if not (data_object and class_name):
              raise ValueError(
                  "data_object and class_name are required to create a new object"
              )
          uuid = kwargs.pop("uuid", generate_uuid5(data_object))
          return self.create_object(
              data_object,
              class_name,
              vector=vector,
              uuid=uuid,
              consistency_level=consistency_level,
              tenant=tenant,
          )
      return obj
  
imports: from __future__ import annotations
  import contextlib
  import json
  import warnings
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Dict, List, Sequence, cast
  import requests
  import weaviate.exceptions
  from tenacity import Retrying, retry, retry_if_exception, retry_if_exception_type, stop_after_attempt
  from weaviate import Client
  from weaviate.auth import AuthApiKey, AuthBearerToken, AuthClientCredentials, AuthClientPassword
  from weaviate.data.replication import ConsistencyLevel
  from weaviate.exceptions import ObjectAlreadyExistsException
  from weaviate.util import generate_uuid5
  from airflow.exceptions import AirflowProviderDeprecationWarning
  from airflow.hooks.base import BaseHook
label_desc: Use image node_id 23 for calling the WeaviateHook obj's underlying member method code with example usage: obj.get_or_create_object(data_object, class_name, vector, consistency_level, tenant) and returns: obj, self