Skip to content

Commit e5d6b04

Browse files
update docs
1 parent 9b0153d commit e5d6b04

File tree

4 files changed

+40
-18
lines changed

4 files changed

+40
-18
lines changed

docs/_static/js/sidebar.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ const toc = [
99
{ title: "Query and Filter", path: "/user_guide/hybrid_queries_02.html" },
1010
{ title: "JSON vs Hash Storage", path: "/user_guide/hash_vs_json_05.html" },
1111
{ title: "Vectorizers", path: "/user_guide/vectorizers_04.html" },
12-
{ title: "Rerankers", path: "/user_guide/rerankers_06.html"},
12+
{ title: "Rerankers", path: "/user_guide/rerankers_06.html" },
1313
{ title: "Semantic Caching", path: "/user_guide/llmcache_03.html" },
1414
]},
1515
{ header: "API", toc: [
1616
{ title: "Schema", path: "/api/schema.html"},
1717
{ title: "Search Index", path: "/api/searchindex.html" },
1818
{ title: "Query", path: "/api/query.html" },
1919
{ title: "Filter", path: "/api/filter.html" },
20+
]},
21+
{ header: "Utils", toc: [
2022
{ title: "Vectorizers", path: "/api/vectorizer.html" },
2123
{ title: "Rerankers", path: "/api/reranker.html" },
22-
{ title: "LLMCache", path: "/api/cache.html" }
24+
]},
25+
{ header: "Extensions", toc: [
26+
{ title: "LLM Cache", path: "/api/cache.html" },
27+
{ title: "Semantic Router", path: "/api/router.html" },
2328
]}
2429
];
2530

docs/api/cache.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
********
2+
*********
33
LLM Cache
4-
********
4+
*********
55

66
SemanticCache
77
=============

docs/api/router.rst

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
11

2-
********
2+
***************
33
Semantic Router
4-
********
4+
***************
55

66
.. _semantic_router_api:
77

88

99
Semantic Router
10-
=============
10+
===============
1111

1212
.. currentmodule:: redisvl.extensions.router
1313

1414
.. autoclass:: SemanticRouter
15-
:show-inheritance:
1615
:members:
17-
:inherited-members:
1816

1917

2018
Routing Config
21-
===============
19+
==============
2220

2321
.. currentmodule:: redisvl.extensions.router
2422

2523
.. autoclass:: RoutingConfig
26-
:show-inheritance:
2724
:members:
28-
:inherited-members:
2925

3026

3127
Route
@@ -34,6 +30,20 @@ Route
3430
.. currentmodule:: redisvl.extensions.router
3531

3632
.. autoclass:: Route
37-
:show-inheritance:
3833
:members:
39-
:inherited-members:
34+
35+
Route Match
36+
===========
37+
38+
.. currentmodule:: redisvl.extensions.router.schema
39+
40+
.. autoclass:: RouteMatch
41+
:members:
42+
43+
Distance Aggregation Method
44+
===========================
45+
46+
.. currentmodule:: redisvl.extensions.router.schema
47+
48+
.. autoclass:: DistanceAggregationMethod
49+
:members:

redisvl/extensions/router/semantic.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def __init__(
7474
self,
7575
name: str,
7676
routes: List[Route],
77-
vectorizer: BaseVectorizer = HFTextVectorizer(),
78-
routing_config: RoutingConfig = RoutingConfig(),
77+
vectorizer: Optional[BaseVectorizer] = None,
78+
routing_config: Optional[RoutingConfig] = None,
7979
redis_client: Optional[Redis] = None,
8080
redis_url: Optional[str] = None,
8181
overwrite: bool = False,
@@ -86,13 +86,20 @@ def __init__(
8686
Args:
8787
name (str): The name of the semantic router.
8888
routes (List[Route]): List of Route objects.
89-
vectorizer (BaseVectorizer, optional): The vectorizer used to embed route references. Defaults to HFTextVectorizer().
90-
routing_config (RoutingConfig, optional): Configuration for routing behavior. Defaults to RoutingConfig().
89+
vectorizer (BaseVectorizer, optional): The vectorizer used to embed route references. Defaults to default HFTextVectorizer.
90+
routing_config (RoutingConfig, optional): Configuration for routing behavior. Defaults to the default RoutingConfig.
9191
redis_client (Optional[Redis], optional): Redis client for connection. Defaults to None.
9292
redis_url (Optional[str], optional): Redis URL for connection. Defaults to None.
9393
overwrite (bool, optional): Whether to overwrite existing index. Defaults to False.
9494
**kwargs: Additional arguments.
9595
"""
96+
# Set vectorizer default
97+
if vectorizer is None:
98+
vectorizer = HFTextVectorizer()
99+
100+
if routing_config is None:
101+
routing_config = RoutingConfig()
102+
96103
super().__init__(
97104
name=name,
98105
routes=routes,

0 commit comments

Comments
 (0)