mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-25 16:13:25 +00:00
Fix key errors in weaviate hybrid retriever init (#7988)
This commit is contained in:
parent
df84e1bb64
commit
8edb1db9dc
@ -48,12 +48,12 @@ class WeaviateHybridSearchRetriever(BaseRetriever):
|
|||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"client should be an instance of weaviate.Client, got {type(client)}"
|
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"] = []
|
values["attributes"] = []
|
||||||
|
|
||||||
cast(List, values["attributes"]).append(values["text_key"])
|
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_obj = {
|
||||||
"class": values["index_name"],
|
"class": values["index_name"],
|
||||||
"properties": [{"name": values["text_key"], "dataType": ["text"]}],
|
"properties": [{"name": values["text_key"], "dataType": ["text"]}],
|
||||||
|
Loading…
Reference in New Issue
Block a user