airflow.providers.weaviate.hooks.weaviate¶
Module Contents¶
Classes¶
Interact with Weaviate database to store vectors. This hook uses the conn_id. |
- class airflow.providers.weaviate.hooks.weaviate.WeaviateHook(conn_id=default_conn_name, *args, **kwargs)[source]¶
Bases:
airflow.hooks.base.BaseHookInteract with Weaviate database to store vectors. This hook uses the conn_id.
- Parameters
conn_id (str) – The connection id to use when connecting to Weaviate. <howto/connection:weaviate>
- create_schema(schema_json)[source]¶
Create a new Schema.
Instead of adding classes one by one , you can upload a full schema in JSON format at once.
- query_with_vector(embeddings, class_name, *properties, certainty=0.7, limit=1)[source]¶
Query weaviate database with near vectors.
This method uses a vector search using a Get query. we are using a with_near_vector to provide weaviate with a query with vector itself. This is needed for query a Weaviate class with a custom, external vectorizer. Weaviate then converts this into a vector through the inference API (OpenAI in this particular example) and uses that vector as the basis for a vector search.
- query_without_vector(search_text, class_name, *properties, limit=1)[source]¶
Query using near text.
This method uses a vector search using a Get query. we are using a nearText operator to provide weaviate with a query search_text. Weaviate then converts this into a vector through the inference API (OpenAI in this particular example) and uses that vector as the basis for a vector search.