Open
Description
Within Claude AI you can pass a attribute for caching.
$data = [
"model" => "claude-3-5-sonnet-20240620",
"max_tokens" => 1024,
"messages" => [
[
"role" => "user",
"content" => [
[
"type" => "text",
"text" => $prompt,
]
]
],
[
"role" => "assistant",
"content" => [
[
"type" => "tool_use",
"id" => "tool_1",
"name" => "get_weather",
"input" => [
"location" => "Amsterdam"
],
"cache_control" => ["type" => "ephemeral"] // Cache the tool call
]
]
],
[
"role" => "user",
"content" => [
[
"type" => "text",
"text" => $question
]
]
]
]
];
I can't find how to do this. Is this possible? If not, is it possible to add?
Thanks