Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

OpenAI nodes #196

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open

OpenAI nodes #196

wants to merge 50 commits into from

Conversation

luiztauffer
Copy link

This PR needs the following PRs to work:
flojoy-ai/python#50

Description

  • I've included a concise description of what each node does

Styleguide

  • My node adheres to the styleguide for Flojoy nodes

Docs

  • I've submitted a PR for a documentation page for the new node(s) that contains usage examples (see docs.flojoy.io)
    Docs/openai nodes docs#143

Testing

  • This PR includes a unit test (example here and/or ideally a screenshot of the node's output on an example app.
    Except WHISPER_SPEECH_TO_TEXT which needs audio file to test - must check it

Features

  • OpenAI DALL-E node - The DALLE_IMAGE_GENERATOR node takes a prompt and generates an image using OpenAI's DALL-E model.
  • OpenAI Whisper node - The WHISPER_SPEECH_TO_TEXT node uses OpenAI whisper transcription model to convert audio to text.
  • Json Extraction Node - The JSON_EXTRACTOR node extract specific properties information from a text using JSON schema.

DALL-E Node Example
DallE

Whisper Node
whisper

JSON Extraction Node
image

AI_ML/OPENAI/DALLE_IMAGE_GENERATOR/app.txt Outdated Show resolved Hide resolved
AI_ML/OPENAI/JSON_EXTRACTOR/JSON_EXTRACTOR.py Outdated Show resolved Hide resolved
AI_ML/OPENAI/JSON_EXTRACTOR/JSON_EXTRACTOR.py Outdated Show resolved Hide resolved
AI_ML/OPENAI/JSON_EXTRACTOR/app.txt Outdated Show resolved Hide resolved
MANIFEST/dalle_image_generator.manifest.yaml Outdated Show resolved Hide resolved
LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/LOCAL_FILE.py Outdated Show resolved Hide resolved
@vinicvaz vinicvaz requested a review from smahmed776 August 1, 2023 21:19
Copy link
Member

@smahmed776 smahmed776 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ensure that Pytest is successfully running on CI. It appears that upgrading to the latest version of Flojoy might resolve the issue. otherwise looks good!

@vinicvaz
Copy link

vinicvaz commented Aug 2, 2023

Please ensure that Pytest is successfully running on CI. It appears that upgrading to the latest version of Flojoy might resolve the issue. otherwise looks good!

Besides the update to the right version, I think the OpenAI tests will fail due to the need of having OpenAI API KEY to run these nodes.
@smahmed776 how should we go with these tests? Should we skip these nodes tests or can we have an API KEY to use to test it?

@smahmed776
Copy link
Member

smahmed776 commented Aug 2, 2023

Please ensure that Pytest is successfully running on CI. It appears that upgrading to the latest version of Flojoy might resolve the issue. otherwise looks good!

Besides the update to the right version, I think the OpenAI tests will fail due to the need of having OpenAI API KEY to run these nodes. @smahmed776 how should we go with these tests? Should we skip these nodes tests or can we have an API KEY to use to test it?

@vinicvaz
Looking at this piece of code:

def test_DALLE_IMAGE_GENERATOR(mock_flojoy_decorator):
    api_key = os.getenv("OPENAI_API_KEY", None)
    if api_key:
                   .....

I assume that these tests will get ignored by default as api_key will get None value. Let me know if I am wrong.

@vinicvaz
Copy link

vinicvaz commented Aug 2, 2023

Please ensure that Pytest is successfully running on CI. It appears that upgrading to the latest version of Flojoy might resolve the issue. otherwise looks good!

Besides the update to the right version, I think the OpenAI tests will fail due to the need of having OpenAI API KEY to run these nodes. @smahmed776 how should we go with these tests? Should we skip these nodes tests or can we have an API KEY to use to test it?

@vinicvaz Looking at this piece of code:

def test_DALLE_IMAGE_GENERATOR(mock_flojoy_decorator):
    api_key = os.getenv("OPENAI_API_KEY", None)
    if api_key:
                   .....

I assume that these tests will get ignored by default as api_key will get None value. Let me know if I am wrong.

Yeah, the tests are being ´skiped´, but not sure if this is the best behavior since we are just passing the test with SUCCESS state without actually running

@jalium
Copy link

jalium commented Sep 15, 2023

Hey @vinicvaz - Is this PR good to go once conflicts are resolved?

@vinicvaz
Copy link

Hey @vinicvaz - Is this PR good to go once conflicts are resolved?

Still have to fix the tests for json extractor.
I haven't had time to finish this yet

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants