Skip to content

Commit 8218d39

Browse files
DOC-5996 added Langcache flush example
1 parent 4dd67d6 commit 8218d39

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

content/develop/ai/langcache/api-examples.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,13 @@ DELETE https://[host]/v1/caches/{cacheId}/entries
140140
}
141141
}
142142
{{< /clients-example >}}
143+
144+
### Flush the cache
145+
146+
Use
147+
[POST /v1/caches/{cacheId}/flush](https://redis.io/docs/latest/develop/ai/langcache/api-reference/#tag/Cache-Entries/operation/flush)
148+
to flush all entries from the cache.
149+
150+
{{< clients-example set="langcache_sdk" step="flush" dft_tab_name="REST API" footer="hide" >}}
151+
POST https://[host]/v1/caches/{cacheId}/flush
152+
{{< /clients-example >}}

local_examples/langcache/langcache_sdk.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,11 @@ async function deleteQuery() {
108108

109109
deleteQuery();
110110
// STEP_END
111+
112+
// STEP_START flush
113+
async function flush() {
114+
await langCache.flush();
115+
}
116+
117+
flush();
118+
// STEP_END

local_examples/langcache/langcache_sdk.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,7 @@
7373

7474
print(res)
7575
# STEP_END
76+
77+
# STEP_START flush
78+
lang_cache.flush()
79+
# STEP_END

0 commit comments

Comments
 (0)