Skip to content

Add claude cache control docs#2737

Merged
reynaldichernando merged 5 commits intoHeyPuter:mainfrom
reynaldichernando:claude-cache-control
Mar 27, 2026
Merged

Add claude cache control docs#2737
reynaldichernando merged 5 commits intoHeyPuter:mainfrom
reynaldichernando:claude-cache-control

Conversation

@reynaldichernando
Copy link
Copy Markdown
Member

@reynaldichernando reynaldichernando commented Mar 27, 2026

  • add prompt caching section in ai chat docs (only anthropic for now)
  • add example
  • add playground example

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md with 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.

Comment thread src/docs/src/AI/chat.md Outdated
Comment thread src/docs/src/AI/chat.md Outdated
Comment thread src/docs/src/AI/chat.md
Comment thread src/docs/src/playground/examples/ai-claude-cache-control.html
Comment thread src/docs/src/examples.js Outdated
reynaldichernando and others added 3 commits March 27, 2026 17:34
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>
@reynaldichernando reynaldichernando merged commit 14ed1b6 into HeyPuter:main Mar 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants