Skip to content

Commit 335af2a

Browse files
committed
Merge branch 'main' into DOC-5468
2 parents 1596cad + ce180c1 commit 335af2a

File tree

32 files changed

+579
-531
lines changed

32 files changed

+579
-531
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,10 @@ jobs:
193193
bucket_path=`echo "version/${{ github.ref_name }}" | sed 's/-build$//'`
194194
else
195195
bucket_path=staging/${{ github.ref_name }}
196-
fi \
197-
&& gsutil -m rsync -r -c -j html -d ${{ github.workspace }}/public gs://$BUCKET/$bucket_path
196+
fi
197+
198+
gsutil -m rsync -r -c -j html -d ${{ github.workspace }}/public gs://$BUCKET/$bucket_path
199+
gsutil -m rsync -r -c -j html -d ${{ github.workspace }}/public gs://$BUCKET/docs/$bucket_path
198200
199201
if [[ "${{ github.ref_name }}" == "latest" ]]
200202
then
@@ -203,8 +205,10 @@ jobs:
203205
product=$(awk 'BEGIN{FS=OFS="-"}{NF--; print}' <<< $versioned_build)
204206
if [[ "${product}" == "redis-data-integration" ]]; then
205207
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/${versioned_build}/integrate/${product}"
208+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/docs/${versioned_build}/integrate/${product}"
206209
else
207210
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${versioned_build}/operate/${product}"
211+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/docs/${versioned_build}/operate/${product}"
208212
fi
209213
done
210214
fi
@@ -216,8 +220,10 @@ jobs:
216220
product=$(awk 'BEGIN{FS=OFS="-"}{NF--; print}' <<< $versioned_build)
217221
if [[ "${product}" == "redis-data-integration" ]]; then
218222
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/${bucket_path}/${versioned_build}/integrate/${product}"
223+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/docs/${bucket_path}/${versioned_build}/integrate/${product}"
219224
else
220225
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${bucket_path}/${versioned_build}/operate/${product}"
226+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/docs/${bucket_path}/${versioned_build}/operate/${product}"
221227
fi
222228
done
223229
fi

content/develop/ai/redisvl/api/_index.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
linkTitle: RedisVL API
33
title: RedisVL API
4-
weight: 5
5-
hideListLinks: true
64
aliases:
75
- /integrate/redisvl/api
6+
weight: 5
7+
hideListLinks: true
88
---
99

1010

