Skip to content

Commit 179f54b

Browse files
authored
Easy Peasy AI: Added new action components (#14190)
1 parent ce48071 commit 179f54b

File tree

7 files changed

+412
-7
lines changed

7 files changed

+412
-7
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import app from "../../easy_peasy_ai.app.mjs";
2+
3+
export default {
4+
key: "easy_peasy_ai-create-transcription",
5+
name: "Create Transcription",
6+
description: "Generates AI transcription for a given audio URL. [See the documentation](https://easy-peasy.ai/audios)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
url: {
12+
type: "string",
13+
label: "Audio URL",
14+
description: "The URL of the audio file to transcribe.",
15+
},
16+
audioType: {
17+
type: "string",
18+
label: "Audio Type",
19+
description: "The type of the audio file. Eg. `podcast`, `meeting`.",
20+
optional: true,
21+
},
22+
language: {
23+
description: "The language of the audio E.g. `English`, `Chinese`, `French`.",
24+
propDefinition: [
25+
app,
26+
"language",
27+
],
28+
},
29+
name: {
30+
type: "string",
31+
label: "Name",
32+
description: "The name of the transcription.",
33+
optional: true,
34+
},
35+
detectSpeakers: {
36+
type: "boolean",
37+
label: "Detect Speakers",
38+
description: "Whether to detect multiple speakers.",
39+
optional: true,
40+
},
41+
enhanceQuality: {
42+
type: "boolean",
43+
label: "Enhance Quality",
44+
description: "Whether to use enhanced quality for transcription.",
45+
optional: true,
46+
},
47+
},
48+
methods: {
49+
generateTranscription(args = {}) {
50+
return this.app.post({
51+
path: "/transcriptions",
52+
...args,
53+
});
54+
},
55+
},
56+
async run({ $ }) {
57+
const {
58+
generateTranscription,
59+
url,
60+
audioType,
61+
language,
62+
name,
63+
detectSpeakers,
64+
enhanceQuality,
65+
} = this;
66+
67+
const response = await generateTranscription({
68+
$,
69+
data: {
70+
url,
71+
audio_type: audioType,
72+
language,
73+
name,
74+
detect_speakers: detectSpeakers,
75+
enhance_quality: enhanceQuality,
76+
},
77+
});
78+
$.export("$summary", `Successfully created a transcription with ID \`${response.uuid}\`.`);
79+
return response;
80+
},
81+
};
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import app from "../../easy_peasy_ai.app.mjs";
2+
3+
export default {
4+
key: "easy_peasy_ai-generate-image",
5+
name: "Generate Image",
6+
description: "Generates an AI image based on the given prompt. [See the documentation](https://easy-peasy.ai/ai-images)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
prompt: {
12+
type: "string",
13+
label: "Prompt",
14+
description: "The textual description of the image to be generated. Eg. `A cat sitting on a chair`.",
15+
},
16+
model: {
17+
type: "string",
18+
label: "Model",
19+
description: "The model to use for image generation.",
20+
options: [
21+
"DALL-E 3",
22+
"Stable Diffusion XL",
23+
"Stable Diffusion 3.0",
24+
],
25+
},
26+
style: {
27+
type: "string",
28+
label: "Style",
29+
description: "The style of the generated image.",
30+
optional: true,
31+
},
32+
artist: {
33+
type: "string",
34+
label: "Artist",
35+
description: "The artist of the generated image.",
36+
optional: true,
37+
},
38+
dimensions: {
39+
type: "string",
40+
label: "Dimensions",
41+
description: "The dimensions of the generated image. Eg. `512x512`.",
42+
optional: true,
43+
},
44+
useHD: {
45+
type: "boolean",
46+
label: "Use HD",
47+
description: "Use high-definition image generation?",
48+
optional: true,
49+
},
50+
image: {
51+
type: "string",
52+
label: "Image",
53+
description: "Image URL for Image-to-Image generations.",
54+
optional: true,
55+
},
56+
},
57+
methods: {
58+
generateImage(args = {}) {
59+
return this.app.post({
60+
path: "/generate-image",
61+
...args,
62+
});
63+
},
64+
},
65+
async run({ $ }) {
66+
const {
67+
generateImage,
68+
prompt,
69+
model,
70+
style,
71+
artist,
72+
dimensions,
73+
useHD,
74+
image,
75+
} = this;
76+
77+
const response = await generateImage({
78+
$,
79+
data: {
80+
prompt,
81+
model,
82+
style,
83+
artist,
84+
dimensions,
85+
useHD,
86+
image,
87+
},
88+
});
89+
90+
$.export("$summary", "Successfully generated an image.");
91+
return response;
92+
},
93+
};
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import app from "../../easy_peasy_ai.app.mjs";
2+
import constants from "../../common/constants.mjs";
3+
4+
export default {
5+
key: "easy_peasy_ai-generate-text",
6+
name: "Generate Text",
7+
description: "Generates text outputs for the templates. [See the documentation](https://easy-peasy.ai/presets)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
app,
12+
preset: {
13+
type: "string",
14+
label: "Template",
15+
description: "The template name to use for generating content.",
16+
options: constants.TEMPLATES,
17+
},
18+
keywords: {
19+
type: "string",
20+
label: "Keywords",
21+
description: "Keywords to use for generating content. Eg. `Write an email to potential investors about my startup`. (maxlength: 1000)",
22+
},
23+
tone: {
24+
type: "string",
25+
label: "Tone",
26+
description: "The tone of the generated content. Eg. `friendly, funny, cheerful`.",
27+
optional: true,
28+
},
29+
extra1: {
30+
type: "string",
31+
label: "Extra 1",
32+
description: "Background Information (maxlength: 1000). Eg. `I am a software engineer`.",
33+
optional: true,
34+
},
35+
extra2: {
36+
type: "string",
37+
label: "Extra 2",
38+
description: "Background Information (maxlength: 1000). Eg. `I am starting a new business`.",
39+
optional: true,
40+
},
41+
extra3: {
42+
type: "string",
43+
label: "Extra 3",
44+
description: "Background Information (maxlength: 1000). Eg. `I am a student`.",
45+
optional: true,
46+
},
47+
outputs: {
48+
type: "integer",
49+
label: "Outputs",
50+
description: "The number of outputs to generate. Eg. `1`.",
51+
optional: true,
52+
},
53+
language: {
54+
propDefinition: [
55+
app,
56+
"language",
57+
],
58+
},
59+
shouldUseGPT4: {
60+
type: "boolean",
61+
label: "Use GPT-4",
62+
description: "Use advanced AI model? Use the GPT-4 model for generating content.",
63+
optional: true,
64+
},
65+
},
66+
methods: {
67+
generateText(args = {}) {
68+
return this.app.post({
69+
path: "/generate",
70+
...args,
71+
});
72+
},
73+
},
74+
async run({ $ }) {
75+
const {
76+
generateText,
77+
preset,
78+
keywords,
79+
tone,
80+
extra1,
81+
extra2,
82+
extra3,
83+
outputs,
84+
language,
85+
shouldUseGPT4,
86+
} = this;
87+
88+
const response = await generateText({
89+
$,
90+
data: {
91+
preset,
92+
keywords,
93+
tone,
94+
extra1,
95+
extra2,
96+
extra3,
97+
outputs,
98+
language,
99+
shouldUseGPT4,
100+
},
101+
});
102+
$.export("$summary", "Successfully generated text content.");
103+
return response;
104+
},
105+
};
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
const TEMPLATES = [
2+
"custom-generator",
3+
"paragraph-writer",
4+
"instagram-post-caption",
5+
"linkedin-post-generator",
6+
"full-blog-post",
7+
"blog-post",
8+
"aida-framework",
9+
"before-after-bridge-framework",
10+
"problem-agitate-solution-framework",
11+
"sentence-expander",
12+
"content-rewriter",
13+
"content-summarizer",
14+
"grammar-corrector",
15+
"native-speaker",
16+
"clickbait-title-generator",
17+
"reply-to-messsage",
18+
"reply-to-email",
19+
"email-generation",
20+
"email-subject-line-generation",
21+
"resume-headline-generator",
22+
"linkedin-bio-generator",
23+
"linkedin-recommendation-generator",
24+
"linkedin-headline-generator",
25+
"performance-review-generator",
26+
"smart-goal-generator",
27+
"testimonial-and-review-generator",
28+
"press-release-generator",
29+
"catchy-tagline",
30+
"headline-generator",
31+
"amazon-product-description-paragraph",
32+
"amazon-product-bullets",
33+
"resume-objective-generator",
34+
"job-description-generator",
35+
"job-summary-generator",
36+
"job-qualifications-generator",
37+
"job-responsibilities-generator",
38+
"interview-questions-generator",
39+
"interview-feedback-generator",
40+
"blog-post-title",
41+
"blog-post-outline",
42+
"blog-post-intro",
43+
"blog-post-conclusion",
44+
"startup-ideas",
45+
"user-story",
46+
"acceptance-criteria",
47+
"translate-to-singlish",
48+
"eli5",
49+
"business-name",
50+
"fill-the-gaps",
51+
"youtube-video-title",
52+
"youtube-video-description",
53+
"youtube-video-ideas",
54+
"youtube-video-script-outline",
55+
"tiktok-video-caption",
56+
"tiktok-hashtags-generator",
57+
"quora-answers",
58+
"about-me-generator",
59+
"google-ads-headlines",
60+
"google-ads-descriptions",
61+
"facebook-ads-headlines",
62+
"facebook-ads-primary-text",
63+
"seo-title-meta-descriptions",
64+
"cover-letter-generator",
65+
"twitter-post",
66+
"twitter-thread",
67+
"twitter-bio-generator",
68+
"song-idea-generator",
69+
"song-lyrics-generator",
70+
"album-title-generator",
71+
"product-descriptions",
72+
"ai-story-generator",
73+
"poem-title-generator",
74+
"poem-generator",
75+
"quote-generator",
76+
"ai-joke-generator",
77+
"greetings-generator",
78+
"tinder-bio",
79+
"pick-up-line-generator",
80+
"instagram-bio",
81+
"podcast-episode-title-generator",
82+
"podcast-episode-description-generator",
83+
"podcast-show-notes-generator",
84+
"real-estate-listing-generator",
85+
];
86+
87+
export default {
88+
TEMPLATES,
89+
};

0 commit comments

Comments
 (0)