Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 20 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,25 @@ EasyRealEstate leverages a multi-agent AI system to provide advanced analysis an
Clone the repository to a local machine:

```sh
git clone https://github.com/tonic/investinitaly
cd investinitaly
git clone https://github.com/tonic/EasyRealEstate
cd EasyRealEstate
```

2. **Set your OpenAI API Key**
2. Set Python version

- edit the `./src/config/config.py` file using a text editor and replace your api_key_here with your api key (keep the quotes!)
This software currently runs only with Python 3.11 version, as it's required by openbb-agents.

`llm_config = {"model": "gpt-4-turbo", "api_key": "your_api_key_here" }`
On MacOS, you can use `brew install python@3.11`; use `python3.11 --version` to validate

- then edit the `./src/config/.env.example` file using a text editor and replace your api_key_here with your api key also !
3. **Set your OpenAI API Key**
- `cp ./src/config/.env.example ./src/config/.env`
- Grab the ChatGPT API key from https://platform.openai.com/settings/profile?tab=api-keys (create a new Secret Key)
- Grab the OpenBB Personal Access Token (PAT) from https://my.openbb.co/app/platform/pat (start from https://my.openbb.co if it's the first time you use OpenBB)
- Edit the `./src/config/.env` and set
- the OpenAI API key as `OPENAI_API_KEY`
- the OpenBB PAT as `OPENBB_PAT`

- Get your openbb PAT from https://my.openbb.co/app/platform/pat and also add it to the `.env.example` file

- save the `.env.example` file as `.env`in the same folder

2. **Set Up the Environment**
3. **Set Up the Environment**

Run the setup script to create and activate the virtual environment, and install the dependencies:

Expand All @@ -107,48 +109,25 @@ EasyRealEstate leverages a multi-agent AI system to provide advanced analysis an
- On macOS/Linux:

```bash
chmod +x setup_env.sh
./setup_env.sh
```

then

- On Windows:

```sh
venv\Scripts\activate
```

- On macOS/Linux:

```sh
source venv/bin/activate
```
At this point, you should see the name of your virtual environment in the command prompt, indicating that you are now working within the virtual environment.

Once activated, you should see the name of your virtual environment in the command prompt, indicating that you are now working within the virtual environment.

3. **Run Chroma**
4. **Run Chroma**

Open a new terminal and run this command to start chroma :

- ```chroma run --path ./src/memory/chromadb```

4. **Run EasyRealEstate**

in your virtual environment activated terminal from step #2 :

```bash
python main.py
```
```chroma run --path ./src/memory/chromadb```

### Installation Problems
You should be able to see `Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)` on your standard output.

1. **OpenBB Agents**
5. **Run EasyRealEstate**

Sometimes installation can fail because of `openbb-agents`. If this happens , you will see some red text on the steps above. Simply install it using the following command additionally:
in your virtual environment activated terminal from step #2 :

```bash
pip install --no-cache-dir openbb-agents
python3.11 main.py
```

### Additional Configuration (Optional)
Expand Down
10 changes: 4 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
import autogen
from autogen.cache import Cache
from autogen import GroupChatManager
from src.config.config import load_env_file
import os
import sys

from pathlib import Path
from dotenv import load_dotenv

def main():

load_env_file('./src/config/.env')
dotenv_path = Path('./src/config/.env')
load_dotenv(dotenv_path=dotenv_path)

user_input = input(intro_message)

Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ markdownify
pandas
einops
openai
pypdf
openbb-agents
# openbb[all]
4 changes: 2 additions & 2 deletions setup_env.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#!/bin/bash

# Python version to use
# Python version to use, as required by openbb-agents
PYTHON_VERSION="3.11"

# Check if Python $PYTHON_VERSION is installed
Expand All @@ -18,6 +18,6 @@ python$PYTHON_VERSION -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt
pip$PYTHON_VERSION install -r requirements.txt

echo "Virtual environment setup complete."
7 changes: 4 additions & 3 deletions src/agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
from autogen.agentchat.contrib.retrieve_user_proxy_agent import RetrieveUserProxyAgent
import chromadb
from typing import Annotated
from src.config.config import load_env_file
from pathlib import Path
from dotenv import load_dotenv


load_env_file('./src/config/.env')
dotenv_path = Path('./src/config/.env')
load_dotenv(dotenv_path=dotenv_path)

chroma_client = chromadb.HttpClient(host='localhost', port=8000)

Expand Down
16 changes: 7 additions & 9 deletions src/config/config.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# ./src/config/config.py
from autogen.cache import Cache

llm_config = {"model": "gpt-4-turbo", "api_key": "your_key_here" }

import os
from pathlib import Path
from dotenv import load_dotenv

dotenv_path = Path('./src/config/.env')
load_dotenv(dotenv_path=dotenv_path)

def load_env_file(env_path):
with open(env_path) as f:
for line in f:
if line.strip() and not line.startswith("#"):
key, value = line.strip().split('=', 1)
os.environ[key] = value
openai_api_key = os.getenv("OPENAI_API_KEY")
llm_config = {"model": "gpt-4-turbo", "api_key": openai_api_key }