-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[Components] autobound #13457 #16012
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
Merged
+172
−6
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
16e9e53
Added actions
lcaresia 2f6d211
Update components/autobound/actions/write-personalized-content/write-…
michelle0927 8be9157
Update components/autobound/common/constants.mjs
michelle0927 235b6d2
Update components/autobound/common/constants.mjs
michelle0927 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
64 changes: 64 additions & 0 deletions
64
components/autobound/actions/write-personalized-content/write-personalized-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 "../../autobound.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "autobound-write-personalized-content", | ||
| name: "Write Personalized Content", | ||
| description: "Write personalized content using Autobound. [See the documentation](https://autobound-api.readme.io/docs/generate-personalized-content-copy)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| contentType: { | ||
| propDefinition: [ | ||
| app, | ||
| "contentType", | ||
| ], | ||
| }, | ||
| contactEmail: { | ||
| propDefinition: [ | ||
| app, | ||
| "contactEmail", | ||
| ], | ||
| }, | ||
| userEmail: { | ||
| propDefinition: [ | ||
| app, | ||
| "userEmail", | ||
| ], | ||
| }, | ||
| writingStyle: { | ||
| propDefinition: [ | ||
| app, | ||
| "writingStyle", | ||
| ], | ||
| }, | ||
| additionalContext: { | ||
| propDefinition: [ | ||
| app, | ||
| "additionalContext", | ||
| ], | ||
| }, | ||
| wordCount: { | ||
| propDefinition: [ | ||
| app, | ||
| "wordCount", | ||
| ], | ||
| }, | ||
| }, | ||
|
|
||
| async run({ $ }) { | ||
| const response = await this.app.writePersonalizedContent({ | ||
| $, | ||
| data: { | ||
| contactEmail: this.contactEmail, | ||
| userEmail: this.userEmail, | ||
| contentType: this.contentType, | ||
| writingStyle: this.writingStyle, | ||
| additionalContext: this.additionalContext, | ||
| wordCount: this.wordCount, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully generated personalized content"); | ||
| return response; | ||
| }, | ||
| }; |
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,70 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
| import constants from "./common/constants.mjs"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "autobound", | ||
| propDefinitions: {}, | ||
| propDefinitions: { | ||
| contactEmail: { | ||
| type: "string", | ||
| label: "Contact Email", | ||
| description: "The email address of the contact the user is reaching out to", | ||
| }, | ||
| userEmail: { | ||
| type: "string", | ||
| label: "User Email", | ||
| description: "The email address of the user the content is written on behalf of", | ||
| }, | ||
| contentType: { | ||
| type: "string", | ||
| label: "Content Type", | ||
| description: "Type of content to generate", | ||
| options: constants.CONTENT_TYPES, | ||
| }, | ||
| writingStyle: { | ||
| type: "string", | ||
| label: "Writing Style", | ||
| description: "Writing style for content generation", | ||
| options: constants.WRITING_STYLES, | ||
| }, | ||
| additionalContext: { | ||
| type: "string", | ||
| label: "Additional Context", | ||
| description: "Extra information for customizing generated content", | ||
| }, | ||
| wordCount: { | ||
| type: "integer", | ||
| label: "Word Count", | ||
| description: "Approximate word count for output", | ||
| }, | ||
| }, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _baseUrl() { | ||
| return "https://api.autobound.ai/api/external"; | ||
| }, | ||
| async _makeRequest(opts = {}) { | ||
| const { | ||
| $ = this, | ||
| path, | ||
| headers, | ||
| ...otherOpts | ||
| } = opts; | ||
| return axios($, { | ||
| ...otherOpts, | ||
| url: this._baseUrl() + path, | ||
| headers: { | ||
| "X-API-KEY": `${this.$auth.api_key}`, | ||
| "Content-Type": "application/json", | ||
| ...headers, | ||
| }, | ||
| }); | ||
| }, | ||
| async writePersonalizedContent(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/generate-content/v3.5", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| }; |
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,36 @@ | ||
| export default { | ||
| CONTENT_TYPES: [ | ||
| "email", | ||
| "opener", | ||
| "sms", | ||
| "connectionRequest", | ||
| "callScript", | ||
| "sequence", | ||
| ], | ||
| WRITING_STYLES: [ | ||
| { | ||
| label: "For a conversational and insightful approach", | ||
| value: "challenger_sale", | ||
| }, | ||
| { | ||
| label: "To craft content with a creative, poetic twist", | ||
| value: "clever_poet", | ||
| }, | ||
| { | ||
| label: "For concise, executive- level pitches", | ||
| value: "cxo_pitch", | ||
| }, | ||
| { | ||
| label: "For content backed by data, statistics, and clear ROI", | ||
| value: "data_driven", | ||
| }, | ||
| { | ||
| label: "For short, personalized content that follows Basho protocol", | ||
| value: "basho", | ||
| }, | ||
| { | ||
| label: "Demonstrates a sense of urgency tied to the prospect's pain points", | ||
| value: "why_you_why_now", | ||
| }, | ||
| ], | ||
| }; | ||
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
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.