Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (vertex/anthropic): add prompt caching support for Anthropic Claude models in Google Vertex AI SDK #4269

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

caffeinum
Copy link

@caffeinum caffeinum commented Jan 4, 2025

Add support for prompt caching for Anthropic Claude models in the Google Vertex AI SDK.

  • packages/google-vertex/src/anthropic/google-vertex-anthropic-messages-settings.ts

    • Add cacheControl property to GoogleVertexAnthropicMessagesSettings interface.
  • packages/google-vertex/src/anthropic/google-vertex-anthropic-provider.ts

    • Update transformRequestBody function to include cacheControl in the request body.
  • packages/google-vertex/README.md

    • Add a section about prompt caching support for Anthropic Claude models.
    • Include an example demonstrating how to enable prompt caching.

For more details, open the Copilot Workspace session.

…ex AI SDK

Add support for prompt caching for Anthropic Claude models in the Google Vertex AI SDK.

* **`packages/google-vertex/src/anthropic/google-vertex-anthropic-messages-settings.ts`**
  - Add `cacheControl` property to `GoogleVertexAnthropicMessagesSettings` interface.

* **`packages/google-vertex/src/anthropic/google-vertex-anthropic-provider.ts`**
  - Update `transformRequestBody` function to include `cacheControl` in the request body.

* **`packages/google-vertex/README.md`**
  - Add a section about prompt caching support for Anthropic Claude models.
  - Include an example demonstrating how to enable prompt caching.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/vercel/ai?shareId=XXXX-XXXX-XXXX-XXXX).
@caffeinum caffeinum changed the title Add prompt caching support for Anthropic Claude models in Google Vertex AI SDK feat: add prompt caching support for Anthropic Claude models in Google Vertex AI SDK Jan 4, 2025
@caffeinum caffeinum marked this pull request as draft January 4, 2025 15:20
@caffeinum caffeinum changed the title feat: add prompt caching support for Anthropic Claude models in Google Vertex AI SDK feat (vertex/anthropic): add prompt caching support for Anthropic Claude models in Google Vertex AI SDK Jan 4, 2025
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.

1 participant