shreemaan-abhishek commented on code in PR #13654:
URL: https://github.com/apache/apisix/pull/13654#discussion_r3518959059


##########
apisix/plugins/ai-cache/key.lua:
##########
@@ -103,6 +103,10 @@ end
 -- ONLY place request-determining data lives; scope() below is pure isolation.
 function _M.fingerprint(ctx, body)
     local repr = build_repr(ctx, body, client_messages(ctx, body))
+    -- client_messages() (get_messages) flattens structured content to plain 
text,
+    -- so an exact fingerprint of it alone would let a text+image prompt 
collide
+    -- with a text-only one. Fold the raw messages in to keep them distinct.
+    repr.raw_messages = body.messages
     return hex_digest(core.json.canonical_encode(repr))

Review Comment:
   can be handled in a later PR, we need to merge this PR soon to fix the 
failing CI.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to