3.2.12
Support Anthropic prompt cache
PR #482 by @hudhaifas
class MyAgent extends Agent
{
protected function provider(): AIProviderInterface
{
return new Anthropic(
key: 'ANTHROPIC_KEY',
model: 'ANTHROPIC_MODEL'
)->systemPromptBlocks([
['type' => 'text', 'text' => 'Static instructions...', 'cache_control' => ['type' => 'ephemeral']],
['type' => 'text', 'text' => 'Dynamic context...']
]);
}
}