Skip to content

update for redisvl 0.8.0 #1809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions content/develop/ai/redisvl/api/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ linkTitle: RedisVL API
title: RedisVL API
weight: 5
hideListLinks: true
aliases:
- /integrate/redisvl/api
---


Expand Down Expand Up @@ -59,6 +57,3 @@ Reference documentation for the RedisVL API.
* [Route](router/#route)
* [Route Match](router/#route-match)
* [Distance Aggregation Method](router/#distance-aggregation-method)
* [Threshold Optimizers](threshold_optimizer/)
* [CacheThresholdOptimizer](threshold_optimizer/#cachethresholdoptimizer)
* [RouterThresholdOptimizer](threshold_optimizer/#routerthresholdoptimizer)
15 changes: 7 additions & 8 deletions content/develop/ai/redisvl/api/cache.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
linkTitle: LLM cache
title: LLM Cache
aliases:
- /integrate/redisvl/api/cache
---


Expand Down Expand Up @@ -79,7 +77,7 @@ LLM responses.

```python
response = await cache.acheck(
prompt="What is the captial city of France?"
prompt="What is the capital city of France?"
)
```

Expand Down Expand Up @@ -169,7 +167,7 @@ Async stores the specified key-value pair in the cache along with metadata.

```python
key = await cache.astore(
prompt="What is the captial city of France?",
prompt="What is the capital city of France?",
response="Paris",
metadata={"city": "Paris", "country": "France"}
)
Expand Down Expand Up @@ -233,7 +231,7 @@ LLM responses.

```python
response = cache.check(
prompt="What is the captial city of France?"
prompt="What is the capital city of France?"
)
```

Expand Down Expand Up @@ -347,7 +345,7 @@ Stores the specified key-value pair in the cache along with metadata.

```python
key = cache.store(
prompt="What is the captial city of France?",
prompt="What is the capital city of France?",
response="Paris",
metadata={"city": "Paris", "country": "France"}
)
Expand Down Expand Up @@ -408,7 +406,7 @@ The default TTL, in seconds, for entries in the cache.

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

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

Bases: `BaseCache`

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

Expand Down
2 changes: 0 additions & 2 deletions content/develop/ai/redisvl/api/filter.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
linkTitle: Filter
title: Filter
aliases:
- /integrate/redisvl/api/filter
---


Expand Down
4 changes: 1 addition & 3 deletions content/develop/ai/redisvl/api/message_history.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
linkTitle: LLM message history
title: LLM Message History
aliases:
- /integrate/redisvl/api/message_history
---


Expand Down Expand Up @@ -93,7 +91,7 @@ Remove a specific exchange from the message history.

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

Retreive the recent message history in sequential order.
Retrieve the recent message history in sequential order.

* **Parameters:**
* **top_k** (*int*) – The number of previous exchanges to return. Default is 5.
Expand Down
14 changes: 11 additions & 3 deletions content/develop/ai/redisvl/api/query.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
linkTitle: Query
title: Query
aliases:
- /integrate/redisvl/api/query
---


Expand Down Expand Up @@ -174,6 +172,8 @@ Add fields to return fields.
Use a different scoring function to evaluate document relevance.
Default is TFIDF.

Since Redis 8.0 default was changed to BM25STD.

* **Parameters:**
**scorer** (*str*) – The scoring function to use
(e.g. TFIDF.DOCNORM or BM25)
Expand Down Expand Up @@ -488,6 +488,8 @@ Add fields to return fields.
Use a different scoring function to evaluate document relevance.
Default is TFIDF.

Since Redis 8.0 default was changed to BM25STD.

* **Parameters:**
**scorer** (*str*) – The scoring function to use
(e.g. TFIDF.DOCNORM or BM25)
Expand Down Expand Up @@ -934,7 +936,7 @@ A query for running a full text search, along with an optional filter expression
* **text_field_name** (*str*) – The name of the document field to perform text search on.
* **text_scorer** (*str* *,* *optional*) – The text scoring algorithm to use.
Defaults to BM25STD. Options are {TFIDF, BM25STD, BM25, TFIDF.DOCNORM, DISMAX, DOCSCORE}.
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/)
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/)
* **filter_expression** (*Union* *[* *str* *,* [*FilterExpression*]({{< relref "filter/#filterexpression" >}}) *]* *,* *optional*) – A filter to apply
along with the text search. Defaults to None.
* **return_fields** (*List* *[* *str* *]*) – The declared fields to return with search
Expand Down Expand Up @@ -1070,6 +1072,8 @@ Add fields to return fields.
Use a different scoring function to evaluate document relevance.
Default is TFIDF.

Since Redis 8.0 default was changed to BM25STD.

* **Parameters:**
**scorer** (*str*) – The scoring function to use
(e.g. TFIDF.DOCNORM or BM25)
Expand Down Expand Up @@ -1282,6 +1286,8 @@ Add fields to return fields.
Use a different scoring function to evaluate document relevance.
Default is TFIDF.

Since Redis 8.0 default was changed to BM25STD.

* **Parameters:**
**scorer** (*str*) – The scoring function to use
(e.g. TFIDF.DOCNORM or BM25)
Expand Down Expand Up @@ -1499,6 +1505,8 @@ Add fields to return fields.
Use a different scoring function to evaluate document relevance.
Default is TFIDF.

Since Redis 8.0 default was changed to BM25STD.

* **Parameters:**
**scorer** (*str*) – The scoring function to use
(e.g. TFIDF.DOCNORM or BM25)
Expand Down
2 changes: 0 additions & 2 deletions content/develop/ai/redisvl/api/reranker.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
linkTitle: Rerankers
title: Rerankers
aliases:
- /integrate/redisvl/api/reranker
---


Expand Down
6 changes: 2 additions & 4 deletions content/develop/ai/redisvl/api/router.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
linkTitle: Semantic router
title: Semantic Router
aliases:
- /integrate/redisvl/api/router
---


Expand All @@ -21,7 +19,7 @@ Initialize the SemanticRouter.
* **routes** (*List* *[*[Route](#route) *]*) – List of Route objects.
* **vectorizer** (*BaseVectorizer* *,* *optional*) – The vectorizer used to embed route references. Defaults to default HFTextVectorizer.
* **routing_config** ([RoutingConfig](#routingconfig) *,* *optional*) – Configuration for routing behavior. Defaults to the default RoutingConfig.
* **redis_client** (*Optional* *[* *Redis* *]* *,* *optional*) – Redis client for connection. Defaults to None.
* **redis_client** (*Optional* *[* *SyncRedisClient* *]* *,* *optional*) – Redis client for connection. Defaults to None.
* **redis_url** (*str* *,* *optional*) – The redis url. Defaults to redis://localhost:6379.
* **overwrite** (*bool* *,* *optional*) – Whether to overwrite existing index. Defaults to False.
* **connection_kwargs** (*Dict* *[* *str* *,* *Any* *]*) – The connection arguments
Expand Down Expand Up @@ -99,7 +97,7 @@ Return SemanticRouter instance from existing index.

* **Parameters:**
* **name** (*str*)
* **redis_client** (*Redis* *|* *None*)
* **redis_client** (*Redis* *|* *RedisCluster* *|* *None*)
* **redis_url** (*str*)
* **Return type:**
[SemanticRouter](#semanticrouter)
Expand Down
2 changes: 0 additions & 2 deletions content/develop/ai/redisvl/api/schema.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
linkTitle: Schema
title: Schema
aliases:
- /integrate/redisvl/api/schema
---


Expand Down
Loading