Function Types

Analyze Functions

Visual analysis of images and documents using AI

Analyze functions perform visual analysis on images and videos. They're optimized for extracting information that requires understanding visual layout and appearance of content.

When to Use

Use an Analyze function when you need to:

  • Infer visual context from pictures
  • Analyze images for specific visual elements
  • Ask questions about visual aspects in inputs

Configuration Fields

Required Fields

FieldTypeDescription
functionNamestringUnique identifier for the function
typestringMust be "analyze"
outputSchemaNamestringHuman-readable name for your schema
outputSchemaobjectJSON Schema defining the structure to extract

Optional Fields

FieldTypeDefaultDescription
displayNamestring-Human-readable display name
tagsstring[]-Tags for organization

Analyze vs Transform

AspectAnalyzeTransform
Optimized forVisual content, imagesDocuments, text
Best forReceipts, photos, scansPDFs, emails, spreadsheets
ProcessingVisual-first approachText-first approach

Choose Analyze when the visual appearance of the document is critical for extraction (e.g. identifying cars in a photo of a parking lot, pulling events from a warehouse security video).

Choose Transform for standard document processing where text extraction is the primary need.

Example

{
  "functionName": "receipt-analyzer",
  "type": "analyze",
  "displayName": "Receipt Image Analyzer",
  "outputSchemaName": "Receipt Schema",
  "outputSchema": {
    "type": "object",
    "required": ["merchantName", "total"],
    "properties": {
      "merchantName": {
        "type": "string",
        "description": "Name of the merchant/store"
      },
      "merchantAddress": {
        "type": "string",
        "description": "Store address if visible"
      },
      "transactionDate": {
        "type": "string",
        "description": "Date of transaction"
      },
      "total": {
        "type": "number",
        "description": "Total amount paid"
      },
      "paymentMethod": {
        "type": "string",
        "description": "How the purchase was paid (cash, card, etc.)"
      },
      "items": {
        "type": "array",
        "description": "Individual items purchased",
        "items": {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "price": { "type": "number" },
            "quantity": { "type": "number" }
          }
        }
      }
    }
  },
  "tags": ["expense", "receipts"]
}

Email Integration

Like Transform functions, Analyze functions receive an email address for forwarding documents. The email address is returned in the function response as emailAddress.

On this page