MCPcopy
hub / github.com/marimo-team/marimo / convertToFileUIPart

Function convertToFileUIPart

frontend/src/components/chat/chat-utils.ts:40–56  ·  view source on GitHub ↗
(
  files: File[],
)

Source from the content-addressed store, hash-verified

38}
39
40export 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
58export function isLastMessageReasoning(messages: UIMessage[]): boolean {
59 if (messages.length === 0) {

Callers 4

createNewThreadFunction · 0.90
ChatPanelBodyFunction · 0.90
submitFunction · 0.90
ChatbotFunction · 0.90

Calls 2

blobToStringFunction · 0.90
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…