File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
libs/weaviate/langchain_weaviate Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ def __init__(
9191 index_name : Optional [str ],
9292 text_key : str ,
9393 embedding : Optional [Embeddings ] = None ,
94+ schema : Optional [dict ] = None ,
9495 attributes : Optional [List [str ]] = None ,
9596 relevance_score_fn : Optional [
9697 Callable [[float ], float ]
@@ -113,12 +114,15 @@ def __init__(
113114 if attributes is not None :
114115 self ._query_attrs .extend (attributes )
115116
116- schema = _default_schema (self ._index_name )
117- schema ["MultiTenancyConfig" ] = {"enabled" : use_multi_tenancy }
117+ if not schema :
118+ self .schema = _default_schema (self ._index_name )
119+ schema ["MultiTenancyConfig" ] = {"enabled" : use_multi_tenancy }
120+ else :
121+ self .schema = schema
118122
119123 # check whether the index already exists
120124 if not client .collections .exists (self ._index_name ):
121- client .collections .create_from_dict (schema )
125+ client .collections .create_from_dict (self . schema )
122126
123127 # store collection for convenience
124128 # this does not actually send a request to weaviate
You can’t perform that action at this time.
0 commit comments