AlinsRan commented on PR #13676:
URL: https://github.com/apache/apisix/pull/13676#issuecomment-4977113727

   Fixed in b7e61ca. You're right — `extract_last_user_message()` read 
`body.messages` directly, so a Responses request (prompt in `body.input`) found 
no messages and silently fell back to the catchall; same for Anthropic/Bedrock 
structured content.
   
   Now it reads the last user turn through `ai-protocols.get_messages(body, 
ctx)`, which normalizes Chat, Responses, Anthropic and Bedrock into canonical 
`{role, content}` entries. The protocol is already detected in `access` 
(`base.detect_request_type`), so this reuses that dispatch rather than 
re-parsing. Kept a small guard to flatten multimodal content the adapter may 
hand back unflattened.
   
   Added regression coverage: a Responses request (`body.input`) and an 
Anthropic request (`body.system` + messages) each assert the semantic route is 
picked (via the debug header) instead of falling back.


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