Skip to content

3.2.12

Choose a tag to compare

@ilvalerione ilvalerione released this 26 Mar 15:11
· 319 commits to 3.x since this release

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...']
        ]);
    }
}