We have tried adding the following in three different versions:
providerOptions: {
openrouter: {
// cache_control also works
// cache_control: { type: 'ephemeral' }
cacheControl: { type: 'ephemeral' },
},
},
experimental_providerMetadata: {
openrouter: {
// cache_control also works
// cache_control: { type: 'ephemeral' }
cacheControl: { type: 'ephemeral' },
},
},
// @ts-ignore
providerMetadata: {
openrouter: {
// cache_control also works
// cache_control: { type: 'ephemeral' }
cacheControl: { type: 'ephemeral' },
},
},
and added directly at the message level as well as individual parts. The caching with open router is not working at all.
We added a hack to override the fetch implementation and overriding the body but even then only the system prompt caching works.
We have tried adding the following in three different versions:
and added directly at the message level as well as individual parts. The caching with open router is not working at all.
We added a hack to override the fetch implementation and overriding the body but even then only the system prompt caching works.