-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(docs): build documentation only when docs files change (#39)
- Loading branch information
Showing
5 changed files
with
6 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1 @@ | ||
# Nesis API | ||
Nesis API module | ||
1. Allows you to chat with data | ||
2. Chats with documents and enhances document knowledge retrival | ||
3. Offers business insights | ||
|
||
## Run migrations with | ||
```commandline | ||
alembic -x "url=postgresql://admin:password@localhost:65432/optimai" revision --autogenerate -m "migrations-"`cat version.txt` | ||
``` | ||
|
||
## Build docker image with | ||
```commandline | ||
docker build -t ametnes/optimai:`cat version.txt` . | ||
``` | ||
|
||
## Local Development | ||
### Install required version of Python | ||
Install pyenv, a tool the can help one manage multiple Python versions | ||
```commandline | ||
brew install pyenv | ||
``` | ||
Using pyenv install python 3.11.5 | ||
```commandline | ||
pyenv install 3.11.5 | ||
``` | ||
Browse to the opmtimAI source code location and set the python version locally using pyenv and create a python virtual environment and activate it. | ||
```commandline | ||
pyenv local 3.11.5 | ||
pyenv exec python -m venv .venv | ||
source .venv/bin/activate | ||
``` | ||
### Docker services | ||
In a separate terminal window, Start docker services with | ||
``` | ||
docker-compose -f ../../deploy/compose.yml up | ||
``` | ||
|
||
### Install project dependencies | ||
While in the python virtual environment, run the following to install the required project dependencies | ||
```commandline | ||
pip install -r requirements.txt | ||
``` | ||
Sometimes one will incur issues with the postgresSQL adapter, so we will uninstall it and re-install it to avoid any potential issues. | ||
```commandline | ||
pip uninstall psycopg2-binary | ||
pip install psycopg2-binary | ||
``` | ||
|
||
### Running unit tests | ||
Run unit tests after starting docker services | ||
```commandline | ||
python -m unittest discover -s tests -t tests | ||
``` | ||
|
||
## Running locally | ||
### Start the service | ||
```commandline | ||
export OPENAI_API_KEY=<your-api-key> | ||
python bin/main.py --config=deploy/config.yml | ||
``` | ||
|
||
### Test | ||
Set up the datasource settings | ||
```commandline | ||
curl -X POST http://localhost:6000/v1/modules/insights/settings -H 'Content-Type: application/json' -d '{"attributes": {"connection": {"database": "optimai", "host": "localhost", "password": "password", "port": "65432", "user": "admin"}, "engine": "postgres"}, "module": "data", "name": "Northwinds"}' | ||
``` | ||
Run predictions query command | ||
```commandline | ||
curl -X POST http://localhost:6000/v1/modules/insights/predictions --header "Content-Type: application/json" --data '{"query": "Which top 15 cities has the most sales revenue"}' | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1 @@ | ||
# Nesis | ||
|
||
Project Structure | ||
|
||
``` | ||
| | ||
|- deployment # CI deployment scripts | ||
|- server # ExpressJS API service | ||
|- client # Frontend Client | ||
``` | ||
|
||
# Setup | ||
|
||
## Install node packages | ||
|
||
`npm install` | ||
|
||
## Run application | ||
|
||
### Start the server | ||
|
||
``` | ||
npm run start:server:local | ||
``` | ||
|
||
### Start the application | ||
|
||
``` | ||
cd client | ||
npm start | ||
``` | ||
|
||
Point your browser to http://localhost:3001/ | ||
|
||
`Connecting to the TEST API` | ||
|
||
``` | ||
PROFILE=TEST API_URL=https://test.cloud.ametnes.com/api/optimai npm start | ||
``` | ||
|
||
`You can ignore SSL certs with` | ||
|
||
``` | ||
NODE_TLS_REJECT_UNAUTHORIZED=0 PROFILE=TEST API_URL=https://test.cloud.ametnes.com/api/optimai npm start | ||
``` | ||
|
||
## Run application locally | ||
|
||
### Start the backend API server | ||
|
||
1. `cd server` | ||
2. `NODE_TLS_REJECT_UNAUTHORIZED=0 PROFILE=TEST API_URL=https://test.cloud.ametnes.com/api/optimai npm start` | ||
|
||
### In a separate terminal start the frontend application | ||
|
||
1. `cd client` | ||
2. `npm start` | ||
|
||
Point your browser to http://localhost:3001/ | ||
|
||
## Building | ||
|
||
``` | ||
docker build --build-arg PROFILE=PROD --build-arg PUBLIC_URL=/ -t ametnes/optimai:`cat version.txt` . | ||
``` | ||
# Nesis Frontend |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "ametnes-optimal", | ||
"name": "ametnes-nesis", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
|