To use prompt caching, according to the AWS Bedrock documentation, the system message needs to look like this:
...
"system": [
{
"text": "You are an app that creates play lists for a radio station that plays rock and pop music. Only return song names and the artist. "
},
{
"cachePoint": {
"type": "default"
}
}
],
...
However, when trying to do this as a SystemMessage through Langchain, I get the following error:
System message must be a string, instead was: <class 'list'> Traceback (most recent call last):
File "/home/shahar/ProjectData/AgentFramework/onvego/agent_framework/task_handler/internal.py", line 318, in __call__
If I initialize ChatBedrock with the flag beta_use_converse_api=True, then it does let me send a list - but when this list has the cachepoint object as specified:
{
"cachePoint": {
"type": "default",
}
}
I get an error stating:
Parameter validation failed:
Unknown parameter in system[1]: "cachePoint", must be one of: text, guardContent
This seems to make cache prompting impossible, unless I am missing something.
To use prompt caching, according to the AWS Bedrock documentation, the system message needs to look like this:
However, when trying to do this as a
SystemMessagethrough Langchain, I get the following error:If I initialize ChatBedrock with the flag
beta_use_converse_api=True, then it does let me send a list - but when this list has the cachepoint object as specified:{ "cachePoint": { "type": "default", } }I get an error stating:
This seems to make cache prompting impossible, unless I am missing something.