Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
louistiti committed Feb 7, 2022
2 parents fdeff12 + 6862778 commit f179e10
Show file tree
Hide file tree
Showing 56 changed files with 4,340 additions and 3,671 deletions.
7 changes: 6 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ LEON_AFTER_SPEECH=false
# Enable/disable Leon's speech-to-text
LEON_STT=false
# Speech-to-text provider
LEON_STT_PROVIDER=deepspeech
LEON_STT_PROVIDER=coqui-stt

# Enable/disable Leon's text-to-speech
LEON_TTS=false
# Text-to-speech provider
LEON_TTS_PROVIDER=flite

# Enable/disable packages to be available over HTTP
LEON_OVER_HTTP=true
# HTTP API key (use "npm run generate:http-api-key" to regenerate one)
LEON_HTTP_API_KEY=

# Enable/disable collaborative logger
LEON_LOGGER=true

Expand Down
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/BUG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ labels: bug
<!--
Thanks for your interest in Leon! ❤️
Please check if there is no similar issue before creating this one.
If the bug is related to the setup, please submit the issue at: https://github.com/leon-ai/leon-cli/issues/new/choose
-->

### Specs

- Leon version:
- OS (or browser) version:
- Node.js version:
- Complete "npm run check" output:
- Complete "leon check" (or "npm run check") output:
- (if using Docker) Complete "npm run docker:check" output:
- (optional) Leon package version:

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- name: Run JSON tests
run: npm run test:json

- name: Run over HTTP tests
run: npm run test:over-http

