Add claude cache control docs#2737
Merged
reynaldichernando merged 5 commits intoHeyPuter:mainfrom Mar 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds documentation and a runnable playground example demonstrating Anthropic/Claude prompt caching via cache_control, so readers can understand and try cost/latency optimization for repeated long prompts within the Puter.js AI chat API docs.
Changes:
- Added a new playground HTML example showing
cache_control: { type: "ephemeral" }on a long system prompt. - Registered the new example in the docs examples index for discoverability in the playground.
- Expanded
AI/chat.mdwith a “Prompt Caching” section and an accompanying example snippet + links.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/docs/src/playground/examples/ai-claude-cache-control.html |
New runnable playground example demonstrating Claude prompt caching. |
src/docs/src/examples.js |
Adds the new example to the AI examples list. |
src/docs/src/AI/chat.md |
Adds prompt caching documentation and includes the new example + references. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.