Smart file content retrieval action that automatically handles content extraction based on file type. Returns LLM-ready content (text for documents, base64 for images).

This action combines file download with intelligent content extraction:

  • Text formats (txt, md, html, json, csv) → Returns plain text
  • Images (png, jpg, gif, webp) → Returns base64 for LLM vision
  • PDFs → Extracts text using pdf-parse
  • Excel files → Converts to structured JSON/CSV text
  • Word documents → Extracts text using mammoth
  • Binary files → Returns base64 with warning

Example

// Get PDF content (auto-extracts text)
await runAction({
ActionName: 'File Storage: Get File Content',
Params: [{
Name: 'StorageProvider',
Value: 'Box'
}, {
Name: 'ObjectID',
Value: '347751234567'
}]
});
// Returns: { Format: "text", Content: "extracted text...", ExtractionMethod: "pdf-parse" }

// Get image content (returns base64)
await runAction({
ActionName: 'File Storage: Get File Content',
Params: [{
Name: 'StorageProvider',
Value: 'Google Drive'
}, {
Name: 'ObjectName',
Value: 'screenshots/diagram.png'
}]
});
// Returns: { Format: "image", Content: "base64...", ExtractionMethod: "none" }

Hierarchy (view full)

Constructors

Methods

  • Retrieve file content with automatic extraction based on file type

    Parameters

    • params: RunActionParams<any>

      The action parameters:

      • StorageProvider: Required - Name of the storage provider
      • ObjectName: Required if ObjectID not provided - Name/path of the object
      • ObjectID: Optional - Provider-specific object ID (bypasses path resolution)

    Returns Promise<ActionResultSimple>

    Operation result with:

    • ContentType: Original MIME type of the file
    • Format: "text" | "image" | "structured" | "binary"
    • Content: Extracted/converted content ready for LLM
    • Size: Original file size in bytes
    • ExtractionMethod: Method used ("none" | "pdf-parse" | "excel-parse" | "word-extract")
    • Warning: Optional warning for unsupported formats