box_ai_extract_structured_enhanced_using_fields_tool
Extract structured data from documents using custom field definitions, combining information from multiple files into a single record with enhanced AI accuracy for complex layouts and low-quality scans.
Instructions
Extract structured data from one or more files using custom fields and return a SINGLE data instance (Enhanced version).
This enhanced tool analyzes the provided file(s) and extracts information based on custom field definitions you provide. When multiple files are provided, Box AI combines information from ALL files to create ONE complete data record.
Enhanced features:
Uses advanced AI models (e.g., Google Gemini) for improved accuracy
Better handling of complex document layouts and image quality
More robust extraction for handwritten or low-quality scans
Improved understanding of complex field relationships
Unlike template-based extraction, this tool allows you to define fields on-the-fly without creating a metadata template in Box first. This is useful for ad-hoc data extraction or when you need fields that don't match any existing template.
Use cases:
Single file: Extract custom fields from one document
Multiple files: Combine data from multiple sources into one data instance (e.g., extract patient info from medical records, lab results, and prescription images)
NOT for batch processing: If you need to extract data from multiple files as separate instances, call this tool once per file in a loop.
Args: ctx (Context): The context object containing the request and lifespan context. file_ids (List[str]): A list of file IDs to extract information from, example: ["1234567890", "0987654321"]. fields (List[dict[str, Any]]): The fields to extract from the files. Returns: dict: The AI response containing the extracted information.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_ids | Yes | ||
| fields | Yes |