Repository navigation
Replies: 3 comments
|
After checking the current implementation, it seems that it is impossible to update the cache with the same key. Because the key here is not the primary key, in scalar storage, its pk is an auto-increment id, so if the same key is put twice, there will be two cache records. There is currently no way to update this key unless you manually update the information in scalar storage. |
Draft A — GPTCache #649Question: How to update the cache for the same key using the PUT api? AnswerGPTCache's REST API ( Example: # initial POST (insert)
curl -X POST http://127.0.0.1:8000/cache \
-H "Content-Type: application/json" \
-d '{"prompt": "What is the capital of France?", "answer": "Paris"}'
# later PUT with the same prompt (update the cached answer)
curl -X PUT http://127.0.0.1:8000/cache \
-H "Content-Type: application/json" \
-d '{"prompt": "What is the capital of France?", "answer": "Paris — updated"}'Notes:
TL;DR
Draft for your review — approve and I'll post it. |
Draft A — GPTCache #649Question: How to update the cache for the same key using the PUT api? AnswerGPTCache's REST API ( Example: # initial POST (insert)
curl -X POST http://127.0.0.1:8000/cache \
-H "Content-Type: application/json" \
-d '{"prompt": "What is the capital of France?", "answer": "Paris"}'
# later PUT with the same prompt (update the cached answer)
curl -X PUT http://127.0.0.1:8000/cache \
-H "Content-Type: application/json" \
-d '{"prompt": "What is the capital of France?", "answer": "Paris — updated"}'Notes:
TL;DR
|
Uh oh!
There was an error while loading. Please reload this page.
I'm attempting to modify the value associated with a specific key within my Redis cache using the PUT API. However, despite successfully updating the value, I'm still retrieving the previous value when I query the key. My data manager utilizes Redis for scalar storage and Milvus for embeddings. Is there a method to effectively update or delete the key's value within this data management framework?
First update:
key: "123456"
value: Series from 1 to 6
Second update:
key: "123456"
value: Series from 1 to 6 in order
When I use the get API with the key: "123456", then I need to get the latest updated value i.e; Series from 1 to 6 in order
Can anyone help on how to achieve this?
All reactions