Skip to content

Commit b026e02

Browse files
committed
Format class and function signatures
1 parent b33287c commit b026e02

File tree

9 files changed

+322
-322
lines changed

9 files changed

+322
-322
lines changed

content/integrate/redisvl/api/cache.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type: integration
99

1010
<a id="semantic-cache-api"></a>
1111

12-
### *class* SemanticCache(name='llmcache', distance_threshold=0.1, ttl=None, vectorizer=None, filterable_fields=None, redis_client=None, redis_url='redis://localhost:6379', connection_kwargs={}, overwrite=False, \*\*kwargs)
12+
### `*class* SemanticCache(name='llmcache', distance_threshold=0.1, ttl=None, vectorizer=None, filterable_fields=None, redis_client=None, redis_url='redis://localhost:6379', connection_kwargs={}, overwrite=False, **kwargs)`
1313

1414
Bases: `BaseLLMCache`
1515

@@ -41,7 +41,7 @@ Semantic Cache for Large Language Models.
4141
* **ValueError** – If the threshold is not between 0 and 1.
4242
* **ValueError** – If existing schema does not match new schema and overwrite is False.
4343

44-
#### *async* acheck(prompt=None, vector=None, num_results=1, return_fields=None, filter_expression=None, distance_threshold=None)
44+
#### `*async* acheck(prompt=None, vector=None, num_results=1, return_fields=None, filter_expression=None, distance_threshold=None)`
4545

4646
Async check the semantic cache for results similar to the specified prompt
4747
or vector.
@@ -82,7 +82,7 @@ response = await cache.acheck(
8282
)
8383
```
8484

85-
#### *async* adrop(ids=None, keys=None)
85+
#### `*async* adrop(ids=None, keys=None)`
8686

8787
Async expire specific entries from the cache by id or specific
8888
Redis key.
@@ -93,7 +93,7 @@ Redis key.
9393
* **Return type:**
9494
None
9595

96-
#### *async* astore(prompt, response, vector=None, metadata=None, filters=None, ttl=None)
96+
#### `*async* astore(prompt, response, vector=None, metadata=None, filters=None, ttl=None)`
9797

9898
Async stores the specified key-value pair in the cache along with metadata.
9999

@@ -126,7 +126,7 @@ key = await cache.astore(
126126
)
127127
```
128128

129-
#### *async* aupdate(key, \*\*kwargs)
129+
#### `*async* aupdate(key, **kwargs)`
130130

131131
Async update specific fields within an existing cache entry. If no fields
132132
are passed, then only the document TTL is refreshed.
@@ -147,7 +147,7 @@ await cache.aupdate(
147147
)
148148
```
149149

150-
#### check(prompt=None, vector=None, num_results=1, return_fields=None, filter_expression=None, distance_threshold=None)
150+
#### `check(prompt=None, vector=None, num_results=1, return_fields=None, filter_expression=None, distance_threshold=None)`
151151

152152
Checks the semantic cache for results similar to the specified prompt
153153
or vector.
@@ -188,22 +188,22 @@ response = cache.check(
188188
)
189189
```
190190

191-
#### clear()
191+
#### `clear()`
192192

193193
Clear the cache of all keys while preserving the index.
194194

195195
* **Return type:**
196196
None
197197

198-
#### delete()
198+
#### `delete()`
199199

200200
Clear the semantic cache of all keys and remove the underlying search
201201
index.
202202

203203
* **Return type:**
204204
None
205205

206-
#### drop(ids=None, keys=None)
206+
#### `drop(ids=None, keys=None)`
207207

208208
Manually expire specific entries from the cache by id or specific
209209
Redis key.
@@ -214,7 +214,7 @@ Redis key.
214214
* **Return type:**
215215
None
216216

217-
#### set_threshold(distance_threshold)
217+
#### `set_threshold(distance_threshold)`
218218

219219
Sets the semantic distance threshold for the cache.
220220

@@ -226,7 +226,7 @@ Sets the semantic distance threshold for the cache.
226226
* **Return type:**
227227
None
228228

229-
#### set_ttl(ttl=None)
229+
#### `set_ttl(ttl=None)`
230230

231231
Set the default TTL, in seconds, for entries in the cache.
232232

@@ -236,7 +236,7 @@ Set the default TTL, in seconds, for entries in the cache.
236236
* **Raises:**
237237
**ValueError** – If the time-to-live value is not an integer.
238238

239-
#### store(prompt, response, vector=None, metadata=None, filters=None, ttl=None)
239+
#### `store(prompt, response, vector=None, metadata=None, filters=None, ttl=None)`
240240

241241
Stores the specified key-value pair in the cache along with metadata.
242242

