diff --git a/langchain/retrievers/weaviate_hybrid_search.py b/langchain/retrievers/weaviate_hybrid_search.py index 994d02e212c..1df9e153473 100644 --- a/langchain/retrievers/weaviate_hybrid_search.py +++ b/langchain/retrievers/weaviate_hybrid_search.py @@ -48,12 +48,12 @@ class WeaviateHybridSearchRetriever(BaseRetriever): raise ValueError( f"client should be an instance of weaviate.Client, got {type(client)}" ) - if values["attributes"] is None: + if values.get("attributes") is None: values["attributes"] = [] cast(List, values["attributes"]).append(values["text_key"]) - if values["create_schema_if_missing"]: + if values.get("create_schema_if_missing", True): class_obj = { "class": values["index_name"], "properties": [{"name": values["text_key"], "dataType": ["text"]}],