Vantage Formatter Logic Documentation
Purpose
The formatter is a general-purpose data formatting transformer in the Vantage analytics platform. It leverages AI to convert and reshape upstream data into various target formats, including emails, chat messages, reports, executive briefs, bullet points, JSON structures, or custom outputs. This versatility makes it an essential tool for organizations that require data presentation in different formats, enhancing communication, reporting, and decision-making processes.
Settings
The formatter has several configurable settings that allow customization of its behavior. Below is a detailed description of each setting:
1. outputMode
- Input Type: Dropdown (string)
- Description: Specifies the format in which the output will be generated. The options include:
"email": Formats the data as a professional email."message": Produces a concise chat message suitable for platforms like Slack or Teams."report": Outputs a structured report."executive_brief": Creates an executive summary focusing on key insights and actionable items."bullet_points": Compiles the data into organized bullet points."json_structure": Transforms the data into a well-organized JSON format."custom": Allows for tailored transformations as specified by the user.
- Default Value:
"email"
Changing this setting affects the formatting and structure of the resulting output significantly.
2. tone
- Input Type: Dropdown (string)
- Description: Defines the tone of the generated output. The available tones include:
"professional": A tone appropriate for business communications."friendly": A warm and approachable tone for casual interactions."urgent": Conveys immediacy; best for critical messages."formal": Suitable for official communications and documents.
- Default Value:
"professional"
Adjusting this setting alters the style of phrasing used in the output.
3. promptTemplate
- Input Type: String
- Description: Custom template used for the AI model's prompt. It allows users to define specific instructions for data transformation. The template can include placeholders that will be populated with actual data during execution.
- Default Value: Fallback to mode-specific templates if empty.
Customizing this template can refine the AI’s processing of the provided data, leading to more tailored outputs.
4. maxRows
- Input Type: Numeric
- Description: Limits the number of rows from the input data that the formatter will process. This setting helps manage API call sizes and can enhance performance by not overloading the service with excessive data.
- Default Value:
200
Increasing this value allows for more data to be processed, while setting it too high may lead to issues with formatting or exceeding API limits.
How It Works
- Input Handling: The formatter accepts input data and unwraps it. If the input is in an unexpected format, it attempts to normalize it for processing.
- Data Validation: Checks whether the data is in a valid array format and contains rows. If data is missing or invalid, it returns a predefined error message.
- Configuration: It reads its configuration settings to determine the output mode, tone, prompt template, and the number of rows to process.
- Prompt Creation: Builds a prompt for the AI model based on the selected output mode and other settings. It incorporates a tone instruction and replaces any placeholders in the template with actual data.
- AI Integration: The formatter retrieves the preferred AI integration and sends the prompt to the AI service for processing.
- Response Handling: Parses the AI response, ensuring it is in valid JSON format. If there are issues in the response or parsing process, error messages are returned with context information.
- Output Generation: Constructs the final output, appending metadata such as the output mode and row count for user reference.
Data Expectations
The formatter expects data to be provided in the following format:
- Input must be an array of objects, where each object represents a record with key-value pairs.
- If the input is embedded within a different structure, the formatter should still be able to extract the relevant array.
- Example Structure:
json
[ { "name": "John Doe", "role": "Analyst", "performance": "Excellent" }, { "name": "Jane Smith", "role": "Manager", "performance": "Good" } ]
Use Cases & Examples
Use Cases
-
Business Communication:
- Scenario: A sales team needs to quickly summarize client feedback into a structured email format for distribution to key stakeholders.
- Configuration Example:
outputMode: "email"tone: "professional"maxRows: 10
-
Performance Reporting:
- Scenario: A manager requires a structured report outlining employee performance metrics for quarterly review.
- Configuration Example:
outputMode: "report"tone: "formal"maxRows: 50
-
Project Updates:
- Scenario: Team leads want to communicate status updates in a concise format suitable for a messaging platform like Slack.
- Configuration Example:
outputMode: "message"tone: "friendly"maxRows: 5
Detailed Example
Business Communication Use Case:
To convert client feedback into a structured business email, the formatter would be configured as follows:
{
"inputs": {
"input1": [
{ "client": "Company A", "feedback": "Great service!", "follow_up": "Yes" },
{ "client": "Company B", "feedback": "Needs improvement.", "follow_up": "No" }
]
},
"config": {
"outputMode": "email",
"tone": "professional",
"promptTemplate": "",
"maxRows": 10
},
"context": {
"clientId": "123",
"userId": "456"
}
}In this example, the formatter will generate a professional email summarizing the feedback received from clients, formatted appropriately for business communication.