Eden AI APIs: Your Gateway to Simplified AI Integration

Category :

Eden AI aims to simplify the usage and deployment of AI technologies by offering a unique API that connects to the best AI engines in the market. With the rising trend of AI as a Service, countless companies provide trained models accessible directly through an API, ranging from tech giants like Google, Microsoft, and Amazon to specialized firms such as DeepL (translation) and OpenAI (text and image analysis). Rather than creating individual implementations for each provider, Eden AI regroups these capabilities in one cohesive platform.

Package Installation

Getting started with Eden AI is straightforward. You can install the package using pip with the following command:

pip install git+https://github.com/edenaieden/ai-apis

Quick Start

Once you have the package installed, it’s time to make some API calls. Here’s a quick guide:

  1. First, you’ll need to add the API keys/secrets for the provider in the edenai_apis/api_keys/provider_name_settings_templates.json file. Once done, rename this file to provider_name_settings.json.
  2. To start using the APIs, below is an example of keyword extraction using Microsoft and IBM:
from edenai_apis import Text

keyword_extraction = Text.keyword_extraction(microsoft)
microsoft_res = keyword_extraction(language='en', text='as simple as that')

# Providers response
print(microsoft_res.original_response)

# Standardized version of Providers response
print(microsoft_res.standardized_response)

for item in microsoft_res.standardized_response.items:
    print(f'keyword: {item.keyword}, importance: {item.importance}')

# Trying another provider
ibm_kw = Text.keyword_extraction(ibm)
ibm_res = ibm_kw(language='en', text='same API, unified inputs for all providers')

# Original response will differ; check documentation for each provider for parsing
print(ibm_res.original_response)

# Parsing standardized response
for item in ibm_res.standardized_response.items:
    print(f'keyword: {item.keyword}, importance: {item.importance}')  

Think of the above code like ordering ingredients for two different recipes—Microsoft and IBM. You follow the same recipe format (API call) but based on the chef (AI provider), the ingredient list (response) may vary slightly. You get your ingredients (information) using a consistent process, making the transition between different chefs (providers) seamless.

Asynchronous Features

For features like speech to text and object extraction from videos, you need to use asynchronous operations. The process is a little different, where you send a request to launch a job, receive a job ID, and then check its status or results:

from edenai_apis import Audio

provider = google  # could also be assemblyai, deepgram, etc.

# Launching a speech-to-text job asynchronously
stt_launch = Audio.speech_to_text_async__launch_job(provider)
res = stt_launch(
    file='your_file.wav',
    language='en',
    speakers=2,
    profanity_filter=False,
)

job_id = stt_launch.provider_job_id

# Getting the result
stt_get_result = Audio.speech_to_text_async__get_job_result(provider)
res = stt_get_result(provider_job_id=job_id)

print(res.status)  # pending, succeeded, failed

This is like placing an order for food to be delivered at a future time. You place your order (launch a job) and get a receipt (job ID) to track its status. Once your food is ready (job is finished), you can enjoy your meal (results)!

All Available Features and Providers

You can view a comprehensive list of all available features and providers by following this link: Available Features and Providers.

Contribute

Your contribution is welcome! To add a new AI provider’s API or a new feature, please follow our guidelines in the documentation. For detailed discussions, feel free to join our community on Discord.

Don’t Want to Create Accounts for All Providers?

If you prefer not to create individual accounts for each provider, create an account on Eden AI and enjoy access to all AI technologies directly through our unified API.

Troubleshooting Ideas

While integrating with Eden AI, you might encounter some common issues:

  • Invalid API Key: Ensure your API keys are added correctly in the settings file.
  • Provider Not Responding: Check if the selected provider is currently accessible and review their documentation for any changes.
  • Code Errors: Double-check your code implementation for typos and ensure proper syntax is followed.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

License

The Eden AI API is licensed under the Apache License 2.0.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox

Latest Insights

© 2024 All Rights Reserved

×