janiussyafiq commented on PR #13570:
URL: https://github.com/apache/apisix/pull/13570#issuecomment-4765967221

   Reply to @membphis :
   - `client.scan` now receives and forwards a role-tagged `messages` array 
instead of a concatenated string.
   - The array is built from `proto.get_messages()` — the protocol's canonical 
`{role, content}` helper — so `system`/`user`/`assistant` turns are preserved 
for openai-chat, Anthropic and Responses.
   - Each message's content is coerced to text and non-text parts (e.g. 
multimodal `image_url`) are dropped. Lakera `/v2/guard` rejects non-text 
content with HTTP 400, which under the default fail-closed mode would otherwise 
block legitimate multimodal requests.
   - Falls back to a single `user` message only when a protocol exposes no 
role-preserving representation.
   - The "whole conversation" test now asserts the full role-tagged array 
reaches Lakera, with each role paired to its own content.
   
   This also matches how other gateways integrate Lakera.


-- 
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