Skip to content

Commit

Permalink
Merge branch 'fix/web/General-Integration' of https://github.com/COS3…
Browse files Browse the repository at this point in the history
…01-SE-2024/occupi into fix/web/General-Integration
  • Loading branch information
Tinashe-Austin committed Sep 21, 2024
2 parents a669460 + 1ebeebe commit 5a0e6d8
Show file tree
Hide file tree
Showing 118 changed files with 15,841 additions and 4,146 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Python App 🏗️
name: Build Documentation 📋🏗️

on:
pull_request:
Expand Down Expand Up @@ -38,4 +38,4 @@ jobs:
run: bun install

- name: 🚀 Build with Next.js
run: bun run build
run: bun run build
2 changes: 1 addition & 1 deletion .github/workflows/lint-test-build-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
- name: 🧪 Run tests
run: |
gotestsum --format testname --junitfile tmp/test-results/gotestsum-report.xml -- -v -coverpkg=github.com/COS301-SE-2024/occupi/occupi-backend/pkg/authenticator,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/cache,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/database,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/middleware,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/utils ./tests/... -coverprofile=coverage.out
gotestsum --format testname --junitfile tmp/test-results/gotestsum-report.xml -- -v -coverpkg=github.com/COS301-SE-2024/occupi/occupi-backend/pkg/analytics,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/authenticator,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/cache,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/database,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/middleware,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/utils ./tests/... -coverprofile=coverage.out
- name: 📋 Upload coverage reports to Codecov
uses: codecov/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/load-test-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Load Test System 🏋️💪
# trigger action to run once a month on Sunday at 12:00 AM
on:
schedule:
- cron: "0 0 1-7 * 0"
- cron: "0 0 1 * *"

workflow_dispatch:

Expand Down Expand Up @@ -87,4 +87,4 @@ jobs:
run: k6 run --out=cloud landing-page.js

- name: ✅ Load test completed
run: echo "Load test completed successfully!"
run: echo "Load test completed successfully!"
2 changes: 1 addition & 1 deletion .github/workflows/test-and-cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
- name: 🧪 Run tests
run: |
gotestsum --format testname -- -v -coverpkg=github.com/COS301-SE-2024/occupi/occupi-backend/pkg/authenticator,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/cache,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/database,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/middleware,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/utils ./tests/... -coverprofile=coverage.out
gotestsum --format testname -- -v -coverpkg=github.com/COS301-SE-2024/occupi/occupi-backend/pkg/analytics,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/authenticator,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/cache,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/database,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/middleware,github.com/COS301-SE-2024/occupi/occupi-backend/pkg/utils ./tests/... -coverprofile=coverage.out
- name: 📋 Upload coverage reports to Codecov
uses: codecov/[email protected]
Expand Down
Binary file added datasets/Hourly_Predictions.xlsx
Binary file not shown.
1 change: 1 addition & 0 deletions documentation/occupi-docs/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"index": "Introduction",
"api-documentation": "Api documentation",
"coding-standards": "Coding Standards",
"testing-policy": "Testing Policy",
"installation": {
"title": "Installation",
"type": "page"
Expand Down
159 changes: 159 additions & 0 deletions documentation/occupi-docs/pages/api-documentation/ai-usage.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# AI endpoint Usage

This page provides a detailed explanation of how to use the Occupi AI models.
The Occupi AI models endpoint is a RESTful API that allows you to interact with the Occupi models programmatically.
The Occupi AI models endpoint provides endpoints for receiving Occupancy predictions.


- [AI endpoint Usage](#auth-usage)
- [Table of Contents](#table-of-contents)
- [Base URL](#base-url)
- [AI](#ai)
- [Predict](#predict)
- [Predict Week](#predict-week)
- [Predict Date](#predict-date)
- [Predict Week from Date](#predict-week-from-date)

## AI

The AI model endpoints are used to make predictions on the occupancy of the office space.

### Base URL

The base URL for the AI model endpoint is:

- **URL**

`/ai.occupi.tech/`

- **Method**

`GET`

- **Success Response**

- **Code:** 200
- **Content:** `{ "response": "Prediction API is up and running" }`

- **Error Response**
- **Code:** 500
- **Content:** `{ "error": "models unavailable" }`

**_Example json to send:_**

```json copy
{}
```

### Predict

The predict endpoint is used to make a prediction on the occupancy for the office space for the current date.

- **URL**

`/predict`

- **Method**

`GET`

- **Success Response**

- **Code:** 200
- **Content:** `{"Day_of_Week": #,"Day_of_month": #,"Is_Weekend": false,"Month": #,"Predicted_Attendance_Level": "###-###","Predicted_Class": #,"Special_Event": #}`

- **Error Response**
- **Code:** 500
- **Content:** `{ "message": "An error occured" }`

**_Example json to send:_**

```json copy
{}
```

### Predict Week

The predict week endpoint is used to make a prediction on the occupancy for the office space for the current week.

- **URL**

`/predict_week`

- **Method**

`GET`

- **Success Response**

- **Code:** 200
- **Content:** `{"Day_of_Week": #,"Day_of_month": #,"Is_Weekend": false,"Month": #,"Predicted_Attendance_Level": "###-###","Predicted_Class": #,"Special_Event": #},{"Day_of_Week": #,"Day_of_month": #,"Is_Weekend": false,"Month": #,"Predicted_Attendance_Level": "###-###","Predicted_Class": #,"Special_Event": #},...`

- **Error Response**
- **Code:** 500
- **Content:** `{ "message": "An error occured" }`

**_Example json to send:_**

```json copy
{}
```

### Predict Date

The predict date endpoint is used to make a prediction on the occupancy for the office space for a specific date.

- **URL**

`/predict_date?date=yyyy-mm-dd`

- **Method**

`GET`

- **Success Response**

- **Code:** 200
- **Content:** `{"Day_of_Week": #,"Day_of_month": #,"Is_Weekend": false,"Month": #,"Predicted_Attendance_Level": "###-###","Predicted_Class": #,"Special_Event": #}`

- **Error Response**

- **Code:** 500
- **Content:** `{ "message": "An error occured" }`

**_Example json to send:_**

```json copy
{}
```

### Predict Week from Date

The predict week from date endpoint is used to make a prediction on the occupancy for the office space for the week starting from a specific date.

- **URL**

`/predict_week_from_date?date=yyyy-mm-dd`

- **Method**

`GET`

- **Success Response**

- **Code:** 200
- **Content:** `{"Day_of_Week": #,"Day_of_month": #,"Is_Weekend": false,"Month": #,"Predicted_Attendance_Level": "###-###","Predicted_Class": #,"Special_Event": #},{"Day_of_Week": #,"Day_of_month": #,"Is_Weekend": false,"Month": #,"Predicted_Attendance_Level": "###-###","Predicted_Class": #,"Special_Event": #},...`

- **Error Response**

- **Code:** 500
- **Content:** `{ "message": "An error occured" }`

**_Example json to send:_**

```json copy
{}
```



Loading

0 comments on commit 5a0e6d8

Please sign in to comment.