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

#7832 - Eden AI adjustments #8007

Merged
merged 8 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
import app from "../../eden_ai.app.mjs";

const options = [
"amazon",
"connexun",
"google",
"ibm",
"lettria",
"microsoft",
"emvista",
"oneai",
"openai",
"tenstorrent",
"sapling",
];

export default {
key: "eden_ai-analyze-sentiment-in-text",
name: "Analyze Sentiment in Text",
description: "Analyzes sentiment in the provided text. [See the documentation](https://docs.edenai.co/reference/text_sentiment_analysis_create)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand All @@ -19,12 +33,14 @@ export default {
app,
"providers",
],
options,
},
fallbackProviders: {
propDefinition: [
app,
"fallbackProviders",
],
options,
},
showOriginalResponse: {
propDefinition: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import app from "../../eden_ai.app.mjs";

const options = [
"originalityai",
"sapling",
];

export default {
key: "eden_ai-detect-ai-content",
name: "Detect AI Content",
description:
"Detects AI content in the provided text. [See the documentation](https://docs.edenai.co/reference/text_ai_detection_create)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand All @@ -20,12 +25,14 @@ export default {
app,
"providers",
],
options,
},
fallbackProviders: {
propDefinition: [
app,
"fallbackProviders",
],
options,
},
showOriginalResponse: {
propDefinition: [
Expand Down
13 changes: 11 additions & 2 deletions components/eden_ai/actions/generate-image/generate-image.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import app from "../../eden_ai.app.mjs";

const options = [
"deepai",
"openai",
"stabilityai",
"replicate",
];

export default {
key: "eden_ai-generate-image",
name: "Generate Image",
description: "Generates an image from the provided description. [See the documentation](https://docs.edenai.co/reference/image_generation_create)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down Expand Up @@ -39,12 +46,14 @@ export default {
app,
"providers",
],
options,
},
fallbackProviders: {
propDefinition: [
app,
"fallbackProviders",
],
options,
},
showOriginalResponse: {
propDefinition: [
Expand All @@ -68,7 +77,7 @@ export default {
data: {
text,
resolution,
number_of_images: numImages,
num_images: numImages,
providers: providers.join(),
fallback_providers: fallbackProviders?.join(),
show_original_response: showOriginalResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ import { ConfigurationError } from "@pipedream/platform";
import FormData from "form-data";
import fs from "fs";

const options = [
"deepl",
"google",
];

export default {
key: "eden_ai-translate-document",
name: "Translate Document",
description: "Translates a document from a local file or URL. [See the documentation](https://docs.edenai.co/reference/translation_document_translation_create)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand All @@ -16,12 +21,14 @@ export default {
app,
"providers",
],
options,
},
fallbackProviders: {
propDefinition: [
app,
"fallbackProviders",
],
options,
},
showOriginalResponse: {
propDefinition: [
Expand Down Expand Up @@ -64,7 +71,7 @@ export default {

let headers, data = {
providers: providers.join(),
fallback_providers: fallbackProviders.join(),
fallback_providers: fallbackProviders?.join(),
show_original_response: showOriginalResponse,
source_language: sourceLanguage,
target_language: targetLanguage,
Expand All @@ -81,9 +88,10 @@ export default {
}
});

formData.append("file", fs.createReadStream(file.startsWith("/tmp/")
const content = fs.createReadStream(file.includes("tmp/")
? file
: `/tmp/${file}`));
: `/tmp/${file}`);
formData.append("file", content);
headers = {
"Content-Type": `multipart/form-data; boundary=${formData._boundary}`,
};
Expand Down
4 changes: 2 additions & 2 deletions components/eden_ai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/eden_ai",
"version": "0.1.0",
"version": "0.1.1",
"description": "Pipedream Eden AI Components",
"main": "eden_ai.app.mjs",
"keywords": [
Expand All @@ -16,4 +16,4 @@
"@pipedream/platform": "^1.5.1",
"form-data": "^4.0.0"
}
}
}
44 changes: 44 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading