-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Easy Peasy AI: Added new action components (#14190)
- Loading branch information
Showing
7 changed files
with
412 additions
and
7 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
components/easy_peasy_ai/actions/create-transcription/create-transcription.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import app from "../../easy_peasy_ai.app.mjs"; | ||
|
||
export default { | ||
key: "easy_peasy_ai-create-transcription", | ||
name: "Create Transcription", | ||
description: "Generates AI transcription for a given audio URL. [See the documentation](https://easy-peasy.ai/audios)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
url: { | ||
type: "string", | ||
label: "Audio URL", | ||
description: "The URL of the audio file to transcribe.", | ||
}, | ||
audioType: { | ||
type: "string", | ||
label: "Audio Type", | ||
description: "The type of the audio file. Eg. `podcast`, `meeting`.", | ||
optional: true, | ||
}, | ||
language: { | ||
description: "The language of the audio E.g. `English`, `Chinese`, `French`.", | ||
propDefinition: [ | ||
app, | ||
"language", | ||
], | ||
}, | ||
name: { | ||
type: "string", | ||
label: "Name", | ||
description: "The name of the transcription.", | ||
optional: true, | ||
}, | ||
detectSpeakers: { | ||
type: "boolean", | ||
label: "Detect Speakers", | ||
description: "Whether to detect multiple speakers.", | ||
optional: true, | ||
}, | ||
enhanceQuality: { | ||
type: "boolean", | ||
label: "Enhance Quality", | ||
description: "Whether to use enhanced quality for transcription.", | ||
optional: true, | ||
}, | ||
}, | ||
methods: { | ||
generateTranscription(args = {}) { | ||
return this.app.post({ | ||
path: "/transcriptions", | ||
...args, | ||
}); | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const { | ||
generateTranscription, | ||
url, | ||
audioType, | ||
language, | ||
name, | ||
detectSpeakers, | ||
enhanceQuality, | ||
} = this; | ||
|
||
const response = await generateTranscription({ | ||
$, | ||
data: { | ||
url, | ||
audio_type: audioType, | ||
language, | ||
name, | ||
detect_speakers: detectSpeakers, | ||
enhance_quality: enhanceQuality, | ||
}, | ||
}); | ||
$.export("$summary", `Successfully created a transcription with ID \`${response.uuid}\`.`); | ||
return response; | ||
}, | ||
}; |
93 changes: 93 additions & 0 deletions
93
components/easy_peasy_ai/actions/generate-image/generate-image.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import app from "../../easy_peasy_ai.app.mjs"; | ||
|
||
export default { | ||
key: "easy_peasy_ai-generate-image", | ||
name: "Generate Image", | ||
description: "Generates an AI image based on the given prompt. [See the documentation](https://easy-peasy.ai/ai-images)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
prompt: { | ||
type: "string", | ||
label: "Prompt", | ||
description: "The textual description of the image to be generated. Eg. `A cat sitting on a chair`.", | ||
}, | ||
model: { | ||
type: "string", | ||
label: "Model", | ||
description: "The model to use for image generation.", | ||
options: [ | ||
"DALL-E 3", | ||
"Stable Diffusion XL", | ||
"Stable Diffusion 3.0", | ||
], | ||
}, | ||
style: { | ||
type: "string", | ||
label: "Style", | ||
description: "The style of the generated image.", | ||
optional: true, | ||
}, | ||
artist: { | ||
type: "string", | ||
label: "Artist", | ||
description: "The artist of the generated image.", | ||
optional: true, | ||
}, | ||
dimensions: { | ||
type: "string", | ||
label: "Dimensions", | ||
description: "The dimensions of the generated image. Eg. `512x512`.", | ||
optional: true, | ||
}, | ||
useHD: { | ||
type: "boolean", | ||
label: "Use HD", | ||
description: "Use high-definition image generation?", | ||
optional: true, | ||
}, | ||
image: { | ||
type: "string", | ||
label: "Image", | ||
description: "Image URL for Image-to-Image generations.", | ||
optional: true, | ||
}, | ||
}, | ||
methods: { | ||
generateImage(args = {}) { | ||
return this.app.post({ | ||
path: "/generate-image", | ||
...args, | ||
}); | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const { | ||
generateImage, | ||
prompt, | ||
model, | ||
style, | ||
artist, | ||
dimensions, | ||
useHD, | ||
image, | ||
} = this; | ||
|
||
const response = await generateImage({ | ||
$, | ||
data: { | ||
prompt, | ||
model, | ||
style, | ||
artist, | ||
dimensions, | ||
useHD, | ||
image, | ||
}, | ||
}); | ||
|
||
$.export("$summary", "Successfully generated an image."); | ||
return response; | ||
}, | ||
}; |
105 changes: 105 additions & 0 deletions
105
components/easy_peasy_ai/actions/generate-text/generate-text.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import app from "../../easy_peasy_ai.app.mjs"; | ||
import constants from "../../common/constants.mjs"; | ||
|
||
export default { | ||
key: "easy_peasy_ai-generate-text", | ||
name: "Generate Text", | ||
description: "Generates text outputs for the templates. [See the documentation](https://easy-peasy.ai/presets)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
preset: { | ||
type: "string", | ||
label: "Template", | ||
description: "The template name to use for generating content.", | ||
options: constants.TEMPLATES, | ||
}, | ||
keywords: { | ||
type: "string", | ||
label: "Keywords", | ||
description: "Keywords to use for generating content. Eg. `Write an email to potential investors about my startup`. (maxlength: 1000)", | ||
}, | ||
tone: { | ||
type: "string", | ||
label: "Tone", | ||
description: "The tone of the generated content. Eg. `friendly, funny, cheerful`.", | ||
optional: true, | ||
}, | ||
extra1: { | ||
type: "string", | ||
label: "Extra 1", | ||
description: "Background Information (maxlength: 1000). Eg. `I am a software engineer`.", | ||
optional: true, | ||
}, | ||
extra2: { | ||
type: "string", | ||
label: "Extra 2", | ||
description: "Background Information (maxlength: 1000). Eg. `I am starting a new business`.", | ||
optional: true, | ||
}, | ||
extra3: { | ||
type: "string", | ||
label: "Extra 3", | ||
description: "Background Information (maxlength: 1000). Eg. `I am a student`.", | ||
optional: true, | ||
}, | ||
outputs: { | ||
type: "integer", | ||
label: "Outputs", | ||
description: "The number of outputs to generate. Eg. `1`.", | ||
optional: true, | ||
}, | ||
language: { | ||
propDefinition: [ | ||
app, | ||
"language", | ||
], | ||
}, | ||
shouldUseGPT4: { | ||
type: "boolean", | ||
label: "Use GPT-4", | ||
description: "Use advanced AI model? Use the GPT-4 model for generating content.", | ||
optional: true, | ||
}, | ||
}, | ||
methods: { | ||
generateText(args = {}) { | ||
return this.app.post({ | ||
path: "/generate", | ||
...args, | ||
}); | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const { | ||
generateText, | ||
preset, | ||
keywords, | ||
tone, | ||
extra1, | ||
extra2, | ||
extra3, | ||
outputs, | ||
language, | ||
shouldUseGPT4, | ||
} = this; | ||
|
||
const response = await generateText({ | ||
$, | ||
data: { | ||
preset, | ||
keywords, | ||
tone, | ||
extra1, | ||
extra2, | ||
extra3, | ||
outputs, | ||
language, | ||
shouldUseGPT4, | ||
}, | ||
}); | ||
$.export("$summary", "Successfully generated text content."); | ||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
const TEMPLATES = [ | ||
"custom-generator", | ||
"paragraph-writer", | ||
"instagram-post-caption", | ||
"linkedin-post-generator", | ||
"full-blog-post", | ||
"blog-post", | ||
"aida-framework", | ||
"before-after-bridge-framework", | ||
"problem-agitate-solution-framework", | ||
"sentence-expander", | ||
"content-rewriter", | ||
"content-summarizer", | ||
"grammar-corrector", | ||
"native-speaker", | ||
"clickbait-title-generator", | ||
"reply-to-messsage", | ||
"reply-to-email", | ||
"email-generation", | ||
"email-subject-line-generation", | ||
"resume-headline-generator", | ||
"linkedin-bio-generator", | ||
"linkedin-recommendation-generator", | ||
"linkedin-headline-generator", | ||
"performance-review-generator", | ||
"smart-goal-generator", | ||
"testimonial-and-review-generator", | ||
"press-release-generator", | ||
"catchy-tagline", | ||
"headline-generator", | ||
"amazon-product-description-paragraph", | ||
"amazon-product-bullets", | ||
"resume-objective-generator", | ||
"job-description-generator", | ||
"job-summary-generator", | ||
"job-qualifications-generator", | ||
"job-responsibilities-generator", | ||
"interview-questions-generator", | ||
"interview-feedback-generator", | ||
"blog-post-title", | ||
"blog-post-outline", | ||
"blog-post-intro", | ||
"blog-post-conclusion", | ||
"startup-ideas", | ||
"user-story", | ||
"acceptance-criteria", | ||
"translate-to-singlish", | ||
"eli5", | ||
"business-name", | ||
"fill-the-gaps", | ||
"youtube-video-title", | ||
"youtube-video-description", | ||
"youtube-video-ideas", | ||
"youtube-video-script-outline", | ||
"tiktok-video-caption", | ||
"tiktok-hashtags-generator", | ||
"quora-answers", | ||
"about-me-generator", | ||
"google-ads-headlines", | ||
"google-ads-descriptions", | ||
"facebook-ads-headlines", | ||
"facebook-ads-primary-text", | ||
"seo-title-meta-descriptions", | ||
"cover-letter-generator", | ||
"twitter-post", | ||
"twitter-thread", | ||
"twitter-bio-generator", | ||
"song-idea-generator", | ||
"song-lyrics-generator", | ||
"album-title-generator", | ||
"product-descriptions", | ||
"ai-story-generator", | ||
"poem-title-generator", | ||
"poem-generator", | ||
"quote-generator", | ||
"ai-joke-generator", | ||
"greetings-generator", | ||
"tinder-bio", | ||
"pick-up-line-generator", | ||
"instagram-bio", | ||
"podcast-episode-title-generator", | ||
"podcast-episode-description-generator", | ||
"podcast-show-notes-generator", | ||
"real-estate-listing-generator", | ||
]; | ||
|
||
export default { | ||
TEMPLATES, | ||
}; |
Oops, something went wrong.