Integrate lightweight LLM for extraction tasks in ai_chat.py
zenaight
d14240d
- Added a new lightweight LLM instance (llm_light) in config.py for simpler extraction tasks, optimizing performance with lower temperature and token limits.
- Updated the extract_and_update_persona function to utilize llm_light for persona extraction, enhancing efficiency in processing user inputs.
Enhance WhatsApp formatting correction in fix_whatsapp_formatting function
zenaight
0b6571b
- Improved the fix_whatsapp_formatting function to handle multiple patterns for bold formatting, ensuring comprehensive conversion of markdown to WhatsApp-specific formatting.
- Added debug statements to track the presence of double asterisks before and after processing, aiding in troubleshooting and validation of formatting corrections.
- Updated the system message in chat_with_session_memory to include specific examples of correct and incorrect formatting, reinforcing user understanding of WhatsApp formatting rules.
Implement WhatsApp formatting correction function in chat_with_session_memory
zenaight
5367f7b
- Added a new function, fix_whatsapp_formatting, to convert markdown formatting to WhatsApp-specific formatting, ensuring compliance with messaging requirements.
- Updated the system message to reinforce critical WhatsApp formatting rules and provide clear examples of acceptable and unacceptable formats.
- Integrated the formatting correction function into the AI response processing to automatically adjust any markdown that may have slipped through, enhancing message clarity and user experience.
Update WhatsApp formatting guidelines in chat_with_session_memory function
zenaight
e701256
- Revised the system message to emphasize critical WhatsApp formatting rules, including the correct usage of single asterisks for bold and the prohibition of markdown formatting.
- Added detailed examples of correct and incorrect formatting to enhance user understanding and compliance.
- Expanded the guidelines for property listing messages to ensure clarity and consistency in communication.
- Increased the conversation history limit from 10 to 30 messages for improved context retention during chats.
Enhance property listing details and database schema
zenaight
2dbf283
- Updated the chat_with_session_memory function to display key features and additional info about properties, improving user interaction and clarity.
- Added handling for full features and tags for AI use, ensuring comprehensive responses to user inquiries.
- Modified the database schema to include a new 'tags' column in the properties table, allowing for more detailed property attributes.
- Adjusted sample property inserts to include tags, enhancing the testing and functionality of the property search feature.
Refactor transaction_type filtering in search_properties function
zenaight
54f9ee3
- Updated the search_properties function to replace transaction types 'rent' and 'buy' with 'lease' and 'sale', respectively, for improved clarity and consistency in property search.
- Adjusted the query logic to use equality checks for the new transaction types, ensuring accurate filtering of properties based on user selection.
- Enhanced debug logging to reflect the updated filtering criteria, aiding in troubleshooting and user feedback.
Enhance property search functionality by adding transaction type filtering
zenaight
762b66d
- Updated the extract_and_search_properties function to include transaction_type in the search filters, allowing users to specify whether they are looking to rent or buy properties.
- Modified the search_properties function to handle transaction_type filtering, ensuring appropriate price types are applied based on the user's selection.
- Added sample sale properties to the database setup for testing purposes, improving the robustness of property search functionality.
Update transaction_type normalization in extract_and_update_intent function
zenaight
582cc74
- Changed the normalization guideline for the transaction_type field from 'buy' to 'sale' to better reflect terminology consistency.
- This update enhances the clarity of intent handling related to transaction types, ensuring more accurate user interactions.
Enhance intent handling by adding transaction_type support
zenaight
62054ce
- Updated the chat_with_session_memory function to include transaction_type in the system message, improving clarity on user intentions.
- Modified the extract_and_update_intent function to incorporate transaction_type into the intent fields and added normalization guidelines for this field.
- Updated the database schema to include transaction_type in the user_intents table, ensuring proper data storage and retrieval.
- Added a migration script to safely add the transaction_type column if it doesn't already exist, maintaining database integrity.
Update WhatsApp formatting guidelines in chat_with_session_memory function
zenaight
f0b5ada
- Clarified the use of WhatsApp-specific formatting, emphasizing the correct usage of single asterisks for bold and single underscores for italics, while explicitly stating to avoid markdown formatting.
- Added instructions for strikethrough text and reinforced the importance of concise and well-structured messages for improved user interaction.
whatsapp formats
zenaight
1a8e9a5
Refactor chat_with_session_memory function to improve user interaction and intent handling
zenaight
4a4adb5
- Enhanced the system message construction to provide clearer property search preferences, including location, budget, size, and must-haves, only when relevant.
- Updated the guidelines for user interactions to ensure a more conversational tone and to avoid asking for preferences unless the user is explicitly inquiring.
- Improved intent classification logic to allow for a more natural flow of conversation, reducing unnecessary prompts for user preferences.
- Added detailed examples for intent classification to clarify user requests and improve response accuracy.
Enhance AI chat functionality with image request handling and intent classification updates
zenaight
a93b33d
- Added direct handling for image requests in the chat function, providing immediate responses for users requesting images.
- Updated the intent classification logic to include detailed context analysis for image requests, improving accuracy in identifying user needs.
- Enhanced the end chat detection mechanism using AI to better understand user intent for ending conversations.
- Refactored the image request handling to streamline the process and improve user experience when multiple properties are discussed.
- Introduced additional debug logging for better traceability of user interactions and AI responses.
Rename project from PropAgent to PropBot
zenaight
f8c1312
Update server port in Dockerfile and main.py from 8080 to 7860
zenaight
3f945f8
- Changed the exposed port in the Dockerfile and the CMD instruction to 7860, ensuring consistency across the application setup.
- Updated the main.py file to reflect the new port configuration for the uvicorn server, maintaining alignment with the Dockerfile changes.
- These modifications enhance the application's deployment consistency and accessibility.
Update Dockerfile to change server port from 7860 to 8080
zenaight
d1139f1
- Modified the exposed port in the Dockerfile from 7860 to 8080 to align with recent configuration standards.
- Updated the CMD instruction to reflect the new port, ensuring the application runs correctly in the container.
- These changes enhance the application's accessibility and maintain consistency with the latest deployment practices.
Add root endpoint for health check and update server port
zenaight
ba3605b
- Introduced a new root endpoint (`/`) that provides a health check response, including application status and available endpoints.
- Updated the server to run on port 8080 instead of the previous port 7860, aligning with the latest configuration standards.
- These changes enhance the application's monitoring capabilities and improve accessibility for health checks.
Refactor Dockerfile to streamline setup by removing unnecessary components
zenaight
6364981
- Removed installation steps for system dependencies and the VS Code Server to simplify the Dockerfile.
- This change focuses on reducing build time and maintaining a cleaner setup, ensuring only essential components are included for the application.
Refactor Dockerfile to improve git configuration setup
zenaight
8ae62a5
- Updated the git configuration process to create a dedicated `.gitconfig` file in the root directory, enhancing clarity and organization.
- This change aims to ensure proper user details are set for version control operations while maintaining a clean Dockerfile structure.
Enhance Dockerfile to configure git and install VS Code Server
zenaight
ce34bf4
- Added git configuration with user details to ensure proper permissions for version control operations.
- Included installation steps for the VS Code Server, enhancing the development environment within the container.
- These updates aim to provide a more robust setup for development, facilitating better code management and editing capabilities.
Update Dockerfile to reintroduce essential system dependencies
zenaight
91d9c89
- Added installation of system dependencies `wget`, `curl`, and `git` to the Dockerfile to support necessary functionalities.
- This update aims to enhance the development environment by ensuring required tools are available for building and managing the application effectively.
Refactor Dockerfile to remove unnecessary dependencies and installation steps
zenaight
6082432
- Eliminated the installation of system dependencies `wget` and `curl`, as well as the steps for downloading and installing the VS Code Server, to streamline the Dockerfile.
- These changes aim to simplify the container setup process and reduce build time, focusing on essential components for the application.
Enhance Dockerfile to include system dependencies and install VS Code Server
zenaight
384df7d
- Added installation of system dependencies `wget` and `curl` to the Dockerfile for improved functionality.
- Included steps to download and install the VS Code Server, ensuring a more robust development environment.
- These updates aim to streamline the setup process and enhance the development experience within the container.
Merge branch 'main' of hf.co:spaces/Zenaight/PropAgent
zenaight
45ae1af
Refactor property selection logic and enhance user context analysis
zenaight
f7aa5b7
- Removed the outdated check for existing properties in the `extract_and_search_properties` function to streamline property request handling.
- Introduced a new mechanism in the `handle_image_request` function to analyze recent user messages for specific property selections, improving the AI's ability to respond to user preferences.
- Updated the ordering of the query in `search_properties` to prioritize featured properties and price, enhancing search efficiency.
- These changes aim to improve the responsiveness and accuracy of property selections based on user interactions, ultimately enhancing the overall user experience.
Enhance property handling and update server configuration
zenaight
0854d25
- Updated the `extract_and_search_properties` function to utilize existing properties in the state for specific classification requests, improving efficiency in handling user inquiries.
- Removed outdated property selection logic from the `handle_image_request` function to streamline the code and enhance clarity.
- Modified the server port in `main.py` from 7860 to 8000 to align with new configuration settings.
- Updated the README to reflect the new server port and ensure accurate setup instructions for users.
- These changes aim to improve the responsiveness and accuracy of property selections while providing clear guidance for application setup.
Update README to reflect server port change from 8000 to 7860
zenaight
4f58a18
- Modified the README file to update the command for running the application, changing the server port to 7860 to align with recent configuration updates.
- This change ensures that users have the correct instructions for launching the application with the new port settings.
Update server port and enhance dependencies in requirements
zenaight
ef1eb82
- Changed the server port from 8000 to 7860 in the `main.py` file to accommodate new configuration settings.
- Added `Pillow`, `requests`, and `aiofiles` to the `requirements.txt` file to support additional functionality and improve project capabilities.
- These updates aim to ensure the application runs on the correct port and has the necessary libraries for enhanced performance and features.
Refactor property selection logic and enhance conversation context handling
zenaight
b7f1d5f
- Removed the previous check for existing properties in the `extract_and_search_properties` function to streamline property request handling.
- Introduced a new mechanism in the `handle_image_request` function to analyze recent user messages for specific property selections, improving the AI's ability to respond to user preferences.
- Added debug statements to track user-selected options and property mentions, enhancing traceability during property inquiries.
- These changes aim to improve the responsiveness and accuracy of property selections based on user interactions, ultimately enhancing the overall user experience.
Enhance property request handling and conversation context in AI chat
zenaight
c62a5af
- Updated the `extract_and_search_properties` function to utilize existing properties in the state for specific classification requests, improving efficiency in handling user inquiries.
- Enhanced the `handle_image_request` function to analyze recent conversation history for property mentions, allowing for more contextually relevant property selections when multiple options are available.
- Added debug statements to track property mentions and selections, improving traceability and user experience during property inquiries.
- These changes aim to streamline user interactions by leveraging existing data and conversation context, ensuring more accurate and responsive AI behavior.
Refactor intent extraction and flow control for improved user interaction
zenaight
f692b71
- Updated the `extract_and_update_intent` function to set the response directly in the state when prompting users for location during property searches, enhancing clarity and flow.
- Modified the `should_continue` function to improve readability and debugging by explicitly checking for the presence of a response, ensuring better control over the conversation flow.
- These changes aim to streamline user interactions by ensuring that location preferences are addressed effectively and that the decision-making process in the chat flow is more transparent.
Add conditional edges for chat flow control
zenaight
3fdf3b6
- Introduced a `should_continue` function to determine whether to proceed to the next node based on the response state, enhancing the decision-making process in the chat flow.
- Replaced direct edges with conditional edges for `intent_update`, `property_search`, and `exit_check`, allowing for more dynamic control of the conversation based on user responses.
- These changes aim to improve the responsiveness and adaptability of the AI chat system, ensuring a smoother user experience by managing the flow of conversation more effectively.
Enhance property inquiry handling in intent extraction
zenaight
440c7f4
- Updated the `extract_and_update_intent` and `extract_and_search_properties` functions to prompt users for location when requesting property listings without a specified location, improving the AI's responsiveness and user experience.
- Added debug statements to clarify the flow of intent processing related to property searches, ensuring better traceability.
- These changes aim to streamline user interactions by ensuring that location preferences are addressed before proceeding with property searches.
Enhance intent classification to include request_details
zenaight
11f5f36
- Updated the classification logic in `extract_and_update_intent` and `extract_and_search_properties` to recognize "request_details" as a valid classification, allowing the system to handle specific property inquiries more effectively.
- Expanded the documentation to clarify the intent classification options and provided examples for better user understanding.
- These changes aim to improve the AI chat's responsiveness to user requests for detailed property information, enhancing overall user experience.
Enhance classification handling in intent extraction and property search
zenaight
69d3b80
- Updated the return structure of `extract_and_update_intent` and `extract_and_search_properties` to include the classification information, improving the context provided for subsequent processing.
- Added debug print statements in `receive_message` to log the classification being processed, enhancing traceability during image request handling.
- These changes aim to improve the clarity and responsiveness of the AI chat system by ensuring that classification data is consistently available and logged throughout the interaction flow.
Add debug statements to handle_image_request for improved traceability
zenaight
f817f6b
- Introduced additional debug print statements in the `handle_image_request` function to log the classification, properties count, property identifier, selected property, and images found.
- These changes aim to enhance the debugging process by providing clearer insights into the image request handling flow, ultimately improving the maintainability and clarity of the code.
Refine intent classification and image request handling in AI chat
zenaight
9900964
- Enhanced the `extract_and_update_intent` function to streamline the classification of user requests, allowing for more efficient handling of inquiries related to property listings, images, and addresses.
- Updated the `handle_image_request` function to improve property selection based on user identifiers, ensuring that the AI can accurately respond to image requests with relevant property images.
- Adjusted the `receive_message` function to correctly identify image requests, enhancing the system's responsiveness to user inquiries about images and photos.
- These changes aim to improve user interaction by providing clearer and more accurate responses to property and image requests, ultimately enhancing the overall user experience.
Enhance property data handling and intent classification in AI chat
zenaight
df9de2d
- Updated the `chat_with_session_memory` function to include address data for AI use while ensuring it is not displayed in listings unless requested, improving user privacy and clarity.
- Modified the intent classification logic to recognize requests for addresses, allowing the system to respond appropriately to user inquiries about property locations.
- Adjusted the database schema in `supabase_setup.sql` to add an address field to the properties table and create an index for efficient querying, enhancing data organization and retrieval.
- These changes aim to improve user interaction by providing more comprehensive responses regarding property details while maintaining privacy and clarity in communication.
Enhance image request handling and intent classification in AI chat
zenaight
b418dc7
- Updated the `chat_with_session_memory` function to clarify the inclusion of property data without image URLs, improving user understanding of available information.
- Modified the `extract_and_update_intent` function to recognize requests for images, allowing the system to handle both property and image inquiries more effectively.
- Adjusted the `process_message` function to check for image requests based on user input, ensuring appropriate responses are generated when users ask for images or photos.
- These changes aim to improve user interaction by providing clearer communication regarding available listings and enhancing the system's ability to respond to image requests.
Implement image handling in AI chat and enhance WhatsApp messaging
zenaight
a35f267
- Introduced a new `handle_image_request` function to process user requests for property images, allowing the AI to respond with relevant image messages when triggered.
- Updated the `process_message` function to return both the AI response and associated property details, facilitating image requests.
- Enhanced the WhatsApp messaging functionality with a new `send_multiple_messages` function to handle sending both text and image messages, including delays to avoid rate limiting.
- These changes aim to improve user interaction by providing a more comprehensive response to image requests while maintaining clarity in communication.
Refactor property search logic to support flexible ranges
zenaight
729c393
- Updated the `search_properties` function to allow for flexible budget and size ranges, enabling searches within ±50% of the specified values.
- Removed the must-have features from the database search, shifting the responsibility to the chat response logic for better user interaction.
- Simplified the `extract_and_search_properties` function by eliminating multiple fallback passes, streamlining the property search process and improving response clarity.
- These changes aim to enhance the user experience by providing more relevant property listings while maintaining clear communication regarding search results.
Enhance intent classification and debugging in AI chat
zenaight
e2c07e6
- Added debug print statements in `extract_and_update_intent` to log missing intent fields and the classification check, improving traceability during intent processing.
- Updated the return structure of `extract_and_update_intent` to include the classification result, enhancing the information provided for subsequent processing.
- These changes aim to refine the intent extraction logic and provide better insights into the classification process, ultimately improving user interactions.
Enhance intent extraction logic to handle property inquiries
zenaight
b92bfbc
- Added a classification check in `extract_and_update_intent` to determine if the user is asking for property listings, allowing the system to skip preference questions when appropriate.
- Updated the state graph to reorder the processing flow, ensuring intent classification occurs before intent extraction, improving the overall logic and efficiency of user interactions.
- These changes aim to refine the user experience by providing more relevant responses based on user intent, while maintaining clarity in the conversation flow.
Add debug statements to persona and intent extraction functions
zenaight
0e649c6
- Introduced debug print statements in `extract_and_update_persona`, `extract_and_update_intent`, and `classify_user_intent` to log the start of processing and responses generated, enhancing traceability during execution.
- Updated `extract_and_search_properties` to include a debug statement for classification checks, improving visibility into the property search process.
- These changes aim to facilitate debugging and provide better insights into the state of the application during user interactions.
Enhance intent extraction and debugging in AI chat
zenaight
0d86ec7
- Updated the normalization instructions for abbreviations and common terms to improve clarity and user understanding.
- Added debug print statements to log intent extraction results, errors, and classification checks, enhancing traceability during the intent processing.
- Refined the property search logic to utilize the extracted classification more effectively, ensuring that searches are only conducted when appropriate.