perf(claude): the prompt caching is used by default (#413)
This commit is contained in:
parent
6b11ac7fd5
commit
0c9e715829
@ -28,12 +28,9 @@ M.parse_message = function(prompt_opts)
|
|||||||
local user_prompt_obj = {
|
local user_prompt_obj = {
|
||||||
type = "text",
|
type = "text",
|
||||||
text = user_prompt,
|
text = user_prompt,
|
||||||
|
cache_control = { type = "ephemeral" },
|
||||||
}
|
}
|
||||||
|
|
||||||
if Utils.tokens.calculate_tokens(user_prompt_obj.text) > 1024 then
|
|
||||||
user_prompt_obj.cache_control = { type = "ephemeral" }
|
|
||||||
end
|
|
||||||
|
|
||||||
table.insert(message_content, user_prompt_obj)
|
table.insert(message_content, user_prompt_obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user