@@ -59,6 +59,3 @@ Reference documentation for the RedisVL API.
5959
* [Route](router/#route)
6060
* [Route Match](router/#route-match)
6161
* [Distance Aggregation Method](router/#distance-aggregation-method)
62-
* [Threshold Optimizers](threshold_optimizer/)
63-
* [CacheThresholdOptimizer](threshold_optimizer/#cachethresholdoptimizer)
64-
* [RouterThresholdOptimizer](threshold_optimizer/#routerthresholdoptimizer)

content/develop/ai/redisvl/api/cache.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ LLM responses.
7979

8080
```python
8181
response = await cache.acheck(
82-
prompt="What is the captial city of France?"
82+
prompt="What is the capital city of France?"
8383
)
8484
```
8585

@@ -169,7 +169,7 @@ Async stores the specified key-value pair in the cache along with metadata.
169169

170170
```python
171171
key = await cache.astore(
172-
prompt="What is the captial city of France?",
172+
prompt="What is the capital city of France?",
173173
response="Paris",
174174
metadata={"city": "Paris", "country": "France"}
175175
)
@@ -233,7 +233,7 @@ LLM responses.
233233

234234
```python
235235
response = cache.check(
236-
prompt="What is the captial city of France?"
236+
prompt="What is the capital city of France?"
237237
)
238238
```
239239

@@ -347,7 +347,7 @@ Stores the specified key-value pair in the cache along with metadata.
347347

348348
```python
349349
key = cache.store(
350-
prompt="What is the captial city of France?",
350+
prompt="What is the capital city of France?",
351351
response="Paris",
352352
metadata={"city": "Paris", "country": "France"}
353353
)
@@ -408,7 +408,7 @@ The default TTL, in seconds, for entries in the cache.
408408

409409
<a id="embeddings-cache-api"></a>
410410

411-
### `class EmbeddingsCache(name='embedcache', ttl=None, redis_client=None, redis_url='redis://localhost:6379', connection_kwargs={})`
411+
### `class EmbeddingsCache(name='embedcache', ttl=None, redis_client=None, async_redis_client=None, redis_url='redis://localhost:6379', connection_kwargs={})`
412412

413413
Bases: `BaseCache`
414414

@@ -419,9 +419,10 @@ Initialize an embeddings cache.
419419
* **Parameters:**
420420
* **name** (*str*) – The name of the cache. Defaults to “embedcache”.
421421
* **ttl** (*Optional* *[* *int* *]*) – The time-to-live for cached embeddings. Defaults to None.
422-
* **redis_client** (*Optional* *[* *Redis* *]*) – Redis client instance. Defaults to None.
422+
* **redis_client** (*Optional* *[* *SyncRedisClient* *]*) – Redis client instance. Defaults to None.
423423
* **redis_url** (*str*) – Redis URL for connection. Defaults to “redis://localhost:6379”.
424424
* **connection_kwargs** (*Dict* *[* *str* *,* *Any* *]*) – Redis connection arguments. Defaults to {}.
425+
* **async_redis_client** (*Redis* *|* *RedisCluster* *|* *None*)
425426
* **Raises:**
426427
**ValueError** – If vector dimensions are invalid
427428

content/develop/ai/redisvl/api/message_history.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Remove a specific exchange from the message history.
9393

9494
#### `get_recent(top_k=5, as_text=False, raw=False, session_tag=None)`
9595

96-
Retreive the recent message history in sequential order.
96+
Retrieve the recent message history in sequential order.
9797

9898
* **Parameters:**
9999
* **top_k** (*int*) – The number of previous exchanges to return. Default is 5.

content/develop/ai/redisvl/api/query.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ Add fields to return fields.
174174
Use a different scoring function to evaluate document relevance.
175175
Default is TFIDF.
176176

177+
Since Redis 8.0 default was changed to BM25STD.
178+
177179
* **Parameters:**
178180
**scorer** (*str*) – The scoring function to use
179181
(e.g. TFIDF.DOCNORM or BM25)
@@ -488,6 +490,8 @@ Add fields to return fields.
488490
Use a different scoring function to evaluate document relevance.
489491
Default is TFIDF.
490492

493+
Since Redis 8.0 default was changed to BM25STD.
494+
491495
* **Parameters:**
492496
**scorer** (*str*) – The scoring function to use
493497
(e.g. TFIDF.DOCNORM or BM25)
@@ -934,7 +938,7 @@ A query for running a full text search, along with an optional filter expression
934938
* **text_field_name** (*str*) – The name of the document field to perform text search on.
935939
* **text_scorer** (*str* *,* *optional*) – The text scoring algorithm to use.
936940
Defaults to BM25STD. Options are {TFIDF, BM25STD, BM25, TFIDF.DOCNORM, DISMAX, DOCSCORE}.
937-
See [https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/scoring/](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/scoring/)
941+
See [https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/scoring/](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/scoring/)
938942
* **filter_expression** (*Union* *[* *str* *,* [*FilterExpression*]({{< relref "filter/#filterexpression" >}}) *]* *,* *optional*) – A filter to apply
939943
along with the text search. Defaults to None.
940944
* **return_fields** (*List* *[* *str* *]*) – The declared fields to return with search
@@ -1070,6 +1074,8 @@ Add fields to return fields.
10701074
Use a different scoring function to evaluate document relevance.
10711075
Default is TFIDF.
10721076

1077+
Since Redis 8.0 default was changed to BM25STD.
1078+
10731079
* **Parameters:**
10741080
**scorer** (*str*) – The scoring function to use
10751081
(e.g. TFIDF.DOCNORM or BM25)
@@ -1282,6 +1288,8 @@ Add fields to return fields.
12821288
Use a different scoring function to evaluate document relevance.
12831289
Default is TFIDF.
12841290

1291+
Since Redis 8.0 default was changed to BM25STD.
1292+
12851293
* **Parameters:**
12861294
**scorer** (*str*) – The scoring function to use
12871295
(e.g. TFIDF.DOCNORM or BM25)
@@ -1499,6 +1507,8 @@ Add fields to return fields.
14991507
Use a different scoring function to evaluate document relevance.
15001508
Default is TFIDF.
15011509

1510+
Since Redis 8.0 default was changed to BM25STD.
1511+
15021512
* **Parameters:**
15031513
**scorer** (*str*) – The scoring function to use
15041514
(e.g. TFIDF.DOCNORM or BM25)

content/develop/ai/redisvl/api/router.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Initialize the SemanticRouter.
2121
* **routes** (*List* *[*[Route](#route) *]*) – List of Route objects.
2222
* **vectorizer** (*BaseVectorizer* *,* *optional*) – The vectorizer used to embed route references. Defaults to default HFTextVectorizer.
2323
* **routing_config** ([RoutingConfig](#routingconfig) *,* *optional*) – Configuration for routing behavior. Defaults to the default RoutingConfig.
24-
* **redis_client** (*Optional* *[* *Redis* *]* *,* *optional*) – Redis client for connection. Defaults to None.
24+
* **redis_client** (*Optional* *[* *SyncRedisClient* *]* *,* *optional*) – Redis client for connection. Defaults to None.
2525
* **redis_url** (*str* *,* *optional*) – The redis url. Defaults to redis://localhost:6379.
2626
* **overwrite** (*bool* *,* *optional*) – Whether to overwrite existing index. Defaults to False.
2727
* **connection_kwargs** (*Dict* *[* *str* *,* *Any* *]*) – The connection arguments
@@ -99,7 +99,7 @@ Return SemanticRouter instance from existing index.
9999

100100
* **Parameters:**
101101
* **name** (*str*)
102-
* **redis_client** (*Redis* *|* *None*)
102+
* **redis_client** (*Redis* *|* *RedisCluster* *|* *None*)
103103
* **redis_url** (*str*)
104104
* **Return type:**
105105
[SemanticRouter](#semanticrouter)

content/develop/ai/redisvl/api/searchindex.md

Lines changed: 53 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ kwargs.
4949

5050
* **Parameters:**
5151
* **schema** ([*IndexSchema*]({{< relref "schema/#indexschema" >}})) – Index schema object.
52-
* **redis_client** (*Optional* *[* *redis.Redis* *]*) – An
52+
* **redis_client** (*Optional* *[* *Redis* *]*) – An
5353
instantiated redis client.
5454
* **redis_url** (*Optional* *[* *str* *]*) – The URL of the Redis server to
5555
connect to.
@@ -89,13 +89,13 @@ This method takes a list of queries and optionally query params and
8989
returns a list of Result objects for each query. Results are
9090
returned in the same order as the queries.
9191

92+
NOTE: Cluster users may need to incorporate hash tags into their query
93+
to avoid cross-slot operations.
94+
9295
* **Parameters:**
93-
* **queries** (*List* *[* *SearchParams* *]*) – The queries to search for. batch_size
94-
* **(* ***int** – The number of queries to search for at a time.
95-
Defaults to 10.
96-
* **optional****)** – The number of queries to search for at a time.
96+
* **queries** (*List* *[* *SearchParams* *]*) – The queries to search for.
97+
* **batch_size** (*int* *,* *optional*) – The number of queries to search for at a time.
9798
Defaults to 10.
98-
* **batch_size** (*int*)
9999
* **Returns:**
100100
The search results for each query.
101101
* **Return type:**
@@ -106,6 +106,10 @@ returned in the same order as the queries.
106106
Clear all keys in Redis associated with the index, leaving the index
107107
available and in-place for future insertions or updates.
108108

109+
NOTE: This method requires custom behavior for Redis Cluster because
110+
here, we can’t easily give control of the keys we’re clearing to the
111+
user so they can separate them based on hash tag.
112+
109113
* **Returns:**
110114
Count of records deleted from Redis.
111115
* **Return type:**
@@ -177,6 +181,10 @@ Remove documents from the index by their document IDs.
177181
This method converts document IDs to Redis keys automatically by applying
178182
the index’s key prefix and separator configuration.
179183

184+
NOTE: Cluster users will need to incorporate hash tags into their
185+
document IDs and only call this method with documents from a single hash
186+
tag at a time.
187+
180188
* **Parameters:**
181189
**ids** (*Union* *[* *str* *,* *List* *[* *str* *]* *]*) – The document ID or IDs to remove from the index.
182190
* **Returns:**
@@ -262,7 +270,7 @@ Initialize from an existing search index in Redis by index name.
262270

263271
* **Parameters:**
264272
* **name** (*str*) – Name of the search index in Redis.
265-
* **redis_client** (*Optional* *[* *redis.Redis* *]*) – An
273+
* **redis_client** (*Optional* *[* *Redis* *]*) – An
266274
instantiated redis client.
267275
* **redis_url** (*Optional* *[* *str* *]*) – The URL of the Redis server to
268276
connect to.
@@ -437,12 +445,12 @@ Async Redis client. It is useful for cases where an external,
437445
custom-configured client is preferred instead of creating a new one.
438446

439447
* **Parameters:**
440-
**redis_client** (*redis.Redis*) – A Redis or Async Redis
448+
**redis_client** (*Redis*) – A Redis or Async Redis
441449
client instance to be used for the connection.
442450
* **Raises:**
443451
**TypeError** – If the provided client is not valid.
444452

445-
#### `property client: Redis | None`
453+
#### `property client: Redis | RedisCluster | None`
446454

447455
The underlying redis-py client object.
448456

@@ -504,7 +512,7 @@ Initialize the RedisVL async search index with a schema.
504512
* **schema** ([*IndexSchema*]({{< relref "schema/#indexschema" >}})) – Index schema object.
505513
* **redis_url** (*Optional* *[* *str* *]* *,* *optional*) – The URL of the Redis server to
506514
connect to.
507-
* **redis_client** (*Optional* *[* *aredis.Redis* *]*) – An
515+
* **redis_client** (*Optional* *[* *AsyncRedis* *]*) – An
508516
instantiated redis client.
509517
* **connection_kwargs** (*Optional* *[* *Dict* *[* *str* *,* *Any* *]* *]*) – Redis client connection
510518
args.
@@ -536,28 +544,42 @@ Asynchronously execute a batch of queries and process results.
536544

537545
#### `async batch_search(queries, batch_size=10)`
538546

539-
Perform a search against the index for multiple queries.
547+
Asynchronously execute a batch of search queries.
548+
549+
This method takes a list of search queries and executes them in batches
550+
to improve performance when dealing with multiple queries.
540551

541-
This method takes a list of queries and returns a list of Result objects
542-
for each query. Results are returned in the same order as the queries.
552+
NOTE: Cluster users may need to incorporate hash tags into their query
553+
to avoid cross-slot operations.
543554

544555
* **Parameters:**
545-
* **queries** (*List* *[* *SearchParams* *]*) – The queries to search for. batch_size
546-
* **(* ***int** – The number of queries to search for at a time.
547-
Defaults to 10.
548-
* **optional****)** – The number of queries to search for at a time.
549-
Defaults to 10.
550-
* **batch_size** (*int*)
556+
* **queries** (*List* *[* *SearchParams* *]*) – A list of search queries to execute.
557+
Each query can be either a string or a tuple of (query, params).
558+
* **batch_size** (*int* *,* *optional*) – The number of queries to execute in each
559+
batch. Defaults to 10.
551560
* **Returns:**
552-
The search results for each query.
561+
A list of search results corresponding to each query.
553562
* **Return type:**
554563
List[Result]
555564

565+
```python
566+
queries = [
567+
"hello world",
568+
("goodbye world", {"num_results": 5}),
569+
]
570+
571+
results = await index.batch_search(queries)
572+
```
573+
556574
#### `async clear()`
557575

558576
Clear all keys in Redis associated with the index, leaving the index
559577
available and in-place for future insertions or updates.
560578

579+
NOTE: This method requires custom behavior for Redis Cluster because here,
580+
we can’t easily give control of the keys we’re clearing to the user so they
581+
can separate them based on hash tag.
582+
561583
* **Returns:**
562584
Count of records deleted from Redis.
563585
* **Return type:**
@@ -618,6 +640,10 @@ Remove documents from the index by their document IDs.
618640
This method converts document IDs to Redis keys automatically by applying
619641
the index’s key prefix and separator configuration.
620642

643+
NOTE: Cluster users will need to incorporate hash tags into their
644+
document IDs and only call this method with documents from a single hash
645+
tag at a time.
646+
621647
* **Parameters:**
622648
**ids** (*Union* *[* *str* *,* *List* *[* *str* *]* *]*) – The document ID or IDs to remove from the index.
623649
* **Returns:**
@@ -701,7 +727,7 @@ Initialize from an existing search index in Redis by index name.
701727

702728
* **Parameters:**
703729
* **name** (*str*) – Name of the search index in Redis.
704-
* **redis_client** (*Optional* *[* *redis.Redis* *]*) – An
730+
* **redis_client** (*Optional* *[* *Redis* *]*) – An
705731
instantiated redis client.
706732
* **redis_url** (*Optional* *[* *str* *]*) – The URL of the Redis server to
707733
connect to.
@@ -873,11 +899,11 @@ results = await index.query(query)
873899

874900
#### `async search(*args, **kwargs)`
875901

876-
Perform a search on this index.
902+
Perform an async search against the index.
877903

878-
Wrapper around redis.search.Search that adds the index name
879-
to the search query and passes along the rest of the arguments
880-
to the redis-py ft.search() method.
904+
Wrapper around the search API that adds the index name
905+
to the query and passes along the rest of the arguments
906+
to the redis-py ft().search() method.
881907

882908
* **Returns:**
883909
Raw Redis search results.
@@ -890,9 +916,9 @@ to the redis-py ft.search() method.
890916
This method is deprecated; please provide connection parameters in \_\_init_\_.
891917

892918
* **Parameters:**
893-
**redis_client** (*Redis* *|* *Redis*)
919+
**redis_client** (*Redis* *|* *RedisCluster* *|* *Redis* *|* *RedisCluster*)
894920

895-
#### `property client: Redis | None`
921+
#### `property client: Redis | RedisCluster | None`
896922

897923
The underlying redis-py client object.
898924

content/develop/ai/redisvl/api/vectorizer.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ embeddings for text data.
545545
This vectorizer is designed to accept a provided callable text vectorizer and
546546
provides a class definition to allow for compatibility with RedisVL.
547547
The vectorizer may support both synchronous and asynchronous operations which
548-
allows for batch processing of texts, but at a minimum only syncronous embedding
548+
allows for batch processing of texts, but at a minimum only synchronous embedding
549549
is required to satisfy the ‘embed()’ method.
550550

551551
You can optionally enable caching to improve performance when generating
@@ -585,8 +585,8 @@ Initialize the Custom vectorizer.
585585
* **Parameters:**
586586
* **embed** (*Callable*) – a Callable function that accepts a string object and returns a list of floats.
587587
* **embed_many** (*Optional* *[* *Callable* *]*) – a Callable function that accepts a list of string objects and returns a list containing lists of floats. Defaults to None.
588-
* **aembed** (*Optional* *[* *Callable* *]*) – an asyncronous Callable function that accepts a string object and returns a lists of floats. Defaults to None.
589-
* **aembed_many** (*Optional* *[* *Callable* *]*) – an asyncronous Callable function that accepts a list of string objects and returns a list containing lists of floats. Defaults to None.
588+
* **aembed** (*Optional* *[* *Callable* *]*) – an asynchronous Callable function that accepts a string object and returns a lists of floats. Defaults to None.
589+
* **aembed_many** (*Optional* *[* *Callable* *]*) – an asynchronous Callable function that accepts a list of string objects and returns a list containing lists of floats. Defaults to None.
590590
* **dtype** (*str*) – the default datatype to use when embedding text as byte arrays.
591591
Used when setting as_buffer=True in calls to embed() and embed_many().
592592
Defaults to ‘float32’.

0 commit comments

Comments
 (0)