- name: Run E2E tests
run: npm run test:e2e

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bridges/python/.venv/*
downloads/*
logs/*
server/src/config/**/*.json
bin/deepspeech/*
bin/coqui/*
bin/flite/*

*.pyc
Expand Down
29 changes: 27 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
# [1.0.0-beta.5](https://github.com/leon-ai/leon/compare/v1.0.0-beta.4...1.0.0-beta.5) (2021-12-28) / Refocus
# [1.0.0-beta.6](https://github.com/leon-ai/leon/compare/v1.0.0-beta.5...1.0.0-beta.6) (2022-02-07) / Leon Over HTTP + Making Friends with Coqui STT
### Features
- simple coqui-ai stt integration [86a4816b](https://github.com/leon-ai/leon/commit/86a4816b777fee8ec9c89648c5866a75de56c017)
- HTTP API key generator [d10a7fa7](https://github.com/leon-ai/leon/commit/d10a7fa7880a0bf2fb1cae7904d1ef4257f05257)
- avoid unnecessary routes generation

- **server:**
- make Coqui STT the default STT solution [70399187](https://github.com/leon-ai/leon/commit/7039918760c0ef7ba93bf45820e3cae774c42d8c)
- add HTTP API key middleware [cdf41499](https://github.com/leon-ai/leon/commit/cdf4149939cbe3f3ae81039957dba3377a78f5a6)
- expose queries over HTTP [b6428d03](https://github.com/leon-ai/leon/commit/b6428d038452619f1682c863892cd8f376efca84)
- add timeout action over HTTP [115f9c16](https://github.com/leon-ai/leon/commit/115f9c164559d761625cc6f362749f7d2417d300)
- handle built-in and trim entities over HTTP + add "disabled" HTTP API action option [82fb967a](https://github.com/leon-ai/leon/commit/82fb967af8f49421e3b2474184da3d34fb17294f)
- execute modules over HTTP [2e5b2c59](https://github.com/leon-ai/leon/commit/2e5b2c59da0bafe3acd966773c6fac3611b3bd0c)
- generate Fastify routes on the file to expose packages over HTTP [5b41713a](https://github.com/leon-ai/leon/commit/5b41713a68ee628e695212dbebc88f6b9a94b461)
### Bug Fixes
- do not ask to regenerate the HTTP API key if this one isn't available yet [d265377a](https://github.com/leon-ai/leon/commit/d265377a43fd4506cf12db46f261b891f2054ed2)
- Python deps tree check [c6c01291](https://github.com/leon-ai/leon/commit/c6c012915824227efdf0c50df6a8f1cd8d70ed42)
- hotword offline (#342) [f563d01d](https://github.com/leon-ai/leon/commit/f563d01d077499c836e94c86f85cedc2ad4d56e6)
- addressed comments by @JRMeyer [b1c6f5c8](https://github.com/leon-ai/leon/commit/b1c6f5c883103d57d4fe566af640fc3ac5ce713d)
- allow to detect STT offline capabilities [04d62288](https://github.com/leon-ai/leon/commit/04d622884165e0bde65785569a659f59cf9e8582)
- Amazon Polly is always configured on check script due to new structure [e6246d1f](https://github.com/leon-ai/leon/commit/e6246d1f8f9ec15a4ebe9600764afffbaa7e62d9)

### Performance Improvements
- check if Python deps tree has been updated before going through deps install [2d0b0f13](https://github.com/leon-ai/leon/commit/2d0b0f1365d8e4d6eadf9f7cc0a16b7b4b4306f4)

# [1.0.0-beta.5](https://github.com/leon-ai/leon/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2021-12-28) / Refocus

*This release marks a major turn in the future versions of the Leon core. Please [read this blog post](https://blog.getleon.ai/i-ran-away-from-open-source/) to know more.*

Expand All @@ -13,7 +38,7 @@
### Documentation Changes
- URL redirect managed by registrar [c16d5b28](https://github.com/leon-ai/leon/commit/c16d5b280b758f7e18305e30678adec79f0a0716)

# [1.0.0-beta.4](https://github.com/leon-ai/leon/compare/1.0.0-beta.2...1.0.0-beta.4) (2021-05-01) / Getting Rid of Dust
# [1.0.0-beta.4](https://github.com/leon-ai/leon/compare/1.0.0-beta.2...v1.0.0-beta.4) (2021-05-01) / Getting Rid of Dust

*This release includes a lot of changes that are made under the hood and are not displayed here, please **[read the blog post](https://blog.getleon.ai/getting-rid-of-dust-1-0-0-beta-4/)** to know more.*

Expand Down
47 changes: 21 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
<a href="https://blog.getleon.ai/the-story-behind-leon/">Story</a>
</p>

<svg width="4438" height="1000" viewBox="0 0 4438 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2223.75 250C2051.25 250 1926.87 362.5 1926.87 531.25C1926.87 700 2066.72 812.5 2239.38 812.5C2343.59 812.5 2435.47 771.25 2492.34 701.719L2372.81 632.656C2341.25 667.188 2293.28 687.344 2239.38 687.344C2164.53 687.344 2100.94 648.281 2077.34 585.781H2515.16C2518.59 568.281 2520.63 550.156 2520.63 531.094C2520.63 362.5 2396.41 250 2223.75 250ZM2076.09 476.562C2095.62 414.219 2149.06 375 2223.75 375C2298.59 375 2352.03 414.219 2371.41 476.562H2076.09ZM2040.78 78.125L1607.81 828.125L1174.69 78.125H1337.03L1607.66 546.875L1878.28 78.125H2040.78ZM577.344 0L1154.69 1000H0L577.344 0ZM3148.75 531.25C3148.75 625 3210 687.5 3305 687.5C3369.38 687.5 3417.66 658.281 3442.5 610.625L3562.5 679.844C3512.81 762.656 3419.69 812.5 3305 812.5C3132.34 812.5 3008.13 700 3008.13 531.25C3008.13 362.5 3132.5 250 3305 250C3419.69 250 3512.66 299.844 3562.5 382.656L3442.5 451.875C3417.66 404.219 3369.38 375 3305 375C3210.16 375 3148.75 437.5 3148.75 531.25ZM4437.5 78.125V796.875H4296.88V78.125H4437.5ZM3906.25 250C3733.75 250 3609.38 362.5 3609.38 531.25C3609.38 700 3749.38 812.5 3921.88 812.5C4026.09 812.5 4117.97 771.25 4174.84 701.719L4055.31 632.656C4023.75 667.188 3975.78 687.344 3921.88 687.344C3847.03 687.344 3783.44 648.281 3759.84 585.781H4197.66C4201.09 568.281 4203.12 550.156 4203.12 531.094C4203.12 362.5 4078.91 250 3906.25 250ZM3758.59 476.562C3778.13 414.219 3831.41 375 3906.25 375C3981.09 375 4034.53 414.219 4053.91 476.562H3758.59ZM2961.25 265.625V417.031C2945.63 412.5 2929.06 409.375 2911.25 409.375C2820.47 409.375 2755 471.875 2755 565.625V796.875H2614.38V265.625H2755V409.375C2755 330 2847.34 265.625 2961.25 265.625Z" fill="black"/>
</svg>

---

## 👋 Introduction
Expand Down Expand Up @@ -83,37 +79,29 @@ Gitpod will automatically setup an environment and run an instance for you.

- [Node.js](https://nodejs.org/) >= 16
- [npm](https://npmjs.com/) >= 8
- [Python](https://www.python.org/downloads/) >= 3
- [Pipenv](https://docs.pipenv.org) >= 2020.11.15
- Supported OSes: Linux, macOS and Windows

To install these prerequisites, you can follow the [How To section](https://docs.getleon.ai/how-to/) of the documentation.

### Installation

```sh
# Clone the repository (stable branch)
git clone -b master https://github.com/leon-ai/leon.git leon
# OR download the latest release at: https://github.com/leon-ai/leon/releases/latest

# Go to the project root
cd leon
# Install the Leon CLI
npm install --global @leon-ai/cli

# Install
npm install
# Install Leon (stable branch)
leon create birth
# OR install from the develop branch: leon create birth --develop
```

### Usage

```sh
# Check the setup went well
npm run check

# Build
npm run build
leon check

# Run
npm start
leon start

# Go to http://localhost:1337
# Hooray! Leon is running
Expand All @@ -122,11 +110,11 @@ npm start
### Docker Installation

```sh
# Build
npm run docker:build
# Install Leon
leon create birth --docker

# Run
npm run docker:run
leon start

# Go to http://localhost:1337
# Hooray! Leon is running
Expand Down Expand Up @@ -184,7 +172,7 @@ You'll find a write-up on this [blog post](https://blog.getleon.ai/the-story-beh
<img src="https://github.com/GregoireAMATO.png?size=128" />
GrAMATO
</a><br>
<sub><sup>30 USD / month</sup></sub>
<sub><sup>17 USD / month</sup></sub>
</td>
<td align="center" valign="middle" width="128">
<a href="https://github.com/phareal">
Expand All @@ -194,9 +182,16 @@ You'll find a write-up on this [blog post](https://blog.getleon.ai/the-story-beh
<sub><sup>17 USD / month</sup></sub>
</td>
<td align="center" valign="middle" width="128">
<a href="https://github.com/marvinpoo">
<img src="https://github.com/marvinpoo.png?size=128" />
marvinpoo
<a href="https://github.com/Divlo">
<img src="https://github.com/Divlo.png?size=128" />
Divlo
</a><br>
<sub><sup>10 USD / month</sup></sub>
</td>
<td align="center" valign="middle" width="128">
<a href="https://github.com/KeithIMyers">
<img src="https://github.com/KeithIMyers.png?size=128" />
KeithIMyers
</a><br>
<sub><sup>10 USD / month</sup></sub>
</td>
Expand Down
2 changes: 1 addition & 1 deletion app/src/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class Client {
})

this.socket.on('download', (data) => {
window.location = `${this.serverUrl}/v1/downloads?package=${data.package}&module=${data.module}`
window.location = `${this.serverUrl}/api/v1/downloads?package=${data.package}&module=${data.module}`
})

if (this.history !== null) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ document.addEventListener('DOMContentLoaded', () => {

loader.start()

request.get(`${serverUrl}/v1/info`)
request.get(`${serverUrl}/api/v1/info`)
.end((err, res) => {
if (err || !res.ok) {
console.error(err.response.error.message)
Expand Down
File renamed without changes.
146 changes: 146 additions & 0 deletions core/pkgs-endpoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"endpoints": [
{
"method": "POST",
"route": "/api/p/calendar/todolist/create_list",
"params": [
"list"
],
"entitiesType": "trim"
},
{
"method": "GET",
"route": "/api/p/calendar/todolist/view_lists",
"params": []
},
{
"method": "POST",
"route": "/api/p/calendar/todolist/view_list",
"params": [
"list"
],
"entitiesType": "trim"
},
{
"method": "POST",
"route": "/api/p/calendar/todolist/rename_list",
"params": [
"old_list",
"new_list"
],
"entitiesType": "trim"
},
{
"method": "POST",
"route": "/api/p/calendar/todolist/delete_list",
"params": [
"list"
],
"entitiesType": "trim"
},
{
"method": "POST",
"route": "/api/p/calendar/todolist/add_todos",
"params": [
"todos",
"list"
],
"entitiesType": "trim"
},
{
"method": "POST",
"route": "/api/p/calendar/todolist/complete_todos",
"params": [
"todos",
"list"
],
"entitiesType": "trim"
},
{
"method": "POST",
"route": "/api/p/calendar/todolist/uncheck_todos",
"params": [
"todos",
"list"
],
"entitiesType": "trim"
},
{
"method": "POST",
"route": "/api/p/checker/isitdown/run",
"params": [
"url"
],
"entitiesType": "builtIn"
},
{
"method": "GET",
"route": "/api/p/checker/haveibeenpwned/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/leon/whoami/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/leon/joke/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/leon/greeting/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/leon/welcome/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/leon/meaningoflife/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/leon/randomnumber/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/leon/bye/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/leon/partnerassistant/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/network/speedtest/run",
"params": []
},
{
"method": "POST",
"route": "/api/p/trend/github/run",
"params": [
"number",
"daterange"
],
"entitiesType": "builtIn"
},
{
"method": "GET",
"route": "/api/p/trend/producthunt/run",
"params": []
},
{
"method": "GET",
"route": "/api/p/videodownloader/youtube/run",
"params": []
}
]
}
6 changes: 3 additions & 3 deletions hotword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const request = require('superagent')
const record = require('node-record-lpcm16')
const { Detector, Models } = require('snowboy')
const { Detector, Models } = require('@bugsounet/snowboy')
const { io } = require('socket.io-client')

process.env.LEON_HOST = process.env.LEON_HOST || 'http://localhost'
Expand All @@ -21,7 +21,7 @@ socket.on('connect', () => {
console.log('Waiting for hotword...')
})

request.get(`${url}/v1/info`)
request.get(`${url}/api/v1/info`)
.end((err, res) => {
if (err || !res.ok) {
if (!err.response) {
Expand All @@ -39,7 +39,7 @@ request.get(`${url}/v1/info`)
})

const detector = new Detector({
resource: `${__dirname}/node_modules/snowboy/resources/common.res`,
resource: `${__dirname}/node_modules/@bugsounet/snowboy/resources/common.res`,
models,
audioGain: 2.0,
applyFrontend: true
Expand Down
Loading

0 comments on commit f179e10

Please sign in to comment.