@@ -269,7 +269,7 @@ key = cache.store(
269269
)
270270
```
271271

272-
#### update(key, \*\*kwargs)
272+
#### `update(key, **kwargs)`
273273

274274
Update specific fields within an existing cache entry. If no fields
275275
are passed, then only the document TTL is refreshed.
@@ -288,7 +288,7 @@ cache.update(key, metadata={"hit_count": 1, "model_name": "Llama-2-7b"})
288288
)
289289
```
290290

291-
#### *property* aindex *: [AsyncSearchIndex]({{< relref "searchindex/#asyncsearchindex" >}}) | None*
291+
#### `*property* aindex *: [AsyncSearchIndex]({{< relref "searchindex/#asyncsearchindex" >}}) | None*`
292292

293293
The underlying AsyncSearchIndex for the cache.
294294

@@ -297,7 +297,7 @@ The underlying AsyncSearchIndex for the cache.
297297
* **Return type:**
298298
[AsyncSearchIndex]({{< relref "searchindex/#asyncsearchindex" >}})
299299

300-
#### *property* distance_threshold *: float*
300+
#### `*property* distance_threshold *: float*`
301301

302302
The semantic distance threshold for the cache.
303303

@@ -306,7 +306,7 @@ The semantic distance threshold for the cache.
306306
* **Return type:**
307307
float
308308

309-
#### *property* index *: [SearchIndex]({{< relref "searchindex/#searchindex" >}})*
309+
#### `*property* index *: [SearchIndex]({{< relref "searchindex/#searchindex" >}})*`
310310

311311
The underlying SearchIndex for the cache.
312312

@@ -315,6 +315,6 @@ The underlying SearchIndex for the cache.
315315
* **Return type:**
316316
[SearchIndex]({{< relref "searchindex/#searchindex" >}})
317317

318-
#### *property* ttl *: int | None*
318+
#### `*property* ttl *: int | None*`
319319

320320
The default TTL, in seconds, for entries in the cache.

content/integrate/redisvl/api/filter.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type: integration
99

1010
## FilterExpression
1111

12-
### *class* FilterExpression(\_filter=None, operator=None, left=None, right=None)
12+
### `*class* FilterExpression(_filter=None, operator=None, left=None, right=None)`
1313

1414
A FilterExpression is a logical combination of filters in RedisVL.
1515

@@ -44,7 +44,7 @@ v = VectorQuery(
4444
)
4545
```
4646

47-
#### NOTE
47+
#### `NOTE`
4848
Filter expressions are typically not called directly. Instead they are
4949
built by combining filter statements using the & and | operators.
5050

@@ -56,14 +56,14 @@ built by combining filter statements using the & and | operators.
5656

5757
## Tag
5858

59-
### *class* Tag(field)
59+
### `*class* Tag(field)`
6060

6161
A Tag filter can be applied to Tag fields
6262

6363
* **Parameters:**
6464
**field** (*str*)
6565

66-
#### \_\_eq_\_(other)
66+
#### `__eq__(other)`
6767

6868
Create a Tag equality filter expression.
6969

@@ -78,7 +78,7 @@ from redisvl.query.filter import Tag
7878
f = Tag("brand") == "nike"
7979
```
8080

81-
#### \_\_ne_\_(other)
81+
#### `__ne__(other)`
8282

8383
Create a Tag inequality filter expression.
8484

@@ -92,7 +92,7 @@ from redisvl.query.filter import Tag
9292
f = Tag("brand") != "nike"
9393
```
9494

95-
#### \_\_str_\_()
95+
#### `__str__()`
9696

9797
Return the Redis Query string for the Tag filter
9898

@@ -101,14 +101,14 @@ Return the Redis Query string for the Tag filter
101101

102102
## Text
103103

104-
### *class* Text(field)
104+
### `*class* Text(field)`
105105

106106
A Text is a FilterField representing a text field in a Redis index.
107107

108108
* **Parameters:**
109109
**field** (*str*)
110110

111-
#### \_\_eq_\_(other)
111+
#### `__eq__(other)`
112112

113113
Create a Text equality filter expression. These expressions yield
114114
filters that enforce an exact match on the supplied term(s).
@@ -124,7 +124,7 @@ from redisvl.query.filter import Text
124124
f = Text("job") == "engineer"
125125
```
126126

127-
#### \_\_mod_\_(other)
127+
#### `__mod__(other)`
128128

129129
Create a Text “LIKE” filter expression. A flexible expression that
130130
yields filters that can use a variety of additional operators like
@@ -145,7 +145,7 @@ f = Text("job") % "engineer|doctor" # contains either term in field
145145
f = Text("job") % "engineer doctor" # contains both terms in field
146146
```
147147

148-
#### \_\_ne_\_(other)
148+
#### `__ne__(other)`
149149

150150
Create a Text inequality filter expression. These expressions yield
151151
negated filters on exact matches on the supplied term(s). Opposite of an
@@ -162,7 +162,7 @@ from redisvl.query.filter import Text
162162
f = Text("job") != "engineer"
163163
```
164164

165-
#### \_\_str_\_()
165+
#### `__str__()`
166166

167167
Return the Redis Query string for the Text filter
168168

@@ -171,14 +171,14 @@ Return the Redis Query string for the Text filter
171171

172172
## Num
173173

174-
### *class* Num(field)
174+
### `*class* Num(field)`
175175

176176
A Num is a FilterField representing a numeric field in a Redis index.
177177

178178
* **Parameters:**
179179
**field** (*str*)
180180

181-
#### \_\_eq_\_(other)
181+
#### `__eq__(other)`
182182

183183
Create a Numeric equality filter expression.
184184

@@ -192,7 +192,7 @@ from redisvl.query.filter import Num
192192
f = Num("zipcode") == 90210
193193
```
194194

195-
#### \_\_ge_\_(other)
195+
#### `__ge__(other)`
196196

197197
Create a Numeric greater than or equal to filter expression.
198198

@@ -207,7 +207,7 @@ from redisvl.query.filter import Num
207207
f = Num("age") >= 18
208208
```
209209

210-
#### \_\_gt_\_(other)
210+
#### `__gt__(other)`
211211

212212
Create a Numeric greater than filter expression.
213213

@@ -222,7 +222,7 @@ from redisvl.query.filter import Num
222222
f = Num("age") > 18
223223
```
224224

225-
#### \_\_le_\_(other)
225+
#### `__le__(other)`
226226

227227
Create a Numeric less than or equal to filter expression.
228228

@@ -237,7 +237,7 @@ from redisvl.query.filter import Num
237237
f = Num("age") <= 18
238238
```
239239

240-
#### \_\_lt_\_(other)
240+
#### `__lt__(other)`
241241

242242
Create a Numeric less than filter expression.
243243

@@ -252,7 +252,7 @@ from redisvl.query.filter import Num
252252
f = Num("age") < 18
253253
```
254254

255-
#### \_\_ne_\_(other)
255+
#### `__ne__(other)`
256256

257257
Create a Numeric inequality filter expression.
258258

@@ -267,7 +267,7 @@ from redisvl.query.filter import Num
267267
f = Num("zipcode") != 90210
268268
```
269269

270-
#### \_\_str_\_()
270+
#### `__str__()`
271271

272272
Return the Redis Query string for the Numeric filter
273273

@@ -276,15 +276,15 @@ Return the Redis Query string for the Numeric filter
276276

277277
## Geo
278278

279-
### *class* Geo(field)
279+
### `*class* Geo(field)`
280280

281281
A Geo is a FilterField representing a geographic (lat/lon) field in a
282282
Redis index.
283283

284284
* **Parameters:**
285285
**field** (*str*)
286286

287-
#### \_\_eq_\_(other)
287+
#### `__eq__(other)`
288288

289289
Create a geographic filter within a specified GeoRadius.
290290

@@ -299,7 +299,7 @@ from redisvl.query.filter import Geo, GeoRadius
299299
f = Geo("location") == GeoRadius(-122.4194, 37.7749, 1, unit="m")
300300
```
301301

302-
#### \_\_ne_\_(other)
302+
#### `__ne__(other)`
303303

304304
Create a geographic filter outside of a specified GeoRadius.
305305

@@ -314,7 +314,7 @@ from redisvl.query.filter import Geo, GeoRadius
314314
f = Geo("location") != GeoRadius(-122.4194, 37.7749, 1, unit="m")
315315
```
316316

317-
#### \_\_str_\_()
317+
#### `__str__()`
318318

319319
Return the Redis Query string for the Geo filter
320320

@@ -323,7 +323,7 @@ Return the Redis Query string for the Geo filter
323323

324324
## GeoRadius
325325

326-
### *class* GeoRadius(longitude, latitude, radius=1, unit='km')
326+
### `*class* GeoRadius(longitude, latitude, radius=1, unit='km')`
327327

328328
A GeoRadius is a GeoSpec representing a geographic radius.
329329

@@ -337,7 +337,7 @@ Create a GeoRadius specification (GeoSpec)
337337
* **Raises:**
338338
**ValueError** – If the unit is not one of “m”, “km”, “mi”, or “ft”.
339339

340-
#### \_\_init_\_(longitude, latitude, radius=1, unit='km')
340+
#### `__init__(longitude, latitude, radius=1, unit='km')`
341341

342342
Create a GeoRadius specification (GeoSpec)
343343

0 commit comments

Comments
 (0)