AI-Powered Property Description Optimizer
Overview
This workflow automates the generation of enhanced property descriptions using AI. It takes a property URL as input, extracts relevant information (images and text), uses AI models to describe images and generate improved property descriptions, and finally outputs the enhanced description via a chat interface. The workflow leverages multiple components for data extraction, image description, prompt generation, and AI model interaction.
Components Overview
The workflow utilizes the following components:
- Chat Input: Retrieves a property URL from a user input within a chat interface.
- URL Advanced: Extracts images and text from a given URL using CSS selectors.
- Parse JSON Data: Parses the JSON data obtained from the URL, extracting image URLs.
- Parse Data: Converts data into plain text, formatting it according to a template.
- Describe Image: Uses a language model to generate descriptions of images.
- Prompt: Creates prompt templates with dynamic variables for AI models.
- Google Generative AI: A large language model (LLM) that generates text outputs based on given prompts.
- Chat Output: Displays the final enhanced property description in the chat interface.
Detailed Component Descriptions
Chat Input
- Description: Captures user input (property URL) within a chat environment.
- Input Parameters: None (input is implicit via the chat interface).
- Output Parameters: A
Message
object containing the provided property URL. - Key Configurations/Conditions: Requires a valid URL to function correctly.
URL Advanced
- Description: Extracts images, text, and links from URLs using CSS selectors.
- Input Parameters: A list of URLs (
urls
), CSS selectors for images (image_selectors
), text (text_selectors
), and links (link_selectors
). - Output Parameters: A
Data
object containing the extracted information. - Key Configurations/Conditions: Correctly configured CSS selectors are crucial for successful extraction. Multiple URLs can be provided.
Parse JSON Data
- Description: Extracts specific JSON fields using JQ query.
- Input Parameters: A
Data
object (JSON), a JQ query string (query
). - Output Parameters: A
Data
object containing the filtered data. - Key Configurations/Conditions: Requires a valid JQ query.
Parse Data
- Description: Converts
Data
into plain text using a specified template. - Input Parameters: A
Data
object (data
), a template string (template
), and a separator string (sep
). - Output Parameters: A
Message
object containing the formatted text and aData
object containing the processed data. - Key Configurations/Conditions: The template string should contain placeholders corresponding to the keys within the input
Data
object.
Describe Image
- Description: Generates image descriptions using an AI language model.
- Input Parameters: Image data (
images
), a Language Model (llm
), and an optional prompt text (prompt_text
). - Output Parameters: A
Data
object containing the generated image descriptions. - Key Configurations/Conditions: Requires a valid Language Model; image data can be text, a URL, or a list of objects.
Prompt
- Description: Creates a prompt template with dynamic variables.
- Input Parameters: A template string (
template
). - Output Parameters: A
Message
object containing the constructed prompt. - Key Configurations/Conditions: The template string should contain placeholders that will be replaced with dynamic values.
Google Generative AI
- Description: Generates text using Google's generative AI model.
- Input Parameters: Input text (
input_value
), system message (system_message
), model parameters (temperature, top_k, top_p, etc.). - Output Parameters: A
Message
object containing the generated text and aLanguageModel
object. - Key Configurations/Conditions: Requires a valid Google API key. Model parameters influence the generated output.
Chat Output
- Description: Displays a chat message.
- Input Parameters: Message text (
input_value
), sender information (sender, sender_name), conversation ID. - Output Parameters: None (output is implicit via the chat interface).
- Key Configurations/Conditions: Requires appropriate sender information.
Workflow Execution
- Chat Input receives a property URL from the user.
- URL Advanced uses the URL to fetch data, extracting images and text.
- Parse JSON Data extracts image URLs from the JSON data.
- Parse Data formats the extracted text for use in the next prompt.
- Describe Image uses the extracted images and a prompt to describe them using the Google Generative AI model.
- The described images are combined with the initial text description and fed into another Parse Data component.
- Prompt constructs a prompt for the second Google Generative AI model, incorporating the initial description, the image descriptions, and instructions to enhance the description.
- Google Generative AI generates an enhanced property description.
- Chat Output displays the enhanced description to the user.
Additional Notes
The success of this workflow hinges on the accuracy of the CSS selectors used in the URL Advanced
component and the quality of prompts provided to the AI models. Performance may vary depending on the size and complexity of the input URL and the chosen Google Generative AI model. Consider adding error handling and logging mechanisms for improved robustness.