Skip to content
Merged
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
35 changes: 35 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
environment:
name: CI
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install
run: . ./install

- name: Import MosaicAI
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MEM0_API_KEY: ${{ secrets.MEM0_API_KEY }}
run: |
. ./activate
echo $MEM0_API_KEY > .mem0
python MosaicAI/test.py
7 changes: 6 additions & 1 deletion MosaicAI/Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ def __init__(self, openai_key_path=_DEFAULTS["OpenAI API key path"], model=_DEFA
self.openai = OpenAI(api_key=open(openai_key_path).read().strip())
else:
self.openai = OpenAI() # backup option: read env vars
self.mem0 = MemoryClient(api_key=open(mem0_key_path).read().strip())
if os.path.exists(mem0_key_path):
# read key from local file and connect to the mem0 API
self.mem0 = MemoryClient(api_key=open(mem0_key_path).read().strip())
else:
print("Error: mem0 API key not found.")
exit(1)
self.user_id = 42 ## TODO
return

Expand Down
12 changes: 10 additions & 2 deletions MosaicAI/MosaicAI.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
from FrontEnd import FrontEnd

def launch():
from FrontEnd import FrontEnd
FrontEnd().run()

def test():
from Agent import Agent
from IMDBot import IMDBot
from RQE import RouterQueryEngine
Agent()
IMDBot()
RouterQueryEngine()
return True

__name__ == "__main__" and launch()
2 changes: 2 additions & 0 deletions MosaicAI/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import MosaicAI
assert(MosaicAI.test())
7 changes: 4 additions & 3 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PYTHON="python3.12"
# deps
DEPS="$PYTHON $PYTHON-venv $PYTHON-tk unzip curl"
# check what flavor of linux and install deps
FAIL(){"echo 'Unsupported Linux distribution $1'; exit 1"}
FAIL() { echo "Unsupported Linux distribution $1"; exit 1; }
if [ -f /etc/os-release ]; then
. /etc/os-release
if [ "$ID" == "ubuntu" ]; then
Expand All @@ -21,10 +21,10 @@ if [ -f /etc/os-release ]; then
elif [ "$ID" == "manjaro" ]; then
sudo pacman -SU --noconfirm $DEPS || exit 1
else
FAIL() $ID
FAIL "$ID"
fi
else
FAIL()
FAIL "$ID"
fi

# create virtual environment
Expand All @@ -33,4 +33,5 @@ $PYTHON -m venv --symlinks --clear venv || exit 1
python -m pip install -r requirements.txt || exit 1

# download databases
chmod +x download_imdb_data.sh || exit 1
./download_imdb_data.sh || exit 1