mapMessagesToCompletionPayload
mapMessagesToCompletionPayload(
messages:UIMessage<unknown,UIDataTypes,UITools>[]):LlmapiMessage[]
Defined in: src/vercel/messages.ts:15Â
Converts an array of Vercel AI UIMessage objects into the
LlmapiMessage format that the Portal API expects.
- Non text-only parts and unsupported roles are ignored.
- Text parts are merged with double newlines, matching the structure that
postApiV1ChatCompletionsaccepts.
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
|
The UI layer conversation history received from |
Returns
A clean array of Portal-ready messages, filtered to user, assistant, and system roles.
Last updated on