-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] stealthgpt #14230
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
Open
jcortes
wants to merge
1
commit into
PipedreamHQ:master
Choose a base branch
from
jcortes:stealthgpt-new-components
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Components] stealthgpt #14230
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
components/stealthgpt/actions/generate-content/generate-content.mjs
This file contains hidden or 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,78 @@ | ||
| import app from "../../stealthgpt.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "stealthgpt-generate-content", | ||
| name: "Generate or Rephrase Content", | ||
| description: "Generates or rephrases content based on the provided prompt. [See the documentation](https://docs.stealthgpt.ai/api-requests-and-parameters)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| prompt: { | ||
| propDefinition: [ | ||
| app, | ||
| "prompt", | ||
| ], | ||
| }, | ||
| rephrase: { | ||
| type: "boolean", | ||
| label: "Rephrase", | ||
| description: "A boolean value (`true` or `false`) that indicates whether the API should rephrase the content or generate new content based on the prompt. Set to `true` for rephrasing and `false` for content generation.", | ||
| }, | ||
| tone: { | ||
| type: "string", | ||
| label: "Tone", | ||
| description: "Specifies the desired tone for the response. For example, `Casual`, `Academic`, etc.", | ||
| optional: true, | ||
| }, | ||
| mode: { | ||
| type: "string", | ||
| label: "Mode", | ||
| description: "Indicates the detail level of the response: `High`, `Medium`, or `Low`.", | ||
| optional: true, | ||
| options: [ | ||
| "High", | ||
| "Medium", | ||
| "Low", | ||
| ], | ||
| }, | ||
| business: { | ||
| type: "boolean", | ||
| label: "Business", | ||
| description: "A boolean flag to indicate if the request is related to a business context. Setting this to `true` uses a model 10x more powerful than the standard StealthGPT engine, making the content far more undetectable and coherent but also consuming more tokens.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| methods: { | ||
| generateContent(args = {}) { | ||
| return this.app.post({ | ||
| path: "/stealthify", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| generateContent, | ||
| prompt, | ||
| rephrase, | ||
| tone, | ||
| mode, | ||
| business, | ||
| } = this; | ||
|
|
||
| const response = await generateContent({ | ||
| $, | ||
| data: { | ||
| prompt, | ||
| rephrase, | ||
| tone, | ||
| mode, | ||
| business, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully generated content."); | ||
| return response; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
64 changes: 64 additions & 0 deletions
64
...onents/stealthgpt/actions/generate-undetectable-content/generate-undetectable-content.mjs
This file contains hidden or 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,64 @@ | ||
| import app from "../../stealthgpt.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "stealthgpt-generate-undetectable-content", | ||
| name: "Generate Undetectable Content", | ||
| description: "Generates full, undetectable blog articles with relevant images in markdown.", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| prompt: { | ||
| description: "The input text or question for which you want the StealthGPT to generate content.", | ||
| propDefinition: [ | ||
| app, | ||
| "prompt", | ||
| ], | ||
| }, | ||
| withImages: { | ||
| type: "boolean", | ||
| label: "With Images", | ||
| description: "A boolean value indicating whether to include images in the generated content. Default is `true`.", | ||
| optional: true, | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| size: { | ||
| type: "string", | ||
| label: "Size", | ||
| description: "The desired length of the generated article. Can be `small`, `medium`, or `long`. Default is `small`.", | ||
| optional: true, | ||
| options: [ | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "small", | ||
| "medium", | ||
| "long", | ||
| ], | ||
| }, | ||
| }, | ||
| methods: { | ||
| generateUndetectableContent(args = {}) { | ||
| return this.app.post({ | ||
| path: "/stealthify/articles", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| generateUndetectableContent, | ||
| prompt, | ||
| size, | ||
| withImages, | ||
| } = this; | ||
|
|
||
| const response = await generateUndetectableContent({ | ||
| $, | ||
| data: { | ||
| prompt, | ||
| size, | ||
| withImages, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully generated undetectable content."); | ||
| return response; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "@pipedream/stealthgpt", | ||
| "version": "0.0.1", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream StealthGPT Components", | ||
| "main": "stealthgpt.app.mjs", | ||
| "keywords": [ | ||
|
|
@@ -11,5 +11,8 @@ | |
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "3.0.3" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,40 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "stealthgpt", | ||
| propDefinitions: {}, | ||
| propDefinitions: { | ||
| prompt: { | ||
| type: "string", | ||
| label: "Prompt", | ||
| description: "The prompt to be used as the basis for content generation, or the content to be rephrased.", | ||
| }, | ||
| }, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| getUrl(path) { | ||
| return `https://stealthgpt.ai/api${path}`; | ||
| }, | ||
| getHeaders(headers) { | ||
| return { | ||
| ...headers, | ||
| "Content-Type": "application/json", | ||
| "api-token": this.$auth.api_key, | ||
| }; | ||
| }, | ||
| _makeRequest({ | ||
| $ = this, path, headers, ...args | ||
| } = {}) { | ||
| return axios($, { | ||
| ...args, | ||
| url: this.getUrl(path), | ||
| headers: this.getHeaders(headers), | ||
| }); | ||
| }, | ||
| post(args = {}) { | ||
| return this._makeRequest({ | ||
| method: "POST", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| }; | ||
| }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.