PersistentAI API Documentation / @persistentai/fireflow-nodes / convertMessageToAPIFormat
Function: convertMessageToAPIFormat()
convertMessageToAPIFormat(
message,support?,context?,debugLog?,options?):Promise<{parts:Part[];role:string; } |null>
Defined in: packages/fireflow-nodes/src/nodes/ai/gemini/gemini-part-converters.ts:289
Convert a complete message (with multiple parts) to API format. Handles part batching, parallel conversion, and null filtering.
Parameters
message
Message with role and parts
parts
role
string
support?
GeminiPartTypeSupport = GeminiPartTypeSupport.ALL
Which part types to allow (whitelist mode)
context?
Optional execution context for debug logging
debugLog?
(ctx, msg) => Promise<void>
Optional debug logging function
options?
Optional configuration for concurrency and timeout
maxConcurrency?
number
timeout?
number
Returns
Promise<{ parts: Part[]; role: string; } | null>
Promise<Content | null> with converted message or null if no valid parts