Skip to content

Commit

Permalink
AIX: skip Anthropic cache-control on empty system messages
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Jan 10, 2025
1 parent 1ad20a1 commit 3ba9200
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/aix/client/aix.client.chatGenerateRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export async function aixCGR_SystemMessage_FromDMessageOrThrow(

// (on System message) handle the ant-cache-prompt user/auto flags
const mHasAntCacheFlag = messageHasUserFlag(systemInstruction, MESSAGE_FLAG_VND_ANT_CACHE_AUTO) || messageHasUserFlag(systemInstruction, MESSAGE_FLAG_VND_ANT_CACHE_USER);
if (mHasAntCacheFlag)
if (mHasAntCacheFlag
&& sm.parts.length > 0 // added this to avoid settings a cache control on an empty system message
)
sm.parts.push(_clientCreateAixMetaCacheControlPart('anthropic-ephemeral'));

return sm;
Expand Down

0 comments on commit 3ba9200

Please sign in to comment.