-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - High Level & Elevenlabs #16187
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis pull request makes several version updates and introduces new modules across two integrations: ElevenLabs and HighLevel OAuth. For ElevenLabs, existing action modules have their version numbers incremented while new modules for creating agents and making outbound calls are added. In the HighLevel OAuth integration, new modules for adding contacts to campaigns and handling new contact and form submission events have been introduced, along with refactors in common functionalities, updates to method signatures, and property enhancements. Package dependency versions have also been updated accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as External Trigger
participant EApp as ElevenLabs App
participant API as ElevenLabs API
participant Twilio as Twilio Service
Caller->>EApp: Invoke outbound call action
EApp->>API: Call makeOutboundCall with agent & call info
API->>Twilio: Initiate outbound call
Twilio-->>API: Return call response
API-->>EApp: Pass response
EApp-->>Caller: Return summary message
sequenceDiagram
participant HL as HighLevel OAuth App
participant DB as Database (Last Date)
participant API as HighLevel API
participant Emitter as Event Emitter
HL->>DB: Retrieve last processed date
HL->>API: Query new contacts/form submissions
API-->>HL: Return fetched data
HL->>Emitter: Emit event with generated metadata
HL->>DB: Update last processed date
Assessment against linked issues
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/elevenlabs/actions/add-voice/add-voice.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/elevenlabs/elevenlabs.app.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (7)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (9)
components/elevenlabs/actions/add-voice/add-voice.mjs (1)
62-62: Typo in Exported SummaryThere's a typo in the summary message at line 62: "Sucessfully" should be corrected to "Successfully" to maintain professionalism and clarity in user-facing messages.
Consider applying the following diff:- $.export("$summary", `Sucessfully added voice (ID: ${response.voice_id})`); + $.export("$summary", `Successfully added voice (ID: ${response.voice_id})`);components/elevenlabs/actions/make-outbound-call/make-outbound-call.mjs (1)
38-41: Consider enhancing error handlingThe success case is handled, but there's no specific error handling or user feedback if the call fails. Consider adding an else case with a descriptive error message.
if (response?.success) { $.export("$summary", `Successfully made outbound call to ${this.toNumber}`); + } else { + $.export("$summary", `Failed to make outbound call to ${this.toNumber}${response?.error ? `: ${response.error}` : ''}`); }components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjs (1)
31-33: Fix typo in success message.There's a typo in the success message: "conatct" should be "contact".
- $.export("$summary", `Successfully added conatct to campaign with ID: ${this.campaignId}`); + $.export("$summary", `Successfully added contact to campaign with ID: ${this.campaignId}`);components/elevenlabs/actions/create-agent/create-agent.mjs (1)
99-132: Consider adding error handling.The implementation correctly uses the ElevenLabs API to create an agent and exports a summary on success. However, you might want to add explicit error handling for cases when the API call fails or returns unexpected responses.
async run({ $ }) { - const response = await this.elevenlabs.createAgent({ - $, - data: { - conversation_config: { - conversation: { - max_duration_seconds: this.maxDurationSeconds, - }, - turn: { - turn_timeout: this.turnTimeout && +this.turnTimeout, - }, - agent: { - first_message: this.firstMessage, - language: this.language, - prompt: { - prompt: this.prompt, - llm: this.llm, - temperature: this.temperature && +this.temperature, - max_tokens: this.maxTokens, - }, - }, - tts: { - voice_id: this.voiceId, - model_id: this.modelId, - }, - }, - name: this.name, - }, - }); + try { + const response = await this.elevenlabs.createAgent({ + $, + data: { + conversation_config: { + conversation: { + max_duration_seconds: this.maxDurationSeconds, + }, + turn: { + turn_timeout: this.turnTimeout && +this.turnTimeout, + }, + agent: { + first_message: this.firstMessage, + language: this.language, + prompt: { + prompt: this.prompt, + llm: this.llm, + temperature: this.temperature && +this.temperature, + max_tokens: this.maxTokens, + }, + }, + tts: { + voice_id: this.voiceId, + model_id: this.ttsModelId, + }, + }, + name: this.name, + }, + }); + + if (!response) { + throw new Error("No response received from ElevenLabs API"); + } + + if (response?.agent_id) { + $.export("$summary", `Successfully created agent with ID: ${response.agent_id}`); + } else { + $.export("$summary", "Agent created, but no agent ID was returned"); + } + return response; + } catch (error) { + throw new Error(`Failed to create agent: ${error.message}`); + } - if (response?.agent_id) { - $.export("$summary", `Successfully created agent with ID: ${response.agent_id}`); - } - return response;components/highlevel_oauth/sources/new-form-submission/new-form-submission.mjs (1)
43-45: Consider using full ISO date string for maxDate.Slicing the date string to 10 characters (YYYY-MM-DD) removes time information that might be important for precise chronological ordering.
- maxDate = submission.createdAt.slice(0, 10); + maxDate = submission.createdAt;components/elevenlabs/elevenlabs.app.mjs (4)
183-188: Path inconsistency in listPhoneNumbers method.The path in the
listPhoneNumbersmethod starts with a forward slash, while other API paths in this file don't include the leading slash. Consider removing it for consistency.- listPhoneNumbers(args = {}) { - return this._makeRequest({ - path: "/convai/phone-numbers/", - ...args, - }); - }, + listPhoneNumbers(args = {}) { + return this._makeRequest({ + path: "convai/phone-numbers/", + ...args, + }); + },
189-194: Path inconsistency in listAgents method.Similar to the previous comment, the path in the
listAgentsmethod starts with a forward slash, which differs from the pattern used in other methods in this file.- listAgents(args = {}) { - return this._makeRequest({ - path: "/convai/agents", - ...args, - }); - }, + listAgents(args = {}) { + return this._makeRequest({ + path: "convai/agents", + ...args, + }); + },
195-201: Path inconsistency in createAgent method.The path in the
createAgentmethod starts with a forward slash, which is inconsistent with the pattern used in most other methods in this file.- createAgent(args = {}) { - return this._makeRequest({ - method: "POST", - path: "/convai/agents/create", - ...args, - }); - }, + createAgent(args = {}) { + return this._makeRequest({ + method: "POST", + path: "convai/agents/create", + ...args, + }); + },
202-208: Path inconsistency in makeOutboundCall method.The path in the
makeOutboundCallmethod starts with a forward slash, which is inconsistent with the pattern used in most other methods in this file.- makeOutboundCall(args = {}) { - return this._makeRequest({ - method: "POST", - path: "/convai/twilio/outbound_call", - ...args, - }); - }, + makeOutboundCall(args = {}) { + return this._makeRequest({ + method: "POST", + path: "convai/twilio/outbound_call", + ...args, + }); + },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (23)
components/elevenlabs/actions/add-voice/add-voice.mjs(1 hunks)components/elevenlabs/actions/create-agent/create-agent.mjs(1 hunks)components/elevenlabs/actions/download-history-items/download-history-items.mjs(1 hunks)components/elevenlabs/actions/get-audio-from-history-item/get-audio-from-history-item.mjs(1 hunks)components/elevenlabs/actions/list-models/list-models.mjs(1 hunks)components/elevenlabs/actions/make-outbound-call/make-outbound-call.mjs(1 hunks)components/elevenlabs/actions/text-to-speech/text-to-speech.mjs(1 hunks)components/elevenlabs/elevenlabs.app.mjs(5 hunks)components/elevenlabs/package.json(2 hunks)components/elevenlabs/sources/new-history-item/new-history-item.mjs(1 hunks)components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjs(1 hunks)components/highlevel_oauth/actions/common/common-contacts.mjs(2 hunks)components/highlevel_oauth/actions/create-contact/create-contact.mjs(2 hunks)components/highlevel_oauth/actions/update-contact/update-contact.mjs(2 hunks)components/highlevel_oauth/actions/upsert-contact/upsert-contact.mjs(2 hunks)components/highlevel_oauth/common/base.mjs(1 hunks)components/highlevel_oauth/highlevel_oauth.app.mjs(4 hunks)components/highlevel_oauth/package.json(2 hunks)components/highlevel_oauth/sources/common/base-polling.mjs(1 hunks)components/highlevel_oauth/sources/new-contact-created/new-contact-created.mjs(1 hunks)components/highlevel_oauth/sources/new-contact-created/test-event.mjs(1 hunks)components/highlevel_oauth/sources/new-form-submission/new-form-submission.mjs(1 hunks)components/highlevel_oauth/sources/new-form-submission/test-event.mjs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: pnpm publish
🔇 Additional comments (41)
components/elevenlabs/sources/new-history-item/new-history-item.mjs (1)
7-7: Version Update ConfirmationThe version property has been updated from
"0.0.2"to"0.0.3", which aligns with the coordinated versioning changes across the ElevenLabs modules. Make sure that any downstream dependencies referencing this module now use the updated version.components/elevenlabs/actions/add-voice/add-voice.mjs (1)
8-8: Version Update ConsistencyThe version change from
"0.0.1"to"0.0.2"is clear and consistent with the coordinated updates in other ElevenLabs components.components/elevenlabs/actions/get-audio-from-history-item/get-audio-from-history-item.mjs (1)
9-9: Version Update ConfirmationThe version number has been updated from
"0.0.2"to"0.0.3", maintaining consistency within the ElevenLabs action modules. No further functional changes were necessary in this update.components/elevenlabs/actions/download-history-items/download-history-items.mjs (1)
9-9: Consistent Version IncrementThe update of the version property from
"0.0.2"to"0.0.3"is consistent with similar changes in the repository. This helps ensure uniform versioning across modules.components/elevenlabs/actions/list-models/list-models.mjs (1)
6-6: Version Alignment ConfirmedThe version for this module has been updated to
"0.0.3", which is in line with the recent updates across the ElevenLabs components. This maintains clarity and consistency regarding module iterations.components/elevenlabs/actions/text-to-speech/text-to-speech.mjs (1)
9-9: Version bump looks goodThe version increment from "0.0.2" to "0.0.3" is appropriate and consistent with the versioning updates across other ElevenLabs components in this PR.
components/highlevel_oauth/package.json (2)
3-3: Version increment is appropriateThe version bump from "0.1.0" to "0.2.0" correctly reflects the addition of new HighLevel components being introduced in this PR.
16-16: Platform dependency updated to latest versionThe update to
@pipedream/platformfrom "^1.6.2" to "^3.0.3" is significant. This ensures compatibility with the latest platform features and matches the same dependency version used in the ElevenLabs package.components/highlevel_oauth/common/base.mjs (1)
1-19: Good implementation of a base module for code reuseThis new base module effectively centralizes common functionality for HighLevel OAuth components, following best practices for code organization in Pipedream. The implementation:
- Properly handles the authentication validation
- Provides a clear error message when users authenticate incorrectly (as agency instead of location)
- Sets up reloadProps for dynamic property refreshing
This will help standardize behavior across HighLevel components while reducing code duplication.
components/elevenlabs/package.json (2)
3-3: Version increment is appropriateThe version bump from "0.2.0" to "0.3.0" correctly reflects the addition of new ElevenLabs components (Create Agent and Make Outbound Call) being introduced in this PR.
16-16: Platform dependency updated to latest versionThe update to
@pipedream/platformfrom "^1.6.0" to "^3.0.3" is significant. This ensures compatibility with the latest platform features and maintains consistency with other components in this PR.components/elevenlabs/actions/make-outbound-call/make-outbound-call.mjs (1)
1-43: Well-structured new component for ElevenLabs outbound calling!The implementation is clean and follows the expected patterns for Pipedream components. The code properly references the ElevenLabs app and makes an outbound call with the required parameters.
components/highlevel_oauth/actions/upsert-contact/upsert-contact.mjs (2)
1-1: Appropriate module refactoring to common-contactsThe import path change reflects better modularization by moving contact-specific functionality to a dedicated module.
14-14: Version bump correctly reflects structural changesThe version increment from 0.0.1 to 0.0.2 properly indicates the module structure changes without functional modifications.
components/highlevel_oauth/actions/update-contact/update-contact.mjs (2)
1-1: Consistent refactoring to common-contacts moduleThe import path change maintains consistency with other contact components and improves code organization.
14-14: Appropriate version incrementThe version update from 0.0.1 to 0.0.2 correctly reflects the import path changes without functional modifications.
components/highlevel_oauth/actions/create-contact/create-contact.mjs (2)
1-1: Consistent module refactoring across contact componentsThe import path update maintains consistency with other HighLevel contact-related components and improves code organization.
14-14: Appropriate version incrementThe version update from 0.0.1 to 0.0.2 properly reflects the structural changes without functional modifications.
components/highlevel_oauth/sources/new-form-submission/test-event.mjs (1)
1-59: Well-structured test event for form submissions.The test event structure is comprehensive and includes all essential data needed for form submission processing, including identifiers, form data, user information, and metadata. The structure appears well-organized and properly formatted.
A couple of observations:
- Future-dated timestamp (2025-04-04) is appropriate for test data
- The signature hash is properly included for verification purposes
- All necessary fields for form submission processing are present
components/highlevel_oauth/sources/common/base-polling.mjs (1)
1-25: Good implementation of polling base module.The module correctly extends the common base functionality and implements the necessary components for a polling source:
- Proper import of the default polling interval from the platform
- Well-structured database access methods for tracking the last poll date
- Timer configuration with appropriate default settings
This implementation follows best practices for creating reusable polling source components.
components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjs (1)
1-36: Well-structured action component with proper documentation link.The action component follows the proper structure for Pipedream actions:
- Extends common base functionality
- Properly defines required properties (contactId and campaignId)
- Includes appropriate documentation reference
- Handles the API call and response correctly
The implementation is clean and straightforward.
components/highlevel_oauth/sources/new-contact-created/test-event.mjs (1)
1-35: Comprehensive test event for new contact creation.The test contact data structure includes all relevant fields for contact processing:
- Personal and company information
- Contact details (phone number is properly formatted)
- Status fields and metadata
- Appropriate tags for testing tag functionality
Note that the email field is set to null, which is valid but might be worth considering if you want to test email-related functionality.
components/elevenlabs/actions/create-agent/create-agent.mjs (2)
1-8: LGTM! The module imports and metadata look good.The import statement properly references the ElevenLabs app module, and the action metadata (key, name, description, version, and type) is clear and well-documented with a link to the API documentation.
9-98: Props configuration is comprehensive and well-structured.The properties configuration provides all the necessary parameters for the ElevenLabs agent creation with appropriate types, labels, descriptions, and optional flags. The LLM options are extensive and up-to-date.
components/highlevel_oauth/actions/common/common-contacts.mjs (4)
1-3: Good refactoring of imports.The change to import the common module from base.mjs improves code organization and reuse.
4-8: Well-structured component composition.Using the spread operator to include properties from the common module promotes code reuse and maintainability.
34-36: Good method reuse from common module.Properly extending common methods while keeping the specialized functionality in this module.
36-48:✅ Verification successful
Ensure app property availability after refactoring.
The
getDatamethod referencesappin both the destructuring and the return value. Make sure this property is properly available after the refactoring from common.
🏁 Script executed:
#!/bin/bash # Check the common/base.mjs file to verify if it exports an app property cat components/highlevel_oauth/common/base.mjs | grep -A 5 "props" | grep "app"Length of output: 102
App property availability verified
The verification confirms that the
appproperty is still available in the common module. Specifically, the output fromcomponents/highlevel_oauth/common/base.mjsshows theappproperty being spread as expected. No further changes are necessary regarding the availability ofappafter the refactoring.components/highlevel_oauth/sources/new-contact-created/new-contact-created.mjs (3)
1-11: LGTM! Source configuration is well-defined.The imports, metadata, and deduplication strategy are appropriate for a contact creation event source.
12-21: Metadata generation looks good.The
generateMetamethod properly extracts the necessary information from contact objects to create appropriate event metadata.
31-40:⚠️ Potential issueFix potential infinite loop in pagination logic.
If
meta?.totalis undefined, thetotalvariable would be undefined, and the conditionresults.length < totalwould always be true, potentially causing an infinite loop.do { const { contacts, meta, } = await this.app.searchContacts({ params, }); results.push(...contacts); params.startAfter = meta?.startAfter; total = meta?.total; -} while (results.length < total); +} while (total !== undefined && results.length < total && contacts.length > 0);Likely an incorrect or invalid review comment.
components/highlevel_oauth/sources/new-form-submission/new-form-submission.mjs (2)
1-11: LGTM! Source configuration is well-defined.The imports, metadata, and deduplication strategy are appropriate for a form submission event source.
12-21: Metadata generation looks good.The
generateMetamethod properly extracts the necessary information from submission objects to create appropriate event metadata.components/elevenlabs/elevenlabs.app.mjs (3)
9-9: Good consistency improvement in property labels.Changing the labels to use "ID" consistently across all properties improves readability and maintains a standard format throughout the codebase.
Also applies to: 37-37, 52-52
65-78: The phoneNumberId property is well-defined.This property is properly structured with appropriate type, label, and description. The options method correctly uses the new
listPhoneNumbersmethod and handles possible null responses with the|| []fallback, which is a good defensive programming practice.
79-105: Well-implemented agentId property with pagination support.The agentId property is properly defined with appropriate metadata. The options method correctly implements pagination using a cursor-based approach, with a specified page_size. The null-checking with
|| []is a good defensive measure.components/highlevel_oauth/highlevel_oauth.app.mjs (5)
34-51: Well-implemented campaignId property with options fetching.The campaignId property is properly defined with appropriate type, label, and description. The options method correctly retrieves and formats campaigns from the API, including a defensive check with
|| []to handle potential null values.
60-60: Good refactoring of method signatures.Removing the
asynckeyword from methods that don't directly useawaitis an appropriate optimization. The signature changes, including adding default empty object parameters and better parameter destructuring inupdateContact, improve code clarity and consistency.Also applies to: 75-75, 82-84, 91-91, 98-98
104-109: The listCampaigns method supports the new campaignId property.This method aligns with the PR objective to add "Add Contact to Campaign" functionality by providing the necessary API integration to retrieve available campaigns.
110-115: The listFormSubmissions method supports the Form Submission functionality.This method supports the PR objective to add "New Form Submission" functionality by providing the necessary API integration.
116-124: The addContactToCampaign method directly implements a PR objective.This method directly implements the "Add Contact to Campaign" functionality mentioned in the PR objectives. The implementation is clean and follows the established patterns in the file.
Resolves #16094
High Level
Eleven Labs
Summary by CodeRabbit
New Features
Chores