Skip to content

Commit

Permalink
Expire embeddings data
Browse files Browse the repository at this point in the history
  • Loading branch information
ujh committed Feb 10, 2025
1 parent 721a511 commit d33239b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/embeddings_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def fetch(text)
def fetch_embedding
Rails
.cache
.fetch("embedding:#{digest}") do
.fetch("embedding:#{digest}", expires_in: 1.week) do
response = client.embeddings(parameters: { model: "text-embedding-3-small", input: text })
response.dig("data", 0, "embedding")
end
Expand Down

0 comments on commit d33239b

Please sign in to comment.