Skip to content

Commit 123be06

Browse files
committed
Move schema creation back
1 parent ee7e6d2 commit 123be06

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

redisvl/extensions/llmcache/semantic.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,6 @@ def __init__(
101101

102102
self._vectorizer = vectorizer
103103

104-
# Create semantic cache schema and index
105-
schema = SemanticCacheIndexSchema.from_params(
106-
name, prefix, vectorizer.dims, vectorizer.dtype
107-
)
108-
schema = self._modify_schema(schema, filterable_fields)
109-
self._index = SearchIndex(schema=schema)
110-
111104
# Process fields and other settings
112105
self.set_threshold(distance_threshold)
113106
self.return_fields = [
@@ -119,6 +112,13 @@ def __init__(
119112
METADATA_FIELD_NAME,
120113
]
121114

115+
# Create semantic cache schema and index
116+
schema = SemanticCacheIndexSchema.from_params(
117+
name, prefix, vectorizer.dims, vectorizer.dtype
118+
)
119+
schema = self._modify_schema(schema, filterable_fields)
120+
self._index = SearchIndex(schema=schema)
121+
122122
# Handle redis connection
123123
if redis_client:
124124
self._index.set_client(redis_client)

0 commit comments

Comments
 (0)