VinF Hybrid Inference: flatten request contents rather than plucking the first #8991
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
While waiting for the Prompt API to support sequence input, we were ignoring all but the first item in the list of Content objects in the prompt request. We fall back to Cloud for Chat support for the same reason.
Note the fallback logic we use for chat support checks if a given request has multiple roles, and this logic runs for all requests as part of
isAvailable
.Problem Statement
We had some feedback that we should log a warning when we ignore input.
Solution
Given we're already ensuring a request only has a single role before running it on device, it's safe to flatten all content objects, rather than just plucking the first.