Skip to content

Commit c852e3d

Browse files
Bump to 0.3.0 and update docs (#189)
Version bump to 0.3.0 and updates documentation/README!
1 parent 8abec54 commit c852e3d

File tree

13 files changed

+265
-119
lines changed

13 files changed

+265
-119
lines changed

README.md

+158-77
Large diffs are not rendered by default.

docs/_static/js/sidebar.js

+11-14
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,26 @@ const toc = [
44
{ title: "Install", path: "/overview/installation.html" },
55
{ title: "CLI", path: "/overview/cli.html" },
66
]},
7-
{ header: "User Guides", toc: [
8-
{ title: "Getting Started", path: "/user_guide/getting_started_01.html" },
9-
{ title: "Query and Filter", path: "/user_guide/hybrid_queries_02.html" },
10-
{ title: "JSON vs Hash Storage", path: "/user_guide/hash_vs_json_05.html" },
11-
{ title: "Vectorizers", path: "/user_guide/vectorizers_04.html" },
12-
{ title: "Rerankers", path: "/user_guide/rerankers_06.html" },
13-
{ title: "Semantic Caching", path: "/user_guide/llmcache_03.html" },
14-
{ title: "Semantic Routing", path: "/user_guide/semantic_router_08.html" },
15-
]},
167
{ header: "API", toc: [
178
{ title: "Schema", path: "/api/schema.html"},
189
{ title: "Search Index", path: "/api/searchindex.html" },
1910
{ title: "Query", path: "/api/query.html" },
2011
{ title: "Filter", path: "/api/filter.html" },
21-
]},
22-
{ header: "Utils", toc: [
2312
{ title: "Vectorizers", path: "/api/vectorizer.html" },
2413
{ title: "Rerankers", path: "/api/reranker.html" },
25-
]},
26-
{ header: "Extensions", toc: [
2714
{ title: "LLM Cache", path: "/api/cache.html" },
15+
{ title: "LLM Session Manager", path: "/api/session_manager.html" },
2816
{ title: "Semantic Router", path: "/api/router.html" },
29-
]}
17+
]},
18+
{ header: "User Guides", toc: [
19+
{ title: "Getting Started", path: "/user_guide/getting_started_01.html" },
20+
{ title: "Query and Filter", path: "/user_guide/hybrid_queries_02.html" },
21+
{ title: "JSON vs Hash Storage", path: "/user_guide/hash_vs_json_05.html" },
22+
{ title: "Using Vectorizers", path: "/user_guide/vectorizers_04.html" },
23+
{ title: "Using Rerankers", path: "/user_guide/rerankers_06.html" },
24+
{ title: "Semantic Caching", path: "/user_guide/llmcache_03.html" },
25+
{ title: "Semantic Routing", path: "/user_guide/semantic_router_08.html" },
26+
]},
3027
];
3128

