Skip to content

Support for Ephemeral cache block type with TTL in AWS BedrockΒ #9014

@kishan0725

Description

@kishan0725

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • I added a very descriptive title to this issue.
  • I searched the LangChain.js documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain.js rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

{
  {
    "type":"text",
    "text":"System prompt goes here...."
  },
  {
    "cachePoint":{
      "type":"ephemeral",
      "ttl":"1h"
    }
  }
}

Error Message and Stack Trace (if applicable)

System message content must be either a string, or an array of text blocks, optionally including a cache point.

Description

I'm getting an error when trying to use Anthropic's 1h cache ttl with ephemeral block. I found that the current @langchain/aws version doesn't have support for that.

Link to Anthropic Docs: https://docs.claude.com/en/docs/build-with-claude/prompt-caching#1-hour-cache-duration

Image

System Info

MacOS 26
langchain/aws = ^0.1.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedThis would make a good PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions