Skip to content

fix(ryzenai): accept OpenAI content-part arrays in chat messages - #3441

Open
anditherobot wants to merge 2 commits into
lemonade-sdk:mainfrom
anditherobot:fix/629-ryzenai-content-arrays
Open

fix(ryzenai): accept OpenAI content-part arrays in chat messages#3441
anditherobot wants to merge 2 commits into
lemonade-sdk:mainfrom
anditherobot:fix/629-ryzenai-content-arrays

Conversation

@anditherobot

Copy link
Copy Markdown
Contributor

Summary

Fixes #629.

Merges text-part arrays in messages[].content into plain strings for RyzenAI and rejects unsupported media parts with HTTP 400 before streaming starts.

Scope

  • Merge text parts and check for invalid media types (src/cpp/include/lemon/backends/ryzenai/ryzenai_request.h & src/cpp/server/backends/ryzenai/ryzenai_request.cpp).
  • Apply the string conversion to streaming and non-streaming requests (src/cpp/server/backends/ryzenai/ryzenai_server.cpp).
  • Check for invalid parts before opening the stream so errors return HTTP 400 (src/cpp/server/server.cpp).
  • Test text merging, empty arrays, null values, and error cases (test/cpp/test_ryzenai_request.cpp).

Testing

  • Ran ctest -R RyzenAIRequestNormalizationTest (all 16 tests pass).

Documentation

  • No documentation changes needed.

Breaking Changes

  • None.

AI-Assisted Contribution

  • This contribution was created with the assistance of AI tools.
  • I have reviewed the changes and take full responsibility for the code.
  • I have tested the changes and verified that they work as expected.

@github-actions github-actions Bot added engine::ryzenai RyzenAI hybrid NPU backend bug Something isn't working labels Aug 31, 2026
@anditherobot
anditherobot marked this pull request as ready for review August 31, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working engine::ryzenai RyzenAI hybrid NPU backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lemonade server endpoint /api/v1/chat/completions rejects array content (expects string)

1 participant