Update app.py
Browse files3 unmodified lines456789101132 unmodified lines444546474849508 unmodified lines596061626364653 unmodified linesfrom bs4 import BeautifulSoup# Configure DeepSeek (actually using OpenAI API keys, but variable remains the same)DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY")DEEPSEEK_ENDPOINT = "https://api.openai.com/v1/chat/completions"def scrape_website(url):"""Scrapes real estate data from the given website URL."""32 unmodified linesFormat your response in clear markdown with actionable insights and a professional tone."""headers = {"Authorization": f"Bearer {os.getenv('DEEPSEEK_API_KEY')}","Content-Type": "application/json"}8 unmodified lines}try:response = requests.post(DEEPSEEK_ENDPOINT, json=data, headers=headers)response.raise_for_status()return response.json()["choices"][0]["message"]["content"]except Exception as e:3 unmodified lines456789101132 unmodified lines444546474849508 unmodified lines596061626364653 unmodified linesfrom bs4 import BeautifulSoup# Configure DeepSeek (actually using OpenAI API keys, but variable remains the same)OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")OPENAI_ENDPOINT = "https://api.openai.com/v1/chat/completions"def scrape_website(url):"""Scrapes real estate data from the given website URL."""32 unmodified linesFormat your response in clear markdown with actionable insights and a professional tone."""headers = {"Authorization": f"Bearer {os.getenv('OPENAI_API_KEY')}","Content-Type": "application/json"}8 unmodified lines}try:response = requests.post(OPENAI_ENDPOINT, json=data, headers=headers)response.raise_for_status()return response.json()["choices"][0]["message"]["content"]except Exception as e:
app.py+4-4