Uses advanced AI to extract specific pieces of information from text or image content with high accuracy and semantic understanding.
The aiExtractVariables function uses advanced AI to extract specific pieces of information from text or image content. This function excels at understanding context and can extract variables from conversational text, documents, or visual content with high accuracy.
Extracts structured data from unstructured content using AI-powered semantic analysis. The function can handle complex conversational patterns, standalone responses, and contextual information to identify and extract the exact variables you need.
Key Differentiator: This function goes beyond keyword matching to understand context and meaning, making it ideal for conversational workflows.
Goes beyond keyword matching to understand context and meaning
Identifies answers in multi-turn conversations and standalone responses
Can extract information from images when provided with image buffers
Automatically formats extracted data to meet specified requirements
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | The source text to analyze (often "${conversationContext}") | |
| variables_to_extract | array | Array of variable definitions specifying what to extract | |
| image_buffer | buffer | Optional | Image data to analyze alongside text |
| image_mimetype | string | Optional | MIME type of the image (e.g., "image/png") |
Each variable in the variables_to_extract array should include the following structure:
Validation Note: Validation rules are optional but help ensure data quality and provide better user feedback when information is missing or invalid.
Returns an object with each extracted variable as a property:
When required variables are missing, the function maintains the current step and prompts for more information:
Basic contact information extraction from conversation context:
Extracting passport information from both text and image content:
The description field is crucial for accurate extraction. Be specific about what you're looking for and the expected format.
Set validation rules that match your data requirements, but don't be overly restrictive as the AI can format data to meet reasonable expectations.
When extracting from conversations, the AI understands context and can identify answers that appear after questions, even if they're standalone responses.
Test your extraction with different ways users might provide the same information to ensure robust performance.
These functions work well together with aiExtractVariables to create powerful data collection workflows: