Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/GitHub action #1

Merged
merged 40 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
97dca78
Update README.md
JeremyLambert Oct 27, 2022
11ebe84
Update README.md
JeremyLambert Oct 27, 2022
a5ab158
Update README.md
JeremyLambert Oct 27, 2022
0a8014f
Update README.md
JeremyLambert Oct 27, 2022
81b41b1
Add files via upload
JeremyLambert Oct 27, 2022
3eebbc8
Update README.md
JeremyLambert Oct 27, 2022
426f3c1
Update README.md
JeremyLambert Oct 27, 2022
2041099
Update README.md
JeremyLambert Oct 27, 2022
8584f54
Update README.md
JeremyLambert Oct 27, 2022
0617f67
Update README.md
JeremyLambert Oct 27, 2022
911c04b
Delete Discord-Logo (1).png
JeremyLambert Oct 27, 2022
5059c85
Add files via upload
JeremyLambert Oct 27, 2022
f80d37b
Update README.md
JeremyLambert Oct 27, 2022
d214da2
Delete Discord_Logo_sans_texte.svg.png
JeremyLambert Oct 27, 2022
2a12bc0
Add files via upload
JeremyLambert Oct 27, 2022
8bfcdfa
Delete discord-logo.svg
JeremyLambert Oct 27, 2022
d738b15
Add files via upload
JeremyLambert Oct 27, 2022
797bab9
Update README.md
JeremyLambert Oct 27, 2022
b8671a1
Add files via upload
JeremyLambert Oct 27, 2022
d7dd8e6
Delete Discord-Logo (1)(1).png
JeremyLambert Oct 27, 2022
23cb1da
Update README.md
JeremyLambert Oct 27, 2022
ad5cc1d
Delete Discord-Logo.png
JeremyLambert Oct 27, 2022
2514559
Add files via upload
JeremyLambert Oct 27, 2022
fe747a5
Update README.md
JeremyLambert Oct 27, 2022
929c926
Update README.md
JeremyLambert Oct 27, 2022
d0b8093
Update README.md
JeremyLambert Oct 27, 2022
89e0717
Update README.md
JeremyLambert Oct 27, 2022
8cbf11e
[fix] return Response Success Dataclass in delete and upload image_se…
Oct 27, 2022
5c82549
Merge branch 'master' of https://github.com/edenai/edenai_apis
Oct 27, 2022
40ade59
Update README.md
JeremyLambert Oct 27, 2022
e4c2c07
Update README.md
JeremyLambert Oct 27, 2022
d912d27
Update README.md
JeremyLambert Oct 27, 2022
69dc3b2
Update README.md
JeremyLambert Oct 27, 2022
22f34ad
Update README.md
JeremyLambert Oct 27, 2022
1f8dae5
Update README.md
JeremyLambert Oct 27, 2022
846df05
[fix] handle no face found in google video face detection
Oct 27, 2022
37fa446
Merge branch 'master' of github.com:edenai/edenai-apis
Oct 27, 2022
2435c77
[feat] add github action file
KyrianC Oct 28, 2022
814b784
[fix] mv provider config in their own class or function
KyrianC Oct 28, 2022
e455a20
[fix] skip some tests for github action
KyrianC Oct 28, 2022
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
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# .github/workflows/app.yaml
name: Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- staging

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ffmpeg -y
pip install -r requirements.txt
- name: Set Env variables
run: "echo TEST_SCOPE=CICD-OPENSOURCE >> $GITHUB_ENV"
- name: Run Test suite
run: |
pytest -vvv -s -n auto --maxprocesses=8
Binary file added Discord-Logo-Edenai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 32 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
# EdenAI - Providers Connectors
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Website](https://img.shields.io/website-up-down-green-red/http/monip.org.svg)](https://www.edenai.co/)

Eden AI aims to simplify the use and deployment of AI technologies by providing a unique API (application programming interface) that connects to the best possible AI engines. These engines are either proprietary or Open source AI engines, and can be used for different purposes, e.g, face
detection, OCR (receipt, invoice, table...), keyword extraction, sentiment analysis, face detection, and much more. These technologies are provided by the best suppliers in the market. We can cite briefly some of them: Amazon, Google, Microsoft, Dataleon, and Mindee and many others. Eden AI take care of providing to it’s clients the best AI engine suited to their projects, and this, with the goal of keeping AI light and easy to any developer.
[![License](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VYwTbMQc8u) ![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white) [![Linkedin](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/edenai/)

![Eden AI Logo](EdenAI-WrittenLogo(1).png)

[Join us on discord !](https://discord.gg/baX77uwa)
# EdenAI - AI APIs

![EdenAI_logo](https://media-exp1.licdn.com/dms/image/D4E3DAQELmESPpY1T7w/image-scale_191_1128/0/1664541418002?e=1666281600&v=beta&t=VE98W7VHQGF-wYGFiv4erS-V74R6l4UMrA7aGjYGeYw)
[Eden AI](https://www.edenai.co/) aims to simplify the use and deployment of AI technologies by providing a unique API (application programming interface) that connects to the best possible AI engines. These engines are either proprietary or Open source AI engines, and can be used for different purposes, e.g, face
detection, OCR (receipt, invoice, table...), keyword extraction, sentiment analysis, face detection, and much more. These technologies are provided by the best suppliers in the market. We can cite briefly some of them: Amazon, Google, Microsoft, Dataleon, and Mindee and many others. Eden AI take care of providing to it’s clients the best AI engine suited to their projects, and this, with the goal of keeping AI light and easy to any developer.

![EdenAI Gif](ezgif.com-gif-maker(1).gif)

## Introduction to the package

Eden AI's Providers Connectors is the open source package including necessary methods for using AI technologies from different [providers](#provider). The package contains principally `five packages` and `one interface module`:

### **interface**

The module interface is responsable of linking providers subfeature methods to our back-end project (which is, on the other hand, private). It containts principally five functions that you can use to interact with providers' subfeatures. We list the methods hereafter:
The module interface is responsible of linking providers subfeature methods to our back-end project (which is, on the other hand, private). It contains principally five functions that you can use to interact with providers' subfeatures. We list the methods hereafter:

* #### list_features

Returns possible combinations of (`provider`, `feature`, `subfeature`) or (`provider`, `feature`, `subfeature`, `phase`) given a provider, feature and subfeature as a list if **as_dict** is set to False, otherwise returns the resutls as a dictionary. If neither the provider, feature or subfeature are passed withing the function arguments, it returns the list of all possible combinations.
Returns possible combinations of (`provider`, `feature`, `subfeature`) or (`provider`, `feature`, `subfeature`, `phase`) given a provider, feature and subfeature as a list if **as_dict** is set to False, otherwise returns the results as a dictionary. If neither the provider, feature or subfeature are passed withing the function arguments, it returns the list of all possible combinations.

```python
def list_features( provider_name: str = None, feature: str = None, subfeature: str = None, as_dict: bool = False) -> Union[List, Dict]:
```

*E.g of a dict results:*:
*E.g. of a dict results:*

```python
{
Expand Down Expand Up @@ -61,7 +65,7 @@ The module interface is responsable of linking providers subfeature methods to o

* ### get_async_job_result

When the computed subfeature using `compute_output` is **asyncronous**, a *`public_job_id`* is returned. Passing this *`public_job_id`* along a given provider, feature, subfeature and phase as arguments for the `get_async_job_result` function returns the result of the asyncronous call.
When the computed subfeature using `compute_output` is **asynchronous**, a *`public_job_id`* is returned. Passing this *`public_job_id`* along a given provider, feature, subfeature and phase as arguments for the `get_async_job_result` function returns the result of the asyncronous call.

```python
def get_async_job_result(provider_name: str, feature: str, subfeature: str, async_job_id: str,
Expand All @@ -82,25 +86,25 @@ In the EdenAI organization, we follow a naming patterns based on `four` principl

### **Provider**

`Provider` represents names of the suppliers from which we integrate our AI technologies. *E.g,: Amazon, Google, Microsoft, Dateleon and Mindee* and many others. To this time, *Eden AI* have integrated in it's platform more than 25 **providers**.
`Provider` represents names of the suppliers from which we integrate our AI technologies. *E.g.: Amazon, Google, Microsoft, Dateleon and Mindee* and many others. To this time, *Eden AI* has integrated in it's platform more than 25 **providers**.

### **Subfeature**

`Subfeauture` represents the naming schema for the integrated `AI Technologies`. *E.g,: automatic_translation, text_to_speech, face_detection, invoice_parser or keyword_extraction*.

### **Feature**

To better apprehend the use of each of the `subfeatures` available in our platform, we grouped related subfeatures into categories that we named `features`. In other words, each feature encompasses a list of subfeatures. *E,g.:* the feature **audio** contains the two subfeatures: *speech_to_text_*[async](#async-logic) and *text_to_speech*.
To better apprehend the use of each of the `subfeatures` available in our platform, we grouped related subfeatures into categories that we named `features`. In other words, each feature encompasses a list of subfeatures. *E.g.:* the feature **audio** contains the two subfeatures: *speech_to_text_*[async](#async-logic) and *text_to_speech*.

### **Phase**

For some subfeatures, the computation may encompass different stages to execute, usually sequentially, but not always. These stages are named `phases`. *E.g,* the subfeature `seach` inside the feature `image` encompass four **phases**: *upload_image*, *get_image*, *get_images*, *launch_similarity*, *delete_image*.
For some subfeatures, the computation may encompass different stages to execute, usually sequentially, but not always. These stages are named `phases`. *E.g.* the subfeature `seach` inside the feature `image` encompass four **phases**: *upload_image*, *get_image*, *get_images*, *launch_similarity*, *delete_image*.

### **Async logic**

Some subfeatures can be time consuming, like converting *speech* to *text*, and so, in a logic cycle of (request/response), the computing result can not be sent directly to the user. In this context, we propose an `Asynchrone logic`, in which the final result is differed, but instead, users can check reapedetly for the call result.
Some subfeatures can be time consuming, like converting *speech* to *text*, and so, in a logic cycle of (request/response), the computing result can not be sent directly to the user. In this context, we propose an `Asynchrone logic`, in which the final result is differed, but instead, users can check repeatedly for the call result.

In order the support this implementation logic, subfeatures that are asynchrone ends with **_async** and are splitted into two methods call with two possible [`suffix`](#suffix): **__launch_job** and **__get_job_result**. *E.g,:*
In order to support this implementation logic, subfeatures that are asynchronous end with **_async** and are splitted into two methods called with two possible [`suffix`](#suffix): **__launch_job** and **__get_job_result**. *E.g.:*

```python
def audio__speech_to_text_async__launch_job(self, file: BufferedReader, language: str) -> AsyncLaunchJobResponseType:
Expand All @@ -112,15 +116,26 @@ In order the support this implementation logic, subfeatures that are asynchrone

### **Suffix**

Used suffixes are usually either **__launch_job** or **__get_job_result**. The **__launch_job** suffix refers to the subfeature method responsable for starting the the asynchronous call. The **__get_job_result** refers to the subfeature method for handling the result of the asynchronous call.
Used suffixes are usually either **__launch_job** or **__get_job_result**. The **__launch_job** suffix refers to the subfeature method responsible for starting the the asynchronous call. The **__get_job_result** refers to the subfeature method for handling the result of the asynchronous call.

### Standarized response
### Standardized response

Responses to the same `subfeature` even if called from different providers are all `standarized` to a uniform response.
Responses to the same `subfeature` even if called from different providers are all `standardized` to a uniform response.

## Contribute

You are more than welcome to contribute to our project, just `Fork the project`, `push` your modifications into a `branch` and open a `Pull Request`. We will be happy to check and eventually merge your **contributions** into our project.

## Don’t want to create accounts for all providers and host the project?
You can create an account on [Eden AI](https://app.edenai.run/user/register) and have access to all the AI technologies and providers directly through our API.
[![Eden AI Logo](EdenAI-WrittenLogo(1).png)](https://app.edenai.run/user/register)


## Join the community!
Join our friendly community to improve your skills, focus on the integration of AI engines, get help to use Eden AI API and much more !

[![](https://dcbadge.vercel.app/api/server/VYwTbMQc8u)](https://discord.com/invite/VYwTbMQc8u)


## License :
[Apache License 2.0](LICENSE)
Loading