You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/providers/gemini.md
+42Lines changed: 42 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,48 @@ foreach ($response->additionalContent['groundingSupports'] as $part) {
77
77
// Pass $text and $footnotes to your frontend.
78
78
```
79
79
80
+
## Caching
81
+
82
+
Prism supports Gemini prompt caching, though due to Gemini requiring you first upload the cached content, it works a little differently to other providers.
83
+
84
+
To store content in the cache, use the Gemini provider cache method as follows:
85
+
86
+
```php
87
+
88
+
use Prism\Prism\Enums\Provider;
89
+
use Prism\Prism\Prism;
90
+
use Prism\Prism\Providers\Gemini\Gemini;
91
+
use Prism\Prism\ValueObjects\Messages\Support\Document;
92
+
use Prism\Prism\ValueObjects\Messages\SystemMessage;
93
+
use Prism\Prism\ValueObjects\Messages\UserMessage;
0 commit comments