( files: File[], )
| 38 | } |
| 39 | |
| 40 | export async function convertToFileUIPart( |
| 41 | files: File[], |
| 42 | ): Promise<FileUIPart[]> { |
| 43 | const fileUIParts = await Promise.all( |
| 44 | files.map(async (file) => { |
| 45 | const part: FileUIPart = { |
| 46 | type: "file" as const, |
| 47 | mediaType: file.type, |
| 48 | filename: file.name, |
| 49 | url: await blobToString(file, "dataUrl"), |
| 50 | }; |
| 51 | return part; |
| 52 | }), |
| 53 | ); |
| 54 | |
| 55 | return fileUIParts; |
| 56 | } |
| 57 | |
| 58 | export function isLastMessageReasoning(messages: UIMessage[]): boolean { |
| 59 | if (messages.length === 0) { |
no test coverage detected
searching dependent graphs…