15:44 pm
Weird Day.
The Boss finds one simple websearch absed ai agent and shows me and tells me
Says I being dumb and all was able to find free opensource resource for our use case and there might be thousands of them. Why can't You find them.
While the usecase is completely different that what is needed.
F-ck You.
Well the website he suggested was good. UnwindAI https://unwind.ai
However the langchain was what worked at last.
Look at what I did
Looks weird. Right It’s generated by DALLE
Okay. Let me still rephrase For retrieving the properties and Projects for real estate
- Colleccted sheets from excel by a Real Estate Agent
- Row wise chunk to convert eash row to contextful column value pairs
- Created a custom CSVMarkdownLoader
- Chroma/FAISS vectorstore
- HuggingFace Embedding
- That’s base retriever for you
- Added a Reranker b BAAI. (Pretty useful step.)
Note: The Reranker is Used to filter the best m docs from n docs retrived by bas retriever.
- Added an LLM
- ConversationRetivalQAChain with ConversationMemory
- Gradio Chatbot Interface
Notebook
import pandas as pd
import os
def excel_to_csv_all_sheets(excel_file, output_dir=None, sanitize_names=True):
"""
Convert all sheets in an Excel file to separate CSV files with values only.
Parameters:
- excel_file (str): Path to the input Excel file (.xlsx or .xls).
- output_dir (str, optional): Directory to save CSV files. Defaults to same as excel_file.
- sanitize_names (bool): If True, replace spaces and special chars in sheet names with underscores.
Returns:
- dict: Mapping of sheet names to their output CSV file paths.
"""
# Load the Excel file
try:
excel = pd.ExcelFile(excel_file, engine='openpyxl')
except Exception as e:
raise ValueError(f"Failed to load Excel file: {e}")
file_name = os.path.basename(excel_file).split(".")[0]
# If no output directory specified, use the Excel file's directory
if output_dir is None:
output_dir = os.path.dirname(excel_file) or "."
# Dictionary to store results
result = {}
# Process each sheet
for sheet_name in excel.sheet_names:
# Read the sheet (formulas are evaluated to values automatically)
df = pd.read_excel(excel_file, sheet_name=sheet_name, engine='openpyxl')
# Sanitize sheet name for filename if requested
csv_name = sheet_name
if sanitize_names:
csv_name = csv_name.replace(" ", "_").replace("/", "_").replace("\\", "_").replace(":", "_")
# Define output CSV path
if not os.path.exists(f"{output_dir}/{file_name}"):
os.makedirs(f"{output_dir}/{file_name}")
output_csv = f"{output_dir}/{file_name}/{csv_name}.csv"
# Save to CSV with values only
df.to_csv(output_csv, index=False)
# Store result
result[sheet_name] = output_csv
print(f"Converted '{sheet_name}' to '{output_csv}'")
return result
import csv
from typing import List
from langchain.docstore.document import Document
from langchain.document_loaders.base import BaseLoader
# Function to convert a single row to Markdown format
def row_to_markdown(row: dict, row_num: int) -> str:
markdown = f"ROW | {row_num}\n"
for column, value in row.items():
markdown += f"{column} | {value}\n"
markdown += "\n---\n"
return markdown
Created Custom CSVMarkdownLoader
class CSVMarkdownLoader(BaseLoader):
"""Loads a CSV file and converts each row to Markdown formatted documents."""
def __init__(self, file_path: str|List, encoding: str = "utf-8"):
self.file_path = file_path
self.encoding = encoding
def load(self) -> List[Document]:
documents = []
if isinstance(self.file_path, str):
self.file_path = [self.file_path]
for file_path in self.file_path:
with open(file_path, 'r', encoding=self.encoding) as csvfile:
csv_reader = csv.DictReader(csvfile)
for i, row in enumerate(csv_reader, 1):
# Convert row to Markdown
markdown_content = row_to_markdown(row, i)
# Create metadata with row number and original row data
metadata = {
"row_number": i,
"source": file_path,
"original_data": str(dict(row))
}
doc = Document(
page_content=markdown_content,
metadata=metadata
)
documents.append(doc)
return documents
Data Processing
# Replace 'your_file.xlsx' with your Excel file path
excel_files = ['Commercial Projects - Database (1).xlsx', "Luxury Residential Projects - Database (1).xlsx"]
# excel_files = ["Luxury Residential Projects - Database (1).xlsx"]
output = {}
# Convert all sheets in the Excel file to CSV files
for excel_file in excel_files:
result = excel_to_csv_all_sheets(excel_file, output_dir="output", sanitize_names=True)
output[excel_file] = result
Converted 'Commercial Project Details' to 'output/Commercial Projects - Database (1)/Commercial_Project_Details.csv'
Converted 'New Project Details' to 'output/Commercial Projects - Database (1)/New_Project_Details.csv'
Converted 'Updated Project Details' to 'output/Commercial Projects - Database (1)/Updated_Project_Details.csv'
Converted 'Sheet2' to 'output/Commercial Projects - Database (1)/Sheet2.csv'
Converted 'For CRM - By Sibin' to 'output/Commercial Projects - Database (1)/For_CRM_-_By_Sibin.csv'
Converted 'Commercial Project - Cleaned' to 'output/Commercial Projects - Database (1)/Commercial_Project_-_Cleaned.csv'
Converted 'Sheet3' to 'output/Commercial Projects - Database (1)/Sheet3.csv'
Converted 'Residential' to 'output/Luxury Residential Projects - Database (1)/Residential.csv'
Converted 'Bunglows' to 'output/Luxury Residential Projects - Database (1)/Bunglows.csv'
Converted 'Resale Bunglows' to 'output/Luxury Residential Projects - Database (1)/Resale_Bunglows.csv'
sheets = []
for file in output:
for sheet in output[file].values():
sheets.append(sheet)
loader = CSVMarkdownLoader(sheets)
docs = loader.load()
print(len(docs))
2936
def pretty_print_docs(docs):
print(
f"\n{'-' * 100}\n".join(
[f"Document {i+1}:\n\n" + d.page_content +f"\nMetadata: {d.metadata}" for i, d in enumerate(docs)]
)
)
from langchain_huggingface.embeddings import HuggingFaceEmbeddings
from langchain.vectorstores import Chroma
from langchain.embeddings import OpenVINOEmbeddings
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
db = Chroma.from_documents(docs, embeddings)
db.search("Houses of Shivalik groups", search_type="mmr", k=20)
[Document(id='88f72b4a-d85d-4458-819c-09c09a92e372', metadata={'row_number': 92, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Shivalik Shilp', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '315.0', ' Total Floor': '13.0', 'NO.': '92', 'Locality': '', 'LOCATION ': 'Gota'}}, page_content='ROW | 92\nRow Labels | Shivalik Shilp\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 315.0\n Total Floor | 13.0\nNO. | 92\nLocality | \nLOCATION | Gota\n\n---\n'),
Document(id='f70bdc50-85d9-4204-9784-6cc84c9413b0', metadata={'row_number': 6, 'source': 'output/Commercial Projects - Database (1)/Sheet3.csv', 'original_data': {'Project Name': 'Shivalik 3', 'Area (Location)': 'Thaltej'}}, page_content='ROW | 6\nProject Name | Shivalik 3\nArea (Location) | Thaltej\n\n---\n'),
Document(id='8dbfbe22-df0a-4ca3-bf19-a77869eaf4c2', metadata={'row_number': 28, 'source': 'output/Commercial Projects - Database (1)/Sheet3.csv', 'original_data': {'Project Name': 'Commercial Row House', 'Area (Location)': 'Shahibaug'}}, page_content='ROW | 28\nProject Name | Commercial Row House\nArea (Location) | Shahibaug\n\n---\n'),
Document(id='2f106549-4221-4218-a06f-d4298bea1a33', metadata={'row_number': 72, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Sanskrit Galleria', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '195.0', ' Total Floor': '6.0', 'NO.': '72', 'Locality': 'Nr Taj Hotel', 'LOCATION ': 'Sindhubhavan Road'}}, page_content='ROW | 72\nRow Labels | Sanskrit Galleria\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 195.0\n Total Floor | 6.0\nNO. | 72\nLocality | Nr Taj Hotel\nLOCATION | Sindhubhavan Road\n\n---\n'),
Document(id='0c8c62d4-42b8-41e5-ada0-1de9903470f8', metadata={'row_number': 140, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Upcoming Shivalik Project ', 'Type': 'Shops-Showrooms', ' Total Tower': '0.0', ' Total Unit': '0.0', ' Total Floor': '0.0', 'NO.': '140', 'Locality': '', 'LOCATION ': 'Vaishno Devi'}}, page_content='ROW | 140\nRow Labels | Upcoming Shivalik Project \nType | Shops-Showrooms\n Total Tower | 0.0\n Total Unit | 0.0\n Total Floor | 0.0\nNO. | 140\nLocality | \nLOCATION | Vaishno Devi\n\n---\n'),
Document(id='273a1957-5190-48d8-9eb5-6456374a25b1', metadata={'row_number': 104, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Skylon Residency', 'Type': 'Shops-Showrooms', ' Total Tower': '4.0', ' Total Unit': '187.0', ' Total Floor': '12.0', 'NO.': '104', 'Locality': '', 'LOCATION ': 'Rajpath Rangoli Road '}}, page_content='ROW | 104\nRow Labels | Skylon Residency\nType | Shops-Showrooms\n Total Tower | 4.0\n Total Unit | 187.0\n Total Floor | 12.0\nNO. | 104\nLocality | \nLOCATION | Rajpath Rangoli Road \n\n---\n'),
Document(id='862656c7-e73b-4235-84ae-b7b2a6da3ccf', metadata={'row_number': 6, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Aatrey Rudra elegance', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '38.0', ' Total Floor': '7.0', 'NO.': '6', 'Locality': 'Shilaj Circle', 'LOCATION ': 'Shilaj'}}, page_content='ROW | 6\nRow Labels | Aatrey Rudra elegance\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 38.0\n Total Floor | 7.0\nNO. | 6\nLocality | Shilaj Circle\nLOCATION | Shilaj\n\n---\n'),
Document(id='ebd170e1-08ec-4255-acc2-5a099d955408', metadata={'row_number': 143, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Vishala Empire', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '226.0', ' Total Floor': '6.0', 'NO.': '143', 'Locality': '', 'LOCATION ': 'Ambawadi'}}, page_content='ROW | 143\nRow Labels | Vishala Empire\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 226.0\n Total Floor | 6.0\nNO. | 143\nLocality | \nLOCATION | Ambawadi\n\n---\n'),
Document(id='92d275e1-1eb4-404b-b075-3e7906e92e34', metadata={'row_number': 167, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': '', 'Type': '', ' Total Tower': '', ' Total Unit': '', ' Total Floor': '', 'NO.': '167', 'Locality': 'Hanspura', 'LOCATION ': 'Nikol'}}, page_content='ROW | 167\nRow Labels | \nType | \n Total Tower | \n Total Unit | \n Total Floor | \nNO. | 167\nLocality | Hanspura\nLOCATION | Nikol\n\n---\n'),
Document(id='d7dda9f6-e8ef-4887-9cc4-035d62bd1fe2', metadata={'row_number': 93, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Shivalik Upcoming Commercial Project ', 'Type': 'Office / Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '471.0', ' Total Floor': '30.0', 'NO.': '93', 'Locality': '', 'LOCATION ': 'Iscon Ambli Road'}}, page_content='ROW | 93\nRow Labels | Shivalik Upcoming Commercial Project \nType | Office / Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 471.0\n Total Floor | 30.0\nNO. | 93\nLocality | \nLOCATION | Iscon Ambli Road\n\n---\n'),
Document(id='e5f45865-5351-4022-8049-223605777002', metadata={'row_number': 122, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Tatvam Pride', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '41.0', ' Total Floor': '7.0', 'NO.': '122', 'Locality': '', 'LOCATION ': 'Vaishnodevi'}}, page_content='ROW | 122\nRow Labels | Tatvam Pride\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 41.0\n Total Floor | 7.0\nNO. | 122\nLocality | \nLOCATION | Vaishnodevi\n\n---\n'),
Document(id='a88fb5dc-8d03-411f-a298-37ff12b4d110', metadata={'row_number': 36, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Hiramani 61', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '72.0', ' Total Floor': '10.0', 'NO.': '36', 'Locality': 'Khyati Circle', 'LOCATION ': 'Shilaj'}}, page_content='ROW | 36\nRow Labels | Hiramani 61\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 72.0\n Total Floor | 10.0\nNO. | 36\nLocality | Khyati Circle\nLOCATION | Shilaj\n\n---\n'),
Document(id='a071adcf-1623-4fa2-844a-8fca497a26c5', metadata={'row_number': 94, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Shree Balaji Heights', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '47.0', ' Total Floor': '13.0', 'NO.': '94', 'Locality': '', 'LOCATION ': 'Sindhubhavan Road '}}, page_content='ROW | 94\nRow Labels | Shree Balaji Heights\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 47.0\n Total Floor | 13.0\nNO. | 94\nLocality | \nLOCATION | Sindhubhavan Road \n\n---\n'),
Document(id='0a94eed2-5471-4a07-8915-fe43ccf77c96', metadata={'row_number': 131, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'The Ridge', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '73.0', ' Total Floor': '10.0', 'NO.': '131', 'Locality': '', 'LOCATION ': 'Shyamal Cross Road '}}, page_content='ROW | 131\nRow Labels | The Ridge\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 73.0\n Total Floor | 10.0\nNO. | 131\nLocality | \nLOCATION | Shyamal Cross Road \n\n---\n'),
Document(id='14c58dc9-e051-403f-887c-6e833f724694', metadata={'row_number': 99, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Shreya Amalga', 'Type': 'Shops-Showrooms', ' Total Tower': '2.0', ' Total Unit': '143.0', ' Total Floor': '5.0', 'NO.': '99', 'Locality': '', 'LOCATION ': 'Vaishno Devi'}}, page_content='ROW | 99\nRow Labels | Shreya Amalga\nType | Shops-Showrooms\n Total Tower | 2.0\n Total Unit | 143.0\n Total Floor | 5.0\nNO. | 99\nLocality | \nLOCATION | Vaishno Devi\n\n---\n'),
Document(id='73f820a3-8290-4c03-bf9d-aafe1952faa3', metadata={'row_number': 47, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Maitree Shiv Green', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '44.0', ' Total Floor': '7.0', 'NO.': '47', 'Locality': '', 'LOCATION ': 'Shivranjani'}}, page_content='ROW | 47\nRow Labels | Maitree Shiv Green\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 44.0\n Total Floor | 7.0\nNO. | 47\nLocality | \nLOCATION | Shivranjani\n\n---\n'),
Document(id='ba7f92eb-5f23-4d80-a445-b30b8ce11b8c', metadata={'row_number': 186, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': '', 'Type': '', ' Total Tower': '', ' Total Unit': '', ' Total Floor': '', 'NO.': '186', 'Locality': '', 'LOCATION ': 'Shilaj'}}, page_content='ROW | 186\nRow Labels | \nType | \n Total Tower | \n Total Unit | \n Total Floor | \nNO. | 186\nLocality | \nLOCATION | Shilaj\n\n---\n'),
Document(id='455d6e7f-b5a8-4bbf-86ee-d9b0f5b1eb22', metadata={'row_number': 90, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': 'Shilp The Address', 'Type': 'Shops-Showrooms', ' Total Tower': '1.0', ' Total Unit': '50.0', ' Total Floor': '6.0', 'NO.': '90', 'Locality': '', 'LOCATION ': 'Vaishno Devi'}}, page_content='ROW | 90\nRow Labels | Shilp The Address\nType | Shops-Showrooms\n Total Tower | 1.0\n Total Unit | 50.0\n Total Floor | 6.0\nNO. | 90\nLocality | \nLOCATION | Vaishno Devi\n\n---\n'),
Document(id='ceefebc6-61b4-42d0-b4f7-6ab9538c935b', metadata={'row_number': 187, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': '', 'Type': '', ' Total Tower': '', ' Total Unit': '', ' Total Floor': '', 'NO.': '187', 'Locality': 'Hanspura', 'LOCATION ': 'Nikol'}}, page_content='ROW | 187\nRow Labels | \nType | \n Total Tower | \n Total Unit | \n Total Floor | \nNO. | 187\nLocality | Hanspura\nLOCATION | Nikol\n\n---\n'),
Document(id='47d14354-1633-4cbf-9b0b-5bb4da131d24', metadata={'row_number': 188, 'source': 'output/Commercial Projects - Database (1)/Sheet2.csv', 'original_data': {'Row Labels': '', 'Type': '', ' Total Tower': '', ' Total Unit': '', ' Total Floor': '', 'NO.': '188', 'Locality': 'Hanspura', 'LOCATION ': 'Nikol'}}, page_content='ROW | 188\nRow Labels | \nType | \n Total Tower | \n Total Unit | \n Total Floor | \nNO. | 188\nLocality | Hanspura\nLOCATION | Nikol\n\n---\n')]
retriever = db.as_retriever(search_kwargs={"k": 20, "filter": {"source": "output/Commercial Projects - Database (1)/Commercial_Project_Details.csv"}})
from langchain.retrievers import ContextualCompressionRetriever
from langchain.retrievers.document_compressors import CrossEncoderReranker
from langchain_community.cross_encoders import HuggingFaceCrossEncoder
model = HuggingFaceCrossEncoder(model_name="BAAI/bge-reranker-base")
compressor = CrossEncoderReranker(model=model, top_n=3)
compression_retriever = ContextualCompressionRetriever(
base_compressor=compressor, base_retriever=retriever
)
query = "Houses of Shivalik groups"
compressed_docs = compression_retriever.invoke(query)
pretty_print_docs(compressed_docs)
Document 1:
ROW | 106
Unnamed: 0 |
NO. | 108
DATE | 25/12/23
Project | Curv
DEVELOPER | Shivalik Group
TYPE | Office
Possesion Date | 2029
Construction Stage | Under Construction
Total Tower | 1.0
Total Unit | 450.0
Total Floor | 31
PROJECT WEBSITE | https://www.shivalikgroup.com/
SALES PERSON | Milap
CONTACT NO. | 7990842337
AREA (SQ. FT.) | 1800 Sq.ft onwords
RATE/- SQ. FT. | R.P - 8200/-
OTHER CHARGES | 500/- Other charges
CAR PARKING | 3 Lacs/-
landmark |
locality |
area | GIFT City
Location Link | https://maps.app.goo.gl/foCKuYcahKHvU4vE9
Longitude,Latitude | 23.15934758172378, 72.68926151436446
FLOOR | 2 + 32
PLC | 50/-rs 11th floor above
REMARKS | Commercial - Showroom sold out / As Per RERA Possession in 2029
RERA | RERA Received
Rmarks - Chandni | Update date-13/8/2024 Rate Change 8200 to 9100
Name | Chandni Shah
---
Metadata: {'original_data': "{'Unnamed: 0': '', 'NO.': '108', 'DATE': '25/12/23', 'Project': 'Curv', 'DEVELOPER ': 'Shivalik Group ', 'TYPE': 'Office', 'Possesion Date': '2029', 'Construction Stage': 'Under Construction', 'Total Tower': '1.0', 'Total Unit': '450.0', 'Total Floor': '31', 'PROJECT WEBSITE': 'https://www.shivalikgroup.com/', 'SALES PERSON': 'Milap', 'CONTACT NO.': '7990842337', 'AREA (SQ. FT.)': '1800 Sq.ft onwords', 'RATE/- SQ. FT.': 'R.P - 8200/-', 'OTHER CHARGES ': '500/- Other charges', 'CAR PARKING ': '3 Lacs/-', 'landmark': '', 'locality': '', 'area': 'GIFT City', 'Location Link ': 'https://maps.app.goo.gl/foCKuYcahKHvU4vE9', 'Longitude,Latitude': '23.15934758172378, 72.68926151436446', 'FLOOR': '2 + 32', 'PLC ': '50/-rs 11th floor above', 'REMARKS': 'Commercial - Showroom sold out / As Per RERA Possession in 2029', 'RERA': 'RERA Received\\n', 'Rmarks - Chandni': 'Update date-13/8/2024 Rate Change 8200 to 9100', 'Name': 'Chandni Shah'}", 'row_number': 106, 'source': 'output/Commercial Projects - Database (1)/Commercial_Project_Details.csv'}
----------------------------------------------------------------------------------------------------
Document 2:
ROW | 99
Unnamed: 0 | R
NO. | 99
DATE | 26/08/2023
Project | Shivalik The Wave
DEVELOPER | Shivalik Group
TYPE | Office
Possesion Date | 2028
Construction Stage | Upcoming
Total Tower | 1.0
Total Unit | 471.0
Total Floor | 30
PROJECT WEBSITE | https://www.shivalikgroup.com/
SALES PERSON | Margi
CONTACT NO. | 9099949730
AREA (SQ. FT.) | 1800 Sq.ft. Onwords
RATE/- SQ. FT. | DP- 5300/-, RP-6000/-
OTHER CHARGES | 900/-Auda/AMC+Running Maintenance,100/-Maintenance Deposit +GST+ Stampduty
CAR PARKING | 4 Lacs/-alloted Car Parking
landmark |
locality |
area | Vaishnodevi
Location Link | https://maps.app.goo.gl/CbTJfkPnJSZ9rRXy6
Longitude,Latitude | 23.135712130845363, 72.54282594440629
FLOOR | 5 to 30
PLC | PLC Charges after 11th Floor
REMARKS |
RERA | April,24
Rmarks - Chandni | Update date-13/8/2024 She call back after some time
Name | Chandni Shah
---
Metadata: {'original_data': "{'Unnamed: 0': 'R', 'NO.': '99', 'DATE': '26/08/2023', 'Project': 'Shivalik The Wave', 'DEVELOPER ': 'Shivalik Group ', 'TYPE': 'Office', 'Possesion Date': '2028', 'Construction Stage': 'Upcoming', 'Total Tower': '1.0', 'Total Unit': '471.0', 'Total Floor': '30', 'PROJECT WEBSITE': 'https://www.shivalikgroup.com/', 'SALES PERSON': 'Margi ', 'CONTACT NO.': '9099949730', 'AREA (SQ. FT.)': '1800 Sq.ft. Onwords ', 'RATE/- SQ. FT.': 'DP- 5300/-, RP-6000/-', 'OTHER CHARGES ': '900/-Auda/AMC+Running Maintenance,100/-Maintenance Deposit +GST+ Stampduty ', 'CAR PARKING ': '4 Lacs/-alloted Car Parking ', 'landmark': '', 'locality': '', 'area': 'Vaishnodevi', 'Location Link ': 'https://maps.app.goo.gl/CbTJfkPnJSZ9rRXy6', 'Longitude,Latitude': '23.135712130845363, 72.54282594440629', 'FLOOR': '5 to 30', 'PLC ': 'PLC Charges after 11th Floor ', 'REMARKS': '', 'RERA': 'April,24', 'Rmarks - Chandni': 'Update date-13/8/2024 She call back after some time ', 'Name': 'Chandni Shah'}", 'row_number': 99, 'source': 'output/Commercial Projects - Database (1)/Commercial_Project_Details.csv'}
----------------------------------------------------------------------------------------------------
Document 3:
ROW | 100
Unnamed: 0 |
NO. | 100
DATE | 26/08/2023
Project | Shivalik The Wave
DEVELOPER | Shivalik Group
TYPE | Retail
Possesion Date | 2028
Construction Stage | Upcoming
Total Tower |
Total Unit |
Total Floor |
PROJECT WEBSITE | https://www.shivalikgroup.com/
SALES PERSON | Margi
CONTACT NO. | 9099949730
AREA (SQ. FT.) | 3500 Sq.ft onwards
RATE/- SQ. FT. | GF-16.5kDP, 19.5kRP,FF-11.5kDP,14kRP, SF-9kDP,11k RP
OTHER CHARGES | 1200/- Per Sq.ft
CAR PARKING | 4 Lacs/-alloted Car Parking
landmark |
locality |
area | Vaishnodevi
Location Link | https://maps.app.goo.gl/CbTJfkPnJSZ9rRXy6
Longitude,Latitude | 23.135712130845363, 72.54282594440629
FLOOR | Gf+2
PLC |
REMARKS |
RERA | April,24
Rmarks - Chandni | Update date-13/8/2024 She call back after some time
Name | Chandni Shah
---
from langchain.chains import RetrievalQA, ConversationalRetrievalChain
from langchain_google_genai import ChatGoogleGenerativeAI
from langchain.memory import ConversationBufferMemory
memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
chain = ConversationalRetrievalChain.from_llm(
llm=ChatGoogleGenerativeAI(model="gemini-2.0-flash", api_key="AIzaSyCi8vj5I1nZiiumy46bSVwGVBNQlnNCaJU"),
retriever=compression_retriever,
memory=memory
)
def chat_with_agent(message):
"""Process user message and return the agent's response."""
result = chain({"question": message})
return result["answer"]
import gradio as gr
with gr.Blocks(title="Real Estate Agent Chat") as demo:
chatbot = gr.Chatbot()
msg = gr.Textbox(placeholder="Ask a question about real estate (e.g., 'What properties are available in downtown?')")
clear = gr.Button("Clear")
def user(user_message, history):
"""Handle user input and update chat history."""
return "", history + [[user_message, None]]
def bot(history):
"""Generate bot response and update chat history."""
user_message = history[-1][0]
bot_message = chat_with_agent(user_message)
history[-1][1] = bot_message
return history
# Connect the components
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
bot, chatbot, chatbot
)
clear.click(lambda: None, None, chatbot, queue=False).then(
lambda: memory.clear(), None, None # Clear conversation memory
)
demo.launch()
That’s It. Go Play with It.
But no. You might need data. Go ask ChatGPT to Generate it. Go Synthetic. Go Bold
Vibin’
Oh Today’s most heard Memories - One Piece
Links :
Tags :
Date : 7th March, Friday, 2025, (Wikilinks: 7th March, March 25, March, 2025. Friday)
Category : Others