This Python script creates a conversational AI assistant using OpenAI's API. The assistant is designed to provide comprehensive summaries of real estate listings based on user queries.
- Initializes the OpenAI client with API key.
- Creates an assistant with specific instructions for real estate listings.
- Uploads a file to OpenAI and returns the file ID.
- Runs the assistant and returns the thread ID and run ID.
- Waits for the run to be completed and returns the run status.
- Prints the messages from the thread.
- Allows users to chat with the assistant until they type 'exit'.
Download VS Code or Editor of your choice
git clone https://github.com/RaheesAhmed/Ottavio.git
Go to the Folder
cd ottavio
python -m venv venv
venv/scripts/Activate
OPENAI_API_KEY=
pip install -r requirments.txt
pip install -U langchain-openai
pip install -U langchain-community
To Run Assistant
python assistantapi.py
Enter your queries when prompted, and the assistant will provide summaries of real estate listings based on your input. Type 'exit' to end the conversation.
Example Query:Enter your query (type 'exit' to end): I'm looking for a flat in Cannes around 400000€
def create_assistant(client, file_id):
assistant = client.beta.assistants.create(
name="Ottavio",
instructions=f"""add your instruction here"""
python filter_data.py
Enter the price range