3229
document.addEventListener('DOMContentLoaded', function() {

docs/api/cache.rst

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
*********
32
LLM Cache
43
*********

docs/api/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ filter
1818
vectorizer
1919
reranker
2020
cache
21+
session_manager
2122
router
2223
```
2324

docs/api/session_manager.rst

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
*******************
2+
LLM Session Manager
3+
*******************
4+
5+
6+
SemanticSessionManager
7+
======================
8+
9+
.. _semantic_session_manager_api:
10+
11+
.. currentmodule:: redisvl.extensions.session_manager
12+
13+
.. autoclass:: SemanticSessionManager
14+
:show-inheritance:
15+
:members:
16+
:inherited-members:
17+
18+
19+
StandardSessionManager
20+
======================
21+
22+
.. _standard_session_manager_api:
23+
24+
.. currentmodule:: redisvl.extensions.session_manager
25+
26+
.. autoclass:: StandardSessionManager
27+
:show-inheritance:
28+
:members:
29+
:inherited-members:

docs/api/vectorizer.rst

+23
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ OpenAITextVectorizer
2626
:members:
2727

2828

29+
AzureOpenAITextVectorizer
30+
=========================
31+
32+
.. _azureopenaitextvectorizer_api:
33+
34+
.. currentmodule:: redisvl.utils.vectorize.text.azureopenai
35+
36+
.. autoclass:: AzureOpenAITextVectorizer
37+
:show-inheritance:
38+
:members:
39+
40+
2941
VertexAITextVectorizer
3042
======================
3143

@@ -49,3 +61,14 @@ CohereTextVectorizer
4961
:show-inheritance:
5062
:members:
5163

64+
65+
CustomTextVectorizer
66+
====================
67+
68+
.. _customtextvectorizer_api:
69+
70+
.. currentmodule:: redisvl.utils.vectorize.text.custom
71+
72+
.. autoclass:: CustomTextVectorizer
73+
:show-inheritance:
74+
:members:

docs/overview/cli.ipynb

+27-19
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"name": "stdout",
2525
"output_type": "stream",
2626
"text": [
27-
"\u001b[32m09:44:14\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m RedisVL version 0.2.3\n"
27+
"\u001b[32m22:33:29\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m RedisVL version 0.3.0\n"
2828
]
2929
}
3030
],
@@ -46,9 +46,17 @@
4646
},
4747
{
4848
"cell_type": "code",
49-
"execution_count": null,
49+
"execution_count": 2,
5050
"metadata": {},
51-
"outputs": [],
51+
"outputs": [
52+
{
53+
"name": "stdout",
54+
"output_type": "stream",
55+
"text": [
56+
"Overwriting schema.yaml\n"
57+
]
58+
}
59+
],
5260
"source": [
5361
"%%writefile schema.yaml\n",
5462
"\n",
@@ -79,7 +87,7 @@
7987
"name": "stdout",
8088
"output_type": "stream",
8189
"text": [
82-
"\u001b[32m14:22:33\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index created successfully\n"
90+
"\u001b[32m22:33:31\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index created successfully\n"
8391
]
8492
}
8593
],
@@ -97,8 +105,8 @@
97105
"name": "stdout",
98106
"output_type": "stream",
99107
"text": [
100-
"\u001b[32m14:22:34\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n",
101-
"\u001b[32m14:22:34\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. vectorizers\n"
108+
"\u001b[32m22:33:33\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n",
109+
"\u001b[32m22:33:33\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. vectorizers\n"
102110
]
103111
}
104112
],
@@ -125,12 +133,12 @@
125133
"│ vectorizers │ HASH │ ['doc'] │ [] │ 0 │\n",
126134
"╰──────────────┴────────────────┴────────────┴─────────────────┴────────────╯\n",
127135
"Index Fields:\n",
128-
"╭───────────┬─────────────┬────────┬────────────────┬────────────────╮\n",
129-
"│ Name │ Attribute │ Type │ Field Option │ Option Value │\n",
130-
"├───────────┼─────────────┼────────┼────────────────┼────────────────┤\n",
131-
"│ sentence │ sentence │ TEXT │ WEIGHT │ 1\n",
132-
"│ embedding │ embedding │ VECTOR │ \n",
133-
"╰───────────┴─────────────┴────────┴────────────────┴────────────────╯\n"
136+
"╭───────────┬─────────────┬────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬─────────────────┬────────────────\n",
137+
"│ Name │ Attribute │ Type │ Field Option │ Option Value │ Field Option │ Option Value │ Field Option │ Option Value │ Field Option │ Option Value \n",
138+
"├───────────┼─────────────┼────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼─────────────────┼────────────────\n",
139+
"│ sentence │ sentence │ TEXT │ WEIGHT │ 1 │ │ │ │ │ │ \n",
140+
"│ embedding │ embedding │ VECTOR │ algorithm │ FLAT │ data_type │ FLOAT32 │ dim │ 768 │ distance_metric │ COSINE\n",
141+
"╰───────────┴─────────────┴────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴─────────────────┴────────────────\n"
134142
]
135143
}
136144
],
@@ -148,7 +156,7 @@
148156
"name": "stdout",
149157
"output_type": "stream",
150158
"text": [
151-
"\u001b[32m14:22:36\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index deleted successfully\n"
159+
"\u001b[32m22:33:36\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index deleted successfully\n"
152160
]
153161
}
154162
],
@@ -166,7 +174,7 @@
166174
"name": "stdout",
167175
"output_type": "stream",
168176
"text": [
169-
"\u001b[32m14:22:38\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n"
177+
"\u001b[32m22:33:37\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n"
170178
]
171179
}
172180
],
@@ -193,7 +201,7 @@
193201
"name": "stdout",
194202
"output_type": "stream",
195203
"text": [
196-
"\u001b[32m14:22:39\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index created successfully\n"
204+
"\u001b[32m22:33:40\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index created successfully\n"
197205
]
198206
}
199207
],
@@ -211,8 +219,8 @@
211219
"name": "stdout",
212220
"output_type": "stream",
213221
"text": [
214-
"\u001b[32m14:22:40\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n",
215-
"\u001b[32m14:22:40\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. vectorizers\n"
222+
"\u001b[32m22:33:42\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n",
223+
"\u001b[32m22:33:42\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. vectorizers\n"
216224
]
217225
}
218226
],
@@ -272,7 +280,7 @@
272280
"name": "stdout",
273281
"output_type": "stream",
274282
"text": [
275-
"\u001b[32m14:22:42\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index deleted successfully\n"
283+
"\u001b[32m22:33:45\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index deleted successfully\n"
276284
]
277285
}
278286
],
@@ -297,7 +305,7 @@
297305
"name": "python",
298306
"nbconvert_exporter": "python",
299307
"pygments_lexer": "ipython3",
300-
"version": "3.10.14"
308+
"version": "3.11.9"
301309
}
302310
},
303311
"nbformat": 4,

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisvl"
3-
version = "0.2.3"
3+
version = "0.3.0"
44
description = "Python client library and CLI for using Redis as a vector database"
55
authors = ["Redis Inc. <[email protected]>"]
66
license = "MIT"

redisvl/extensions/llmcache/base.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ def store(
5454
metadata."""
5555
raise NotImplementedError
5656

57-
def hash_input(self, prompt: str):
58-
"""Hashes the input using SHA256."""
57+
def hash_input(self, prompt: str) -> str:
58+
"""Hashes the input prompt using SHA256.
59+
60+
Args:
61+
prompt (str): Input string to be hashed.
62+
63+
Returns:
64+
str: Hashed string.
65+
"""
5966
return hashify(prompt)

redisvl/extensions/llmcache/semantic.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def drop(
200200
201201
Args:
202202
ids (Optional[str]): The document ID or IDs to remove from the cache.
203-
keys (Optional[str]):
203+
keys (Optional[str]): The Redis keys to remove from the cache.
204204
"""
205205
if ids is not None:
206206
self._index.drop_keys([self._index.key(id) for id in ids])
@@ -300,6 +300,8 @@ def check(
300300
key = cache_search_result["id"]
301301
self._refresh_ttl(key)
302302

303+
print(cache_search_result, flush=True)
304+
303305
# Create cache hit
304306
cache_hit = CacheHit(**cache_search_result)
305307
cache_hit_dict = {

redisvl/extensions/session_manager/semantic_session.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def get_relevant(
151151
as_text (bool): Whether to return the prompts and responses as text
152152
or as JSON
153153
top_k (int): The number of previous messages to return. Default is 5.
154-
fallback (bool): Whether to drop back to recent conversation history
154+
fall_back (bool): Whether to drop back to recent conversation history
155155
if no relevant context is found.
156156
session_tag (Optional[str]): Tag to be added to entries to link to a specific
157157
session. Defaults to instance uuid.

redisvl/utils/vectorize/text/custom.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def __init__(
4444
embed_many: Optional[Callable] = None,
4545
aembed: Optional[Callable] = None,
4646
aembed_many: Optional[Callable] = None,
47-
model: str = "custom_vectorizer",
4847
):
4948
"""Initialize the Custom vectorizer.
5049
@@ -72,7 +71,7 @@ def __init__(
7271
self._validate_aembed_many(aembed_many)
7372
self._aembed_many_func = aembed_many
7473

75-
super().__init__(model=model, dims=self._set_model_dims())
74+
super().__init__(model=self.type, dims=self._set_model_dims())
7675

7776
def _validate_embed(self, func: Callable):
7877
"""calls the func with dummy input and validates that it returns a vector"""

redisvl/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.2.3"
1+
__version__ = "0.3.0"

0 commit comments

Comments
 (0)