AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(blocks): add base for smartlead, apollo, and zerobounce blocks (#9387)
Nicholas Tindlef722c70c5071
diff --git a/autogpt_platform/backend/.env.example b/autogpt_platform/backend/.env.exampleindex 11383b9589..8b28244f42 100644--- a/autogpt_platform/backend/.env.example+++ b/autogpt_platform/backend/.env.example@@ -165,6 +165,15 @@ MEM0_API_KEY=# NvidiaNVIDIA_API_KEY=+# Apollo+APOLLO_API_KEY=++# SmartLead+SMARTLEAD_API_KEY=++# ZeroBounce+ZEROBOUNCE_API_KEY=+# Logging ConfigurationLOG_LEVEL=INFOENABLE_CLOUD_LOGGING=falsediff --git a/autogpt_platform/backend/backend/blocks/apollo/_api.py b/autogpt_platform/backend/backend/blocks/apollo/_api.pynew file mode 100644index 0000000000..157235ff0f--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/apollo/_api.py@@ -0,0 +1,108 @@+import logging+from typing import List++from backend.blocks.apollo._auth import ApolloCredentials+from backend.blocks.apollo.models import (+ Contact,+ Organization,+ SearchOrganizationsRequest,+ SearchOrganizationsResponse,+ SearchPeopleRequest,+ SearchPeopleResponse,+)+from backend.util.request import Requests++logger = logging.getLogger(name=__name__)+++class ApolloClient:+ """Client for the Apollo API"""++ API_URL = "https://api.apollo.io/api/v1"++ def __init__(self, credentials: ApolloCredentials):+ self.credentials = credentials+ self.requests = Requests()++ def _get_headers(self) -> dict[str, str]:+ return {"x-api-key": self.credentials.api_key.get_secret_value()}++ def search_people(self, query: SearchPeopleRequest) -> List[Contact]:+ """Search for people in Apollo"""+ response = self.requests.get(+ f"{self.API_URL}/mixed_people/search",+ headers=self._get_headers(),+ params=query.model_dump(exclude={"credentials", "max_results"}),+ )+ parsed_response = SearchPeopleResponse(**response.json())+ if parsed_response.pagination.total_entries == 0:+ return []++ people = parsed_response.people++ # handle pagination+ if (+ query.max_results is not None+ and query.max_results < parsed_response.pagination.total_entries+ and len(people) < query.max_results+ ):+ while (+ len(people) < query.max_results+ and query.page < parsed_response.pagination.total_pages+ and len(parsed_response.people) > 0+ ):+ query.page += 1+ response = self.requests.get(+ f"{self.API_URL}/mixed_people/search",+ headers=self._get_headers(),+ params=query.model_dump(exclude={"credentials", "max_results"}),+ )+ parsed_response = SearchPeopleResponse(**response.json())+ people.extend(parsed_response.people[: query.max_results - len(people)])++ logger.info(f"Found {len(people)} people")+ return people[: query.max_results] if query.max_results else people++ def search_organizations(+ self, query: SearchOrganizationsRequest+ ) -> List[Organization]:+ """Search for organizations in Apollo"""+ response = self.requests.get(+ f"{self.API_URL}/mixed_companies/search",+ headers=self._get_headers(),+ params=query.model_dump(exclude={"credentials", "max_results"}),+ )+ parsed_response = SearchOrganizationsResponse(**response.json())+ if parsed_response.pagination.total_entries == 0:+ return []++ organizations = parsed_response.organizations++ # handle pagination+ if (+ query.max_results is not None+ and query.max_results < parsed_response.pagination.total_entries+ and len(organizations) < query.max_results+ ):+ while (+ len(organizations) < query.max_results+ and query.page < parsed_response.pagination.total_pages+ and len(parsed_response.organizations) > 0+ ):+ query.page += 1+ response = self.requests.get(+ f"{self.API_URL}/mixed_companies/search",+ headers=self._get_headers(),+ params=query.model_dump(exclude={"credentials", "max_results"}),+ )+ parsed_response = SearchOrganizationsResponse(**response.json())+ organizations.extend(+ parsed_response.organizations[+ : query.max_results - len(organizations)+ ]+ )++ logger.info(f"Found {len(organizations)} organizations")+ return (+ organizations[: query.max_results] if query.max_results else organizations+ )diff --git a/autogpt_platform/backend/backend/blocks/apollo/_auth.py b/autogpt_platform/backend/backend/blocks/apollo/_auth.pynew file mode 100644index 0000000000..c813c72d99--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/apollo/_auth.py@@ -0,0 +1,35 @@+from typing import Literal++from pydantic import SecretStr++from backend.data.model import APIKeyCredentials, CredentialsField, CredentialsMetaInput+from backend.integrations.providers import ProviderName++ApolloCredentials = APIKeyCredentials+ApolloCredentialsInput = CredentialsMetaInput[+ Literal[ProviderName.APOLLO],+ Literal["api_key"],+]++TEST_CREDENTIALS = APIKeyCredentials(+ id="01234567-89ab-cdef-0123-456789abcdef",+ provider="apollo",+ api_key=SecretStr("mock-apollo-api-key"),+ title="Mock Apollo API key",+ expires_at=None,+)+TEST_CREDENTIALS_INPUT = {+ "provider": TEST_CREDENTIALS.provider,+ "id": TEST_CREDENTIALS.id,+ "type": TEST_CREDENTIALS.type,+ "title": TEST_CREDENTIALS.title,+}+++def ApolloCredentialsField() -> ApolloCredentialsInput:+ """+ Creates a Apollo credentials input on a block.+ """+ return CredentialsField(+ description="The Apollo integration can be used with an API Key.",+ )diff --git a/autogpt_platform/backend/backend/blocks/apollo/models.py b/autogpt_platform/backend/backend/blocks/apollo/models.pynew file mode 100644index 0000000000..b9fa621ddc--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/apollo/models.py@@ -0,0 +1,543 @@+from enum import Enum+from typing import Any, Optional++from pydantic import BaseModel++from backend.data.model import SchemaField+++class PrimaryPhone(BaseModel):+ """A primary phone in Apollo"""++ number: str+ source: str+ sanitized_number: str+++class SenorityLevels(str, Enum):+ """Seniority levels in Apollo"""++ OWNER = "owner"+ FOUNDER = "founder"+ C_SUITE = "c_suite"+ PARTNER = "partner"+ VP = "vp"+ HEAD = "head"+ DIRECTOR = "director"+ MANAGER = "manager"+ SENIOR = "senior"+ ENTRY = "entry"+ INTERN = "intern"+++class ContactEmailStatuses(str, Enum):+ """Contact email statuses in Apollo"""++ VERIFIED = "verified"+ UNVERIFIED = "unverified"+ LIKELY_TO_ENGAGE = "likely_to_engage"+ UNAVAILABLE = "unavailable"+++class RuleConfigStatus(BaseModel):+ """A rule config status in Apollo"""++ _id: str+ created_at: str+ rule_action_config_id: str+ rule_config_id: str+ status_cd: str+ updated_at: str+ id: str+ key: str+++class ContactCampaignStatus(BaseModel):+ """A contact campaign status in Apollo"""++ id: str+ emailer_campaign_id: str+ send_email_from_user_id: str+ inactive_reason: str+ status: str+ added_at: str+ added_by_user_id: str+ finished_at: str+ paused_at: str+ auto_unpause_at: str+ send_email_from_email_address: str+ send_email_from_email_account_id: str+ manually_set_unpause: str+ failure_reason: str+ current_step_id: str+ in_response_to_emailer_message_id: str+ cc_emails: str+ bcc_emails: str+ to_emails: str+++class Account(BaseModel):+ """An account in Apollo"""++ id: str+ name: str+ website_url: str+ blog_url: str+ angellist_url: str+ linkedin_url: str+ twitter_url: str+ facebook_url: str+ primary_phone: PrimaryPhone+ languages: list[str]+ alexa_ranking: int+ phone: str+ linkedin_uid: str+ founded_year: int+ publicly_traded_symbol: str+ publicly_traded_exchange: str+ logo_url: str+ chrunchbase_url: str+ primary_domain: str+ domain: str+ team_id: str+ organization_id: str+ account_stage_id: str+ source: str+ original_source: str+ creator_id: str+ owner_id: str+ created_at: str+ phone_status: str+ hubspot_id: str+ salesforce_id: str+ crm_owner_id: str+ parent_account_id: str+ sanitized_phone: str+ # no listed type on the API docs+ account_playbook_statues: list[Any]+ account_rule_config_statuses: list[RuleConfigStatus]+ existence_level: str+ label_ids: list[str]+ typed_custom_fields: Any+ custom_field_errors: Any+ modality: str+ source_display_name: str+ salesforce_record_id: str+ crm_record_url: str+++class ContactEmail(BaseModel):+ """A contact email in Apollo"""++ email: str = ""+ email_md5: str = ""+ email_sha256: str = ""+ email_status: str = ""+ email_source: str = ""+ extrapolated_email_confidence: str = ""+ position: int = 0+ email_from_customer: str = ""+ free_domain: bool = True+++class EmploymentHistory(BaseModel):+ """An employment history in Apollo"""++ class Config:+ extra = "allow"+ arbitrary_types_allowed = True+ from_attributes = True+ populate_by_name = True++ _id: Optional[str] = None+ created_at: Optional[str] = None+ current: Optional[bool] = None+ degree: Optional[str] = None+ description: Optional[str] = None+ emails: Optional[str] = None+ end_date: Optional[str] = None+ grade_level: Optional[str] = None+ kind: Optional[str] = None+ major: Optional[str] = None+ organization_id: Optional[str] = None+ organization_name: Optional[str] = None+ raw_address: Optional[str] = None+ start_date: Optional[str] = None+ title: Optional[str] = None+ updated_at: Optional[str] = None+ id: Optional[str] = None+ key: Optional[str] = None+++class Breadcrumb(BaseModel):+ """A breadcrumb in Apollo"""++ label: Optional[str] = "N/A"+ signal_field_name: Optional[str] = "N/A"+ value: str | list | None = "N/A"+ display_name: Optional[str] = "N/A"+++class TypedCustomField(BaseModel):+ """A typed custom field in Apollo"""++ id: Optional[str] = "N/A"+ value: Optional[str] = "N/A"+++class Pagination(BaseModel):+ """Pagination in Apollo"""++ class Config:+ extra = "allow" # Allow extra fields+ arbitrary_types_allowed = True # Allow any type+ from_attributes = True # Allow from_orm+ populate_by_name = True # Allow field aliases to work both ways++ page: int = 0+ per_page: int = 0+ total_entries: int = 0+ total_pages: int = 0+++class DialerFlags(BaseModel):+ """A dialer flags in Apollo"""++ country_name: str+ country_enabled: bool+ high_risk_calling_enabled: bool+ potential_high_risk_number: bool+++class PhoneNumber(BaseModel):+ """A phone number in Apollo"""++ raw_number: str = ""+ sanitized_number: str = ""+ type: str = ""+ position: int = 0+ status: str = ""+ dnc_status: str = ""+ dnc_other_info: str = ""+ dailer_flags: DialerFlags = DialerFlags(+ country_name="",+ country_enabled=True,+ high_risk_calling_enabled=True,+ potential_high_risk_number=True,+ )+++class Organization(BaseModel):+ """An organization in Apollo"""++ class Config:+ extra = "allow"+ arbitrary_types_allowed = True+ from_attributes = True+ populate_by_name = True++ id: Optional[str] = "N/A"+ name: Optional[str] = "N/A"+ website_url: Optional[str] = "N/A"+ blog_url: Optional[str] = "N/A"+ angellist_url: Optional[str] = "N/A"+ linkedin_url: Optional[str] = "N/A"+ twitter_url: Optional[str] = "N/A"+ facebook_url: Optional[str] = "N/A"+ primary_phone: Optional[PrimaryPhone] = PrimaryPhone(+ number="N/A", source="N/A", sanitized_number="N/A"+ )+ languages: list[str] = []+ alexa_ranking: Optional[int] = 0+ phone: Optional[str] = "N/A"+ linkedin_uid: Optional[str] = "N/A"+ founded_year: Optional[int] = 0+ publicly_traded_symbol: Optional[str] = "N/A"+ publicly_traded_exchange: Optional[str] = "N/A"+ logo_url: Optional[str] = "N/A"+ chrunchbase_url: Optional[str] = "N/A"+ primary_domain: Optional[str] = "N/A"+ sanitized_phone: Optional[str] = "N/A"+ owned_by_organization_id: Optional[str] = "N/A"+ intent_strength: Optional[str] = "N/A"+ show_intent: bool = True+ has_intent_signal_account: Optional[bool] = True+ intent_signal_account: Optional[str] = "N/A"+++class Contact(BaseModel):+ """A contact in Apollo"""++ class Config:+ extra = "allow"+ arbitrary_types_allowed = True+ from_attributes = True+ populate_by_name = True++ contact_roles: list[Any] = []+ id: Optional[str] = None+ first_name: Optional[str] = None+ last_name: Optional[str] = None+ name: Optional[str] = None+ linkedin_url: Optional[str] = None+ title: Optional[str] = None+ contact_stage_id: Optional[str] = None+ owner_id: Optional[str] = None+ creator_id: Optional[str] = None+ person_id: Optional[str] = None+ email_needs_tickling: bool = True+ organization_name: Optional[str] = None+ source: Optional[str] = None+ original_source: Optional[str] = None+ organization_id: Optional[str] = None+ headline: Optional[str] = None+ photo_url: Optional[str] = None+ present_raw_address: Optional[str] = None+ linkededin_uid: Optional[str] = None+ extrapolated_email_confidence: Optional[float] = None+ salesforce_id: Optional[str] = None+ salesforce_lead_id: Optional[str] = None+ salesforce_contact_id: Optional[str] = None+ saleforce_account_id: Optional[str] = None+ crm_owner_id: Optional[str] = None+ created_at: Optional[str] = None+ emailer_campaign_ids: list[str] = []+ direct_dial_status: Optional[str] = None+ direct_dial_enrichment_failed_at: Optional[str] = None+ email_status: Optional[str] = None+ email_source: Optional[str] = None+ account_id: Optional[str] = None+ last_activity_date: Optional[str] = None+ hubspot_vid: Optional[str] = None+ hubspot_company_id: Optional[str] = None+ crm_id: Optional[str] = None+ sanitized_phone: Optional[str] = None+ merged_crm_ids: Optional[str] = None+ updated_at: Optional[str] = None+ queued_for_crm_push: bool = True+ suggested_from_rule_engine_config_id: Optional[str] = None+ email_unsubscribed: Optional[str] = None+ label_ids: list[Any] = []+ has_pending_email_arcgate_request: bool = True+ has_email_arcgate_request: bool = True+ existence_level: Optional[str] = None+ email: Optional[str] = None+ email_from_customer: Optional[str] = None+ typed_custom_fields: list[TypedCustomField] = []+ custom_field_errors: Any = None+ salesforce_record_id: Optional[str] = None+ crm_record_url: Optional[str] = None+ email_status_unavailable_reason: Optional[str] = None+ email_true_status: Optional[str] = None+ updated_email_true_status: bool = True+ contact_rule_config_statuses: list[RuleConfigStatus] = []+ source_display_name: Optional[str] = None+ twitter_url: Optional[str] = None+ contact_campaign_statuses: list[ContactCampaignStatus] = []+ state: Optional[str] = None+ city: Optional[str] = None+ country: Optional[str] = None+ account: Optional[Account] = None+ contact_emails: list[ContactEmail] = []+ organization: Optional[Organization] = None+ employment_history: list[EmploymentHistory] = []+ time_zone: Optional[str] = None+ intent_strength: Optional[str] = None+ show_intent: bool = True+ phone_numbers: list[PhoneNumber] = []+ account_phone_note: Optional[str] = None+ free_domain: bool = True+ is_likely_to_engage: bool = True+ email_domain_catchall: bool = True+ contact_job_change_event: Optional[str] = None+++class SearchOrganizationsRequest(BaseModel):+ """Request for Apollo's search organizations API"""++ organization_num_empoloyees_range: list[int] = SchemaField(+ description="""The number range of employees working for the company. This enables you to find companies based on headcount. You can add multiple ranges to expand your search results.++Each range you add needs to be a string, with the upper and lower numbers of the range separated only by a comma.""",+ default=[0, 1000000],+ )++ organization_locations: list[str] = SchemaField(+ description="""The location of the company headquarters. You can search across cities, US states, and countries.++If a company has several office locations, results are still based on the headquarters location. For example, if you search chicago but a company's HQ location is in boston, any Boston-based companies will not appearch in your search results, even if they match other parameters.++To exclude companies based on location, use the organization_not_locations parameter.+""",+ default=[],+ )+ organizations_not_locations: list[str] = SchemaField(+ description="""Exclude companies from search results based on the location of the company headquarters. You can use cities, US states, and countries as locations to exclude.++This parameter is useful for ensuring you do not prospect in an undesirable territory. For example, if you use ireland as a value, no Ireland-based companies will appear in your search results.+""",+ default=[],+ )+ q_organization_keyword_tags: list[str] = SchemaField(+ description="""Filter search results based on keywords associated with companies. For example, you can enter mining as a value to return only companies that have an association with the mining industry."""+ )+ q_organization_name: str = SchemaField(+ description="""Filter search results to include a specific company name.++If the value you enter for this parameter does not match with a company's name, the company will not appear in search results, even if it matches other parameters. Partial matches are accepted. For example, if you filter by the value marketing, a company called NY Marketing Unlimited would still be eligible as a search result, but NY Market Analysis would not be eligible."""+ )+ organization_ids: list[str] = SchemaField(+ description="""The Apollo IDs for the companies you want to include in your search results. Each company in the Apollo database is assigned a unique ID.++To find IDs, identify the values for organization_id when you call this endpoint.""",+ default=[],+ )+ max_results: int = SchemaField(+ description="""The maximum number of results to return. If you don't specify this parameter, the default is 100.""",+ default=100,+ ge=1,+ le=50000,+ advanced=True,+ )++ page: int = SchemaField(+ description="""The page number of the Apollo data that you want to retrieve.++Use this parameter in combination with the per_page parameter to make search results for navigable and improve the performance of the endpoint.""",+ default=1,+ )+ per_page: int = SchemaField(+ description="""The number of search results that should be returned for each page. Limited the number of results per page improves the endpoint's performance.++Use the page parameter to search the different pages of data.""",+ default=100,+ )+++class SearchOrganizationsResponse(BaseModel):+ """Response from Apollo's search organizations API"""++ breadcrumbs: list[Breadcrumb] = []+ partial_results_only: bool = True+ has_join: bool = True+ disable_eu_prospecting: bool = True+ partial_results_limit: int = 0+ pagination: Pagination = Pagination(+ page=0, per_page=0, total_entries=0, total_pages=0+ )+ # no listed type on the API docs+ accounts: list[Any] = []+ organizations: list[Organization] = []+ models_ids: list[str] = []+ num_fetch_result: Optional[str] = "N/A"+ derived_params: Optional[str] = "N/A"+++class SearchPeopleRequest(BaseModel):+ """Request for Apollo's search people API"""++ person_titles: list[str] = SchemaField(+ description="""Job titles held by the people you want to find. For a person to be included in search results, they only need to match 1 of the job titles you add. Adding more job titles expands your search results.++Results also include job titles with the same terms, even if they are not exact matches. For example, searching for marketing manager might return people with the job title content marketing manager.++Use this parameter in combination with the person_seniorities[] parameter to find people based on specific job functions and seniority levels.+""",+ default=[],+ placeholder="marketing manager",+ )+ person_locations: list[str] = SchemaField(+ description="""The location where people live. You can search across cities, US states, and countries.++To find people based on the headquarters locations of their current employer, use the organization_locations parameter.""",+ default=[],+ )+ person_seniorities: list[SenorityLevels] = SchemaField(+ description="""The job seniority that people hold within their current employer. This enables you to find people that currently hold positions at certain reporting levels, such as Director level or senior IC level.++For a person to be included in search results, they only need to match 1 of the seniorities you add. Adding more seniorities expands your search results.++Searches only return results based on their current job title, so searching for Director-level employees only returns people that currently hold a Director-level title. If someone was previously a Director, but is currently a VP, they would not be included in your search results.++Use this parameter in combination with the person_titles[] parameter to find people based on specific job functions and seniority levels.""",+ default=[],+ )+ organization_locations: list[str] = SchemaField(+ description="""The location of the company headquarters for a person's current employer. You can search across cities, US states, and countries.++If a company has several office locations, results are still based on the headquarters location. For example, if you search chicago but a company's HQ location is in boston, people that work for the Boston-based company will not appear in your results, even if they match other parameters.++To find people based on their personal location, use the person_locations parameter.""",+ default=[],+ )+ q_organization_domains: list[str] = SchemaField(+ description="""The domain name for the person's employer. This can be the current employer or a previous employer. Do not include www., the @ symbol, or similar.++You can add multiple domains to search across companies.++ Examples: apollo.io and microsoft.com""",+ default=[],+ )+ contact_email_statuses: list[ContactEmailStatuses] = SchemaField(+ description="""The email statuses for the people you want to find. You can add multiple statuses to expand your search.""",+ default=[],+ )+ organization_ids: list[str] = SchemaField(+ description="""The Apollo IDs for the companies (employers) you want to include in your search results. Each company in the Apollo database is assigned a unique ID.++To find IDs, call the Organization Search endpoint and identify the values for organization_id.""",+ default=[],+ )+ organization_num_empoloyees_range: list[int] = SchemaField(+ description="""The number range of employees working for the company. This enables you to find companies based on headcount. You can add multiple ranges to expand your search results.++Each range you add needs to be a string, with the upper and lower numbers of the range separated only by a comma.""",+ default=[],+ )+ q_keywords: str = SchemaField(+ description="""A string of words over which we want to filter the results""",+ default="",+ )+ page: int = SchemaField(+ description="""The page number of the Apollo data that you want to retrieve.++Use this parameter in combination with the per_page parameter to make search results for navigable and improve the performance of the endpoint.""",+ default=1,+ )+ per_page: int = SchemaField(+ description="""The number of search results that should be returned for each page. Limited the number of results per page improves the endpoint's performance.++Use the page parameter to search the different pages of data.""",+ default=100,+ )+ max_results: int = SchemaField(+ description="""The maximum number of results to return. If you don't specify this parameter, the default is 100.""",+ default=100,+ ge=1,+ le=50000,+ advanced=True,+ )+++class SearchPeopleResponse(BaseModel):+ """Response from Apollo's search people API"""++ class Config:+ extra = "allow" # Allow extra fields+ arbitrary_types_allowed = True # Allow any type+ from_attributes = True # Allow from_orm+ populate_by_name = True # Allow field aliases to work both ways++ breadcrumbs: list[Breadcrumb] = []+ partial_results_only: bool = True+ has_join: bool = True+ disable_eu_prospecting: bool = True+ partial_results_limit: int = 0+ pagination: Pagination = Pagination(+ page=0, per_page=0, total_entries=0, total_pages=0+ )+ contacts: list[Contact] = []+ people: list[Contact] = []+ model_ids: list[str] = []+ num_fetch_result: Optional[str] = "N/A"+ derived_params: Optional[str] = "N/A"diff --git a/autogpt_platform/backend/backend/blocks/apollo/organization.py b/autogpt_platform/backend/backend/blocks/apollo/organization.pynew file mode 100644index 0000000000..45ce769fcf--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/apollo/organization.py@@ -0,0 +1,219 @@+from backend.blocks.apollo._api import ApolloClient+from backend.blocks.apollo._auth import (+ TEST_CREDENTIALS,+ TEST_CREDENTIALS_INPUT,+ ApolloCredentials,+ ApolloCredentialsInput,+)+from backend.blocks.apollo.models import (+ Organization,+ PrimaryPhone,+ SearchOrganizationsRequest,+)+from backend.data.block import Block, BlockCategory, BlockOutput, BlockSchema+from backend.data.model import SchemaField+++class SearchOrganizationsBlock(Block):+ """Search for organizations in Apollo"""++ class Input(BlockSchema):+ organization_num_empoloyees_range: list[int] = SchemaField(+ description="""The number range of employees working for the company. This enables you to find companies based on headcount. You can add multiple ranges to expand your search results.++Each range you add needs to be a string, with the upper and lower numbers of the range separated only by a comma.""",+ default=[0, 1000000],+ )++ organization_locations: list[str] = SchemaField(+ description="""The location of the company headquarters. You can search across cities, US states, and countries.++If a company has several office locations, results are still based on the headquarters location. For example, if you search chicago but a company's HQ location is in boston, any Boston-based companies will not appearch in your search results, even if they match other parameters.++To exclude companies based on location, use the organization_not_locations parameter.+""",+ default=[],+ )+ organizations_not_locations: list[str] = SchemaField(+ description="""Exclude companies from search results based on the location of the company headquarters. You can use cities, US states, and countries as locations to exclude.++This parameter is useful for ensuring you do not prospect in an undesirable territory. For example, if you use ireland as a value, no Ireland-based companies will appear in your search results.+""",+ default=[],+ )+ q_organization_keyword_tags: list[str] = SchemaField(+ description="""Filter search results based on keywords associated with companies. For example, you can enter mining as a value to return only companies that have an association with the mining industry.""",+ default=[],+ )+ q_organization_name: str = SchemaField(+ description="""Filter search results to include a specific company name.++If the value you enter for this parameter does not match with a company's name, the company will not appear in search results, even if it matches other parameters. Partial matches are accepted. For example, if you filter by the value marketing, a company called NY Marketing Unlimited would still be eligible as a search result, but NY Market Analysis would not be eligible.""",+ default="",+ advanced=False,+ )+ organization_ids: list[str] = SchemaField(+ description="""The Apollo IDs for the companies you want to include in your search results. Each company in the Apollo database is assigned a unique ID.++To find IDs, identify the values for organization_id when you call this endpoint.""",+ default=[],+ )+ max_results: int = SchemaField(+ description="""The maximum number of results to return. If you don't specify this parameter, the default is 100.""",+ default=100,+ ge=1,+ le=50000,+ advanced=True,+ )+ credentials: ApolloCredentialsInput = SchemaField(+ description="Apollo credentials",+ )++ class Output(BlockSchema):+ organizations: list[Organization] = SchemaField(+ description="List of organizations found",+ default=[],+ )+ organization: Organization = SchemaField(+ description="Each found organization, one at a time",+ )+ error: str = SchemaField(+ description="Error message if the search failed",+ default="",+ )++ def __init__(self):+ super().__init__(+ id="3d71270d-599e-4148-9b95-71b35d2f44f0",+ description="Search for organizations in Apollo",+ categories={BlockCategory.SEARCH},+ input_schema=SearchOrganizationsBlock.Input,+ output_schema=SearchOrganizationsBlock.Output,+ test_credentials=TEST_CREDENTIALS,+ test_input={"query": "Google", "credentials": TEST_CREDENTIALS_INPUT},+ test_output=[+ (+ "organization",+ Organization(+ id="1",+ name="Google",+ website_url="https://google.com",+ blog_url="https://google.com/blog",+ angellist_url="https://angel.co/google",+ linkedin_url="https://linkedin.com/company/google",+ twitter_url="https://twitter.com/google",+ facebook_url="https://facebook.com/google",+ primary_phone=PrimaryPhone(+ source="google",+ number="1234567890",+ sanitized_number="1234567890",+ ),+ languages=["en"],+ alexa_ranking=1000,+ phone="1234567890",+ linkedin_uid="1234567890",+ founded_year=2000,+ publicly_traded_symbol="GOOGL",+ publicly_traded_exchange="NASDAQ",+ logo_url="https://google.com/logo.png",+ chrunchbase_url="https://chrunchbase.com/google",+ primary_domain="google.com",+ sanitized_phone="1234567890",+ owned_by_organization_id="1",+ intent_strength="strong",+ show_intent=True,+ has_intent_signal_account=True,+ intent_signal_account="1",+ ),+ ),+ (+ "organizations",+ [+ Organization(+ id="1",+ name="Google",+ website_url="https://google.com",+ blog_url="https://google.com/blog",+ angellist_url="https://angel.co/google",+ linkedin_url="https://linkedin.com/company/google",+ twitter_url="https://twitter.com/google",+ facebook_url="https://facebook.com/google",+ primary_phone=PrimaryPhone(+ source="google",+ number="1234567890",+ sanitized_number="1234567890",+ ),+ languages=["en"],+ alexa_ranking=1000,+ phone="1234567890",+ linkedin_uid="1234567890",+ founded_year=2000,+ publicly_traded_symbol="GOOGL",+ publicly_traded_exchange="NASDAQ",+ logo_url="https://google.com/logo.png",+ chrunchbase_url="https://chrunchbase.com/google",+ primary_domain="google.com",+ sanitized_phone="1234567890",+ owned_by_organization_id="1",+ intent_strength="strong",+ show_intent=True,+ has_intent_signal_account=True,+ intent_signal_account="1",+ ),+ ],+ ),+ ],+ test_mock={+ "search_organizations": lambda *args, **kwargs: [+ Organization(+ id="1",+ name="Google",+ website_url="https://google.com",+ blog_url="https://google.com/blog",+ angellist_url="https://angel.co/google",+ linkedin_url="https://linkedin.com/company/google",+ twitter_url="https://twitter.com/google",+ facebook_url="https://facebook.com/google",+ primary_phone=PrimaryPhone(+ source="google",+ number="1234567890",+ sanitized_number="1234567890",+ ),+ languages=["en"],+ alexa_ranking=1000,+ phone="1234567890",+ linkedin_uid="1234567890",+ founded_year=2000,+ publicly_traded_symbol="GOOGL",+ publicly_traded_exchange="NASDAQ",+ logo_url="https://google.com/logo.png",+ chrunchbase_url="https://chrunchbase.com/google",+ primary_domain="google.com",+ sanitized_phone="1234567890",+ owned_by_organization_id="1",+ intent_strength="strong",+ show_intent=True,+ has_intent_signal_account=True,+ intent_signal_account="1",+ )+ ]+ },+ )++ @staticmethod+ def search_organizations(+ query: SearchOrganizationsRequest, credentials: ApolloCredentials+ ) -> list[Organization]:+ client = ApolloClient(credentials)+ return client.search_organizations(query)++ def run(+ self, input_data: Input, *, credentials: ApolloCredentials, **kwargs+ ) -> BlockOutput:+ query = SearchOrganizationsRequest(+ **input_data.model_dump(exclude={"credentials"})+ )+ organizations = self.search_organizations(query, credentials)+ for organization in organizations:+ yield "organization", organization+ yield "organizations", organizationsdiff --git a/autogpt_platform/backend/backend/blocks/apollo/people.py b/autogpt_platform/backend/backend/blocks/apollo/people.pynew file mode 100644index 0000000000..ac75e03d1d--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/apollo/people.py@@ -0,0 +1,394 @@+from backend.blocks.apollo._api import ApolloClient+from backend.blocks.apollo._auth import (+ TEST_CREDENTIALS,+ TEST_CREDENTIALS_INPUT,+ ApolloCredentials,+ ApolloCredentialsInput,+)+from backend.blocks.apollo.models import (+ Contact,+ ContactEmailStatuses,+ SearchPeopleRequest,+ SenorityLevels,+)+from backend.data.block import Block, BlockCategory, BlockOutput, BlockSchema+from backend.data.model import SchemaField+++class SearchPeopleBlock(Block):+ """Search for people in Apollo"""++ class Input(BlockSchema):+ person_titles: list[str] = SchemaField(+ description="""Job titles held by the people you want to find. For a person to be included in search results, they only need to match 1 of the job titles you add. Adding more job titles expands your search results.++ Results also include job titles with the same terms, even if they are not exact matches. For example, searching for marketing manager might return people with the job title content marketing manager.++ Use this parameter in combination with the person_seniorities[] parameter to find people based on specific job functions and seniority levels.+ """,+ default=[],+ advanced=False,+ )+ person_locations: list[str] = SchemaField(+ description="""The location where people live. You can search across cities, US states, and countries.++ To find people based on the headquarters locations of their current employer, use the organization_locations parameter.""",+ default=[],+ advanced=False,+ )+ person_seniorities: list[SenorityLevels] = SchemaField(+ description="""The job seniority that people hold within their current employer. This enables you to find people that currently hold positions at certain reporting levels, such as Director level or senior IC level.++ For a person to be included in search results, they only need to match 1 of the seniorities you add. Adding more seniorities expands your search results.++ Searches only return results based on their current job title, so searching for Director-level employees only returns people that currently hold a Director-level title. If someone was previously a Director, but is currently a VP, they would not be included in your search results.++ Use this parameter in combination with the person_titles[] parameter to find people based on specific job functions and seniority levels.""",+ default=[],+ advanced=False,+ )+ organization_locations: list[str] = SchemaField(+ description="""The location of the company headquarters for a person's current employer. You can search across cities, US states, and countries.++ If a company has several office locations, results are still based on the headquarters location. For example, if you search chicago but a company's HQ location is in boston, people that work for the Boston-based company will not appear in your results, even if they match other parameters.++ To find people based on their personal location, use the person_locations parameter.""",+ default=[],+ advanced=False,+ )+ q_organization_domains: list[str] = SchemaField(+ description="""The domain name for the person's employer. This can be the current employer or a previous employer. Do not include www., the @ symbol, or similar.++ You can add multiple domains to search across companies.++ Examples: apollo.io and microsoft.com""",+ default=[],+ advanced=False,+ )+ contact_email_statuses: list[ContactEmailStatuses] = SchemaField(+ description="""The email statuses for the people you want to find. You can add multiple statuses to expand your search.""",+ default=[],+ advanced=False,+ )+ organization_ids: list[str] = SchemaField(+ description="""The Apollo IDs for the companies (employers) you want to include in your search results. Each company in the Apollo database is assigned a unique ID.++ To find IDs, call the Organization Search endpoint and identify the values for organization_id.""",+ default=[],+ advanced=False,+ )+ organization_num_empoloyees_range: list[int] = SchemaField(+ description="""The number range of employees working for the company. This enables you to find companies based on headcount. You can add multiple ranges to expand your search results.++ Each range you add needs to be a string, with the upper and lower numbers of the range separated only by a comma.""",+ default=[],+ advanced=False,+ )+ q_keywords: str = SchemaField(+ description="""A string of words over which we want to filter the results""",+ default="",+ advanced=False,+ )+ max_results: int = SchemaField(+ description="""The maximum number of results to return. If you don't specify this parameter, the default is 100.""",+ default=100,+ ge=1,+ le=50000,+ advanced=True,+ )++ credentials: ApolloCredentialsInput = SchemaField(+ description="Apollo credentials",+ )++ class Output(BlockSchema):+ people: list[Contact] = SchemaField(+ description="List of people found",+ default=[],+ )+ person: Contact = SchemaField(+ description="Each found person, one at a time",+ )+ error: str = SchemaField(+ description="Error message if the search failed",+ default="",+ )++ def __init__(self):+ super().__init__(+ id="c2adb3aa-5aae-488d-8a6e-4eb8c23e2ed6",+ description="Search for people in Apollo",+ categories={BlockCategory.SEARCH},+ input_schema=SearchPeopleBlock.Input,+ output_schema=SearchPeopleBlock.Output,+ test_credentials=TEST_CREDENTIALS,+ test_input={"credentials": TEST_CREDENTIALS_INPUT},+ test_output=[+ (+ "person",+ Contact(+ contact_roles=[],+ id="1",+ name="John Doe",+ first_name="John",+ last_name="Doe",+ linkedin_url="https://www.linkedin.com/in/johndoe",+ title="Software Engineer",+ organization_name="Google",+ organization_id="123456",+ contact_stage_id="1",+ owner_id="1",+ creator_id="1",+ person_id="1",+ email_needs_tickling=True,+ source="apollo",+ original_source="apollo",+ headline="Software Engineer",+ photo_url="https://www.linkedin.com/in/johndoe",+ present_raw_address="123 Main St, Anytown, USA",+ linkededin_uid="123456",+ extrapolated_email_confidence=0.8,+ salesforce_id="123456",+ salesforce_lead_id="123456",+ salesforce_contact_id="123456",+ saleforce_account_id="123456",+ crm_owner_id="123456",+ created_at="2021-01-01",+ emailer_campaign_ids=[],+ direct_dial_status="active",+ direct_dial_enrichment_failed_at="2021-01-01",+ email_status="active",+ email_source="apollo",+ account_id="123456",+ last_activity_date="2021-01-01",+ hubspot_vid="123456",+ hubspot_company_id="123456",+ crm_id="123456",+ sanitized_phone="123456",+ merged_crm_ids="123456",+ updated_at="2021-01-01",+ queued_for_crm_push=True,+ suggested_from_rule_engine_config_id="123456",+ email_unsubscribed=None,+ label_ids=[],+ has_pending_email_arcgate_request=True,+ has_email_arcgate_request=True,+ existence_level=None,+ email=None,+ email_from_customer=None,+ typed_custom_fields=[],+ custom_field_errors=None,+ salesforce_record_id=None,+ crm_record_url=None,+ email_status_unavailable_reason=None,+ email_true_status=None,+ updated_email_true_status=True,+ contact_rule_config_statuses=[],+ source_display_name=None,+ twitter_url=None,+ contact_campaign_statuses=[],+ state=None,+ city=None,+ country=None,+ account=None,+ contact_emails=[],+ organization=None,+ employment_history=[],+ time_zone=None,+ intent_strength=None,+ show_intent=True,+ phone_numbers=[],+ account_phone_note=None,+ free_domain=True,+ is_likely_to_engage=True,+ email_domain_catchall=True,+ contact_job_change_event=None,+ ),+ ),+ (+ "people",+ [+ Contact(+ contact_roles=[],+ id="1",+ name="John Doe",+ first_name="John",+ last_name="Doe",+ linkedin_url="https://www.linkedin.com/in/johndoe",+ title="Software Engineer",+ organization_name="Google",+ organization_id="123456",+ contact_stage_id="1",+ owner_id="1",+ creator_id="1",+ person_id="1",+ email_needs_tickling=True,+ source="apollo",+ original_source="apollo",+ headline="Software Engineer",+ photo_url="https://www.linkedin.com/in/johndoe",+ present_raw_address="123 Main St, Anytown, USA",+ linkededin_uid="123456",+ extrapolated_email_confidence=0.8,+ salesforce_id="123456",+ salesforce_lead_id="123456",+ salesforce_contact_id="123456",+ saleforce_account_id="123456",+ crm_owner_id="123456",+ created_at="2021-01-01",+ emailer_campaign_ids=[],+ direct_dial_status="active",+ direct_dial_enrichment_failed_at="2021-01-01",+ email_status="active",+ email_source="apollo",+ account_id="123456",+ last_activity_date="2021-01-01",+ hubspot_vid="123456",+ hubspot_company_id="123456",+ crm_id="123456",+ sanitized_phone="123456",+ merged_crm_ids="123456",+ updated_at="2021-01-01",+ queued_for_crm_push=True,+ suggested_from_rule_engine_config_id="123456",+ email_unsubscribed=None,+ label_ids=[],+ has_pending_email_arcgate_request=True,+ has_email_arcgate_request=True,+ existence_level=None,+ email=None,+ email_from_customer=None,+ typed_custom_fields=[],+ custom_field_errors=None,+ salesforce_record_id=None,+ crm_record_url=None,+ email_status_unavailable_reason=None,+ email_true_status=None,+ updated_email_true_status=True,+ contact_rule_config_statuses=[],+ source_display_name=None,+ twitter_url=None,+ contact_campaign_statuses=[],+ state=None,+ city=None,+ country=None,+ account=None,+ contact_emails=[],+ organization=None,+ employment_history=[],+ time_zone=None,+ intent_strength=None,+ show_intent=True,+ phone_numbers=[],+ account_phone_note=None,+ free_domain=True,+ is_likely_to_engage=True,+ email_domain_catchall=True,+ contact_job_change_event=None,+ ),+ ],+ ),+ ],+ test_mock={+ "search_people": lambda query, credentials: [+ Contact(+ id="1",+ name="John Doe",+ first_name="John",+ last_name="Doe",+ linkedin_url="https://www.linkedin.com/in/johndoe",+ title="Software Engineer",+ organization_name="Google",+ organization_id="123456",+ contact_stage_id="1",+ owner_id="1",+ creator_id="1",+ person_id="1",+ email_needs_tickling=True,+ source="apollo",+ original_source="apollo",+ headline="Software Engineer",+ photo_url="https://www.linkedin.com/in/johndoe",+ present_raw_address="123 Main St, Anytown, USA",+ linkededin_uid="123456",+ extrapolated_email_confidence=0.8,+ salesforce_id="123456",+ salesforce_lead_id="123456",+ salesforce_contact_id="123456",+ saleforce_account_id="123456",+ crm_owner_id="123456",+ created_at="2021-01-01",+ emailer_campaign_ids=[],+ direct_dial_status="active",+ direct_dial_enrichment_failed_at="2021-01-01",+ email_status="active",+ email_source="apollo",+ account_id="123456",+ last_activity_date="2021-01-01",+ hubspot_vid="123456",+ hubspot_company_id="123456",+ crm_id="123456",+ sanitized_phone="123456",+ merged_crm_ids="123456",+ updated_at="2021-01-01",+ queued_for_crm_push=True,+ suggested_from_rule_engine_config_id="123456",+ email_unsubscribed=None,+ label_ids=[],+ has_pending_email_arcgate_request=True,+ has_email_arcgate_request=True,+ existence_level=None,+ email=None,+ email_from_customer=None,+ typed_custom_fields=[],+ custom_field_errors=None,+ salesforce_record_id=None,+ crm_record_url=None,+ email_status_unavailable_reason=None,+ email_true_status=None,+ updated_email_true_status=True,+ contact_rule_config_statuses=[],+ source_display_name=None,+ twitter_url=None,+ contact_campaign_statuses=[],+ state=None,+ city=None,+ country=None,+ account=None,+ contact_emails=[],+ organization=None,+ employment_history=[],+ time_zone=None,+ intent_strength=None,+ show_intent=True,+ phone_numbers=[],+ account_phone_note=None,+ free_domain=True,+ is_likely_to_engage=True,+ email_domain_catchall=True,+ contact_job_change_event=None,+ ),+ ]+ },+ )++ @staticmethod+ def search_people(+ query: SearchPeopleRequest, credentials: ApolloCredentials+ ) -> list[Contact]:+ client = ApolloClient(credentials)+ return client.search_people(query)++ def run(+ self,+ input_data: Input,+ *,+ credentials: ApolloCredentials,+ **kwargs,+ ) -> BlockOutput:++ query = SearchPeopleRequest(**input_data.model_dump(exclude={"credentials"}))+ people = self.search_people(query, credentials)+ for person in people:+ yield "person", person+ yield "people", peoplediff --git a/autogpt_platform/backend/backend/blocks/smartlead/_api.py b/autogpt_platform/backend/backend/blocks/smartlead/_api.pynew file mode 100644index 0000000000..8caa266c2c--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/smartlead/_api.py@@ -0,0 +1,97 @@+from backend.blocks.smartlead.models import (+ AddLeadsRequest,+ AddLeadsToCampaignResponse,+ CreateCampaignRequest,+ CreateCampaignResponse,+ SaveSequencesRequest,+ SaveSequencesResponse,+)+from backend.util.request import Requests+++class SmartLeadClient:+ """Client for the SmartLead API"""++ # This api is stupid and requires your api key in the url. DO NOT RAISE ERRORS FOR BAD REQUESTS.+ # FILTER OUT THE API KEY FROM THE ERROR MESSAGE.++ API_URL = "https://server.smartlead.ai/api/v1"++ def __init__(self, api_key: str):+ self.api_key = api_key+ self.requests = Requests()++ def _add_auth_to_url(self, url: str) -> str:+ return f"{url}?api_key={self.api_key}"++ def _handle_error(self, e: Exception) -> str:+ return e.__str__().replace(self.api_key, "API KEY")++ def create_campaign(self, request: CreateCampaignRequest) -> CreateCampaignResponse:+ try:+ response = self.requests.post(+ self._add_auth_to_url(f"{self.API_URL}/campaigns/create"),+ json=request.model_dump(),+ )+ response_data = response.json()+ return CreateCampaignResponse(**response_data)+ except ValueError as e:+ raise ValueError(f"Invalid response format: {str(e)}")+ except Exception as e:+ raise ValueError(f"Failed to create campaign: {self._handle_error(e)}")++ def add_leads_to_campaign(+ self, request: AddLeadsRequest+ ) -> AddLeadsToCampaignResponse:+ try:+ response = self.requests.post(+ self._add_auth_to_url(+ f"{self.API_URL}/campaigns/{request.campaign_id}/leads"+ ),+ json=request.model_dump(exclude={"campaign_id"}),+ )+ response_data = response.json()+ response_parsed = AddLeadsToCampaignResponse(**response_data)+ if not response_parsed.ok:+ raise ValueError(+ f"Failed to add leads to campaign: {response_parsed.error}"+ )+ return response_parsed+ except ValueError as e:+ raise ValueError(f"Invalid response format: {str(e)}")+ except Exception as e:+ raise ValueError(+ f"Failed to add leads to campaign: {self._handle_error(e)}"+ )++ def save_campaign_sequences(+ self, campaign_id: int, request: SaveSequencesRequest+ ) -> SaveSequencesResponse:+ """+ Save sequences within a campaign.++ Args:+ campaign_id: ID of the campaign to save sequences for+ request: SaveSequencesRequest containing the sequences configuration++ Returns:+ SaveSequencesResponse with the result of the operation++ Note:+ For variant_distribution_type:+ - MANUAL_EQUAL: Equally distributes variants across leads+ - AI_EQUAL: Requires winning_metric_property and lead_distribution_percentage+ - MANUAL_PERCENTAGE: Requires variant_distribution_percentage in seq_variants+ """+ try:+ response = self.requests.post(+ self._add_auth_to_url(+ f"{self.API_URL}/campaigns/{campaign_id}/sequences"+ ),+ json=request.model_dump(exclude_none=True),+ )+ return SaveSequencesResponse(**response.json())+ except Exception as e:+ raise ValueError(+ f"Failed to save campaign sequences: {e.__str__().replace(self.api_key, 'API KEY')}"+ )diff --git a/autogpt_platform/backend/backend/blocks/smartlead/_auth.py b/autogpt_platform/backend/backend/blocks/smartlead/_auth.pynew file mode 100644index 0000000000..219524126c--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/smartlead/_auth.py@@ -0,0 +1,35 @@+from typing import Literal++from pydantic import SecretStr++from backend.data.model import APIKeyCredentials, CredentialsField, CredentialsMetaInput+from backend.integrations.providers import ProviderName++SmartLeadCredentials = APIKeyCredentials+SmartLeadCredentialsInput = CredentialsMetaInput[+ Literal[ProviderName.SMARTLEAD],+ Literal["api_key"],+]++TEST_CREDENTIALS = APIKeyCredentials(+ id="01234567-89ab-cdef-0123-456789abcdef",+ provider="smartlead",+ api_key=SecretStr("mock-smartlead-api-key"),+ title="Mock SmartLead API key",+ expires_at=None,+)+TEST_CREDENTIALS_INPUT = {+ "provider": TEST_CREDENTIALS.provider,+ "id": TEST_CREDENTIALS.id,+ "type": TEST_CREDENTIALS.type,+ "title": TEST_CREDENTIALS.title,+}+++def SmartLeadCredentialsField() -> SmartLeadCredentialsInput:+ """+ Creates a SmartLead credentials input on a block.+ """+ return CredentialsField(+ description="The SmartLead integration can be used with an API Key.",+ )diff --git a/autogpt_platform/backend/backend/blocks/smartlead/campaign.py b/autogpt_platform/backend/backend/blocks/smartlead/campaign.pynew file mode 100644index 0000000000..942ebcd471--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/smartlead/campaign.py@@ -0,0 +1,326 @@+from backend.blocks.smartlead._api import SmartLeadClient+from backend.blocks.smartlead._auth import (+ TEST_CREDENTIALS,+ TEST_CREDENTIALS_INPUT,+ SmartLeadCredentials,+ SmartLeadCredentialsInput,+)+from backend.blocks.smartlead.models import (+ AddLeadsRequest,+ AddLeadsToCampaignResponse,+ CreateCampaignRequest,+ CreateCampaignResponse,+ LeadInput,+ LeadUploadSettings,+ SaveSequencesRequest,+ SaveSequencesResponse,+ Sequence,+)+from backend.data.block import Block, BlockCategory, BlockOutput, BlockSchema+from backend.data.model import SchemaField+++class CreateCampaignBlock(Block):+ """Create a campaign in SmartLead"""++ class Input(BlockSchema):+ name: str = SchemaField(+ description="The name of the campaign",+ )+ credentials: SmartLeadCredentialsInput = SchemaField(+ description="SmartLead credentials",+ )++ class Output(BlockSchema):+ id: int = SchemaField(+ description="The ID of the created campaign",+ )+ name: str = SchemaField(+ description="The name of the created campaign",+ )+ created_at: str = SchemaField(+ description="The date and time the campaign was created",+ )+ error: str = SchemaField(+ description="Error message if the search failed",+ default="",+ )++ def __init__(self):+ super().__init__(+ id="8865699f-9188-43c4-89b0-79c84cfaa03e",+ description="Create a campaign in SmartLead",+ categories={BlockCategory.CRM},+ input_schema=CreateCampaignBlock.Input,+ output_schema=CreateCampaignBlock.Output,+ test_credentials=TEST_CREDENTIALS,+ test_input={"name": "Test Campaign", "credentials": TEST_CREDENTIALS_INPUT},+ test_output=[+ (+ "id",+ 1,+ ),+ (+ "name",+ "Test Campaign",+ ),+ (+ "created_at",+ "2024-01-01T00:00:00Z",+ ),+ ],+ test_mock={+ "create_campaign": lambda name, credentials: CreateCampaignResponse(+ ok=True,+ id=1,+ name=name,+ created_at="2024-01-01T00:00:00Z",+ )+ },+ )++ @staticmethod+ def create_campaign(+ name: str, credentials: SmartLeadCredentials+ ) -> CreateCampaignResponse:+ client = SmartLeadClient(credentials.api_key.get_secret_value())+ return client.create_campaign(CreateCampaignRequest(name=name))++ def run(+ self,+ input_data: Input,+ *,+ credentials: SmartLeadCredentials,+ **kwargs,+ ) -> BlockOutput:+ response = self.create_campaign(input_data.name, credentials)++ yield "id", response.id+ yield "name", response.name+ yield "created_at", response.created_at+ if not response.ok:+ yield "error", "Failed to create campaign"+++class AddLeadToCampaignBlock(Block):+ """Add a lead to a campaign in SmartLead"""++ class Input(BlockSchema):+ campaign_id: int = SchemaField(+ description="The ID of the campaign to add the lead to",+ )+ lead_list: list[LeadInput] = SchemaField(+ description="An array of JSON objects, each representing a lead's details. Can hold max 100 leads.",+ max_length=100,+ default=[],+ advanced=False,+ )+ settings: LeadUploadSettings = SchemaField(+ description="Settings for lead upload",+ default=LeadUploadSettings(),+ )+ credentials: SmartLeadCredentialsInput = SchemaField(+ description="SmartLead credentials",+ )++ class Output(BlockSchema):+ campaign_id: int = SchemaField(+ description="The ID of the campaign the lead was added to (passed through)",+ )+ upload_count: int = SchemaField(+ description="The number of leads added to the campaign",+ )+ already_added_to_campaign: int = SchemaField(+ description="The number of leads that were already added to the campaign",+ )+ duplicate_count: int = SchemaField(+ description="The number of emails that were duplicates",+ )+ invalid_email_count: int = SchemaField(+ description="The number of emails that were invalidly formatted",+ )+ is_lead_limit_exhausted: bool = SchemaField(+ description="Whether the lead limit was exhausted",+ )+ lead_import_stopped_count: int = SchemaField(+ description="The number of leads that were not added to the campaign because the lead import was stopped",+ )+ error: str = SchemaField(+ description="Error message if the lead was not added to the campaign",+ default="",+ )++ def __init__(self):+ super().__init__(+ id="fb8106a4-1a8f-42f9-a502-f6d07e6fe0ec",+ description="Add a lead to a campaign in SmartLead",+ categories={BlockCategory.CRM},+ input_schema=AddLeadToCampaignBlock.Input,+ output_schema=AddLeadToCampaignBlock.Output,+ test_credentials=TEST_CREDENTIALS,+ test_input={+ "campaign_id": 1,+ "lead_list": [],+ "credentials": TEST_CREDENTIALS_INPUT,+ },+ test_output=[+ (+ "campaign_id",+ 1,+ ),+ (+ "upload_count",+ 1,+ ),+ ],+ test_mock={+ "add_leads_to_campaign": lambda campaign_id, lead_list, credentials: AddLeadsToCampaignResponse(+ ok=True,+ upload_count=1,+ already_added_to_campaign=0,+ duplicate_count=0,+ invalid_email_count=0,+ is_lead_limit_exhausted=False,+ lead_import_stopped_count=0,+ error="",+ total_leads=1,+ block_count=0,+ invalid_emails=[],+ unsubscribed_leads=[],+ bounce_count=0,+ )+ },+ )++ @staticmethod+ def add_leads_to_campaign(+ campaign_id: int, lead_list: list[LeadInput], credentials: SmartLeadCredentials+ ) -> AddLeadsToCampaignResponse:+ client = SmartLeadClient(credentials.api_key.get_secret_value())+ return client.add_leads_to_campaign(+ AddLeadsRequest(+ campaign_id=campaign_id,+ lead_list=lead_list,+ settings=LeadUploadSettings(+ ignore_global_block_list=False,+ ignore_unsubscribe_list=False,+ ignore_community_bounce_list=False,+ ignore_duplicate_leads_in_other_campaign=False,+ ),+ ),+ )++ def run(+ self,+ input_data: Input,+ *,+ credentials: SmartLeadCredentials,+ **kwargs,+ ) -> BlockOutput:+ response = self.add_leads_to_campaign(+ input_data.campaign_id, input_data.lead_list, credentials+ )++ yield "campaign_id", input_data.campaign_id+ yield "upload_count", response.upload_count+ if response.already_added_to_campaign:+ yield "already_added_to_campaign", response.already_added_to_campaign+ if response.duplicate_count:+ yield "duplicate_count", response.duplicate_count+ if response.invalid_email_count:+ yield "invalid_email_count", response.invalid_email_count+ if response.is_lead_limit_exhausted:+ yield "is_lead_limit_exhausted", response.is_lead_limit_exhausted+ if response.lead_import_stopped_count:+ yield "lead_import_stopped_count", response.lead_import_stopped_count+ if response.error:+ yield "error", response.error+ if not response.ok:+ yield "error", "Failed to add leads to campaign"+++class SaveCampaignSequencesBlock(Block):+ """Save sequences within a campaign"""++ class Input(BlockSchema):+ campaign_id: int = SchemaField(+ description="The ID of the campaign to save sequences for",+ )+ sequences: list[Sequence] = SchemaField(+ description="The sequences to save",+ default=[],+ advanced=False,+ )+ credentials: SmartLeadCredentialsInput = SchemaField(+ description="SmartLead credentials",+ )++ class Output(BlockSchema):+ data: dict | str | None = SchemaField(+ description="Data from the API",+ default=None,+ )+ message: str = SchemaField(+ description="Message from the API",+ default="",+ )+ error: str = SchemaField(+ description="Error message if the sequences were not saved",+ default="",+ )++ def __init__(self):+ super().__init__(+ id="e7d9f41c-dc10-4f39-98ba-a432abd128c0",+ description="Save sequences within a campaign",+ categories={BlockCategory.CRM},+ input_schema=SaveCampaignSequencesBlock.Input,+ output_schema=SaveCampaignSequencesBlock.Output,+ test_credentials=TEST_CREDENTIALS,+ test_input={+ "campaign_id": 1,+ "sequences": [],+ "credentials": TEST_CREDENTIALS_INPUT,+ },+ test_output=[+ (+ "message",+ "Sequences saved successfully",+ ),+ ],+ test_mock={+ "save_campaign_sequences": lambda campaign_id, sequences, credentials: SaveSequencesResponse(+ ok=True,+ message="Sequences saved successfully",+ )+ },+ )++ @staticmethod+ def save_campaign_sequences(+ campaign_id: int, sequences: list[Sequence], credentials: SmartLeadCredentials+ ) -> SaveSequencesResponse:+ client = SmartLeadClient(credentials.api_key.get_secret_value())+ return client.save_campaign_sequences(+ campaign_id=campaign_id, request=SaveSequencesRequest(sequences=sequences)+ )++ def run(+ self,+ input_data: Input,+ *,+ credentials: SmartLeadCredentials,+ **kwargs,+ ) -> BlockOutput:+ response = self.save_campaign_sequences(+ input_data.campaign_id, input_data.sequences, credentials+ )++ if response.data:+ yield "data", response.data+ if response.message:+ yield "message", response.message+ if response.error:+ yield "error", response.error+ if not response.ok:+ yield "error", "Failed to save sequences"diff --git a/autogpt_platform/backend/backend/blocks/smartlead/models.py b/autogpt_platform/backend/backend/blocks/smartlead/models.pynew file mode 100644index 0000000000..a41d0e6ee8--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/smartlead/models.py@@ -0,0 +1,147 @@+from enum import Enum++from pydantic import BaseModel++from backend.data.model import SchemaField+++class CreateCampaignResponse(BaseModel):+ ok: bool+ id: int+ name: str+ created_at: str+++class CreateCampaignRequest(BaseModel):+ name: str+ client_id: str | None = None+++class AddLeadsToCampaignResponse(BaseModel):+ ok: bool+ upload_count: int+ total_leads: int+ block_count: int+ duplicate_count: int+ invalid_email_count: int+ invalid_emails: list[str]+ already_added_to_campaign: int+ unsubscribed_leads: list[str]+ is_lead_limit_exhausted: bool+ lead_import_stopped_count: int+ bounce_count: int+ error: str | None = None+++class LeadCustomFields(BaseModel):+ """Custom fields for a lead (max 20 fields)"""++ fields: dict[str, str] = SchemaField(+ description="Custom fields for a lead (max 20 fields)",+ max_length=20,+ default={},+ )+++class LeadInput(BaseModel):+ """Single lead input data"""++ first_name: str+ last_name: str+ email: str+ phone_number: str | None = None # Changed from int to str for phone numbers+ company_name: str | None = None+ website: str | None = None+ location: str | None = None+ custom_fields: LeadCustomFields | None = None+ linkedin_profile: str | None = None+ company_url: str | None = None+++class LeadUploadSettings(BaseModel):+ """Settings for lead upload"""++ ignore_global_block_list: bool = SchemaField(+ description="Ignore the global block list",+ default=False,+ )+ ignore_unsubscribe_list: bool = SchemaField(+ description="Ignore the unsubscribe list",+ default=False,+ )+ ignore_community_bounce_list: bool = SchemaField(+ description="Ignore the community bounce list",+ default=False,+ )+ ignore_duplicate_leads_in_other_campaign: bool = SchemaField(+ description="Ignore duplicate leads in other campaigns",+ default=False,+ )+++class AddLeadsRequest(BaseModel):+ """Request body for adding leads to a campaign"""++ lead_list: list[LeadInput] = SchemaField(+ description="List of leads to add to the campaign",+ max_length=100,+ default=[],+ )+ settings: LeadUploadSettings+ campaign_id: int+++class VariantDistributionType(str, Enum):+ MANUAL_EQUAL = "MANUAL_EQUAL"+ MANUAL_PERCENTAGE = "MANUAL_PERCENTAGE"+ AI_EQUAL = "AI_EQUAL"+++class WinningMetricProperty(str, Enum):+ OPEN_RATE = "OPEN_RATE"+ CLICK_RATE = "CLICK_RATE"+ REPLY_RATE = "REPLY_RATE"+ POSITIVE_REPLY_RATE = "POSITIVE_REPLY_RATE"+++class SequenceDelayDetails(BaseModel):+ delay_in_days: int+++class SequenceVariant(BaseModel):+ subject: str+ email_body: str+ variant_label: str+ id: int | None = None # Optional for creation, required for updates+ variant_distribution_percentage: int | None = None+++class Sequence(BaseModel):+ seq_number: int = SchemaField(+ description="The sequence number",+ default=1,+ )+ seq_delay_details: SequenceDelayDetails+ id: int | None = None+ variant_distribution_type: VariantDistributionType | None = None+ lead_distribution_percentage: int | None = SchemaField(+ None, ge=20, le=100+ ) # >= 20% for fair calculation+ winning_metric_property: WinningMetricProperty | None = None+ seq_variants: list[SequenceVariant] | None = None+ subject: str = "" # blank makes the follow up in the same thread+ email_body: str | None = None+++class SaveSequencesRequest(BaseModel):+ sequences: list[Sequence]+++class SaveSequencesResponse(BaseModel):+ ok: bool+ message: str = SchemaField(+ description="Message from the API",+ default="",+ )+ data: dict | str | None = None+ error: str | None = Nonediff --git a/autogpt_platform/backend/backend/blocks/zerobounce/_api.py b/autogpt_platform/backend/backend/blocks/zerobounce/_api.pynew file mode 100644index 0000000000..c78fe38c09--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/zerobounce/_api.py@@ -0,0 +1,10 @@+from zerobouncesdk import ZBValidateResponse, ZeroBounce+++class ZeroBounceClient:+ def __init__(self, api_key: str):+ self.api_key = api_key+ self.client = ZeroBounce(api_key)++ def validate_email(self, email: str, ip_address: str) -> ZBValidateResponse:+ return self.client.validate(email, ip_address)diff --git a/autogpt_platform/backend/backend/blocks/zerobounce/_auth.py b/autogpt_platform/backend/backend/blocks/zerobounce/_auth.pynew file mode 100644index 0000000000..e7125fc3c9--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/zerobounce/_auth.py@@ -0,0 +1,35 @@+from typing import Literal++from pydantic import SecretStr++from backend.data.model import APIKeyCredentials, CredentialsField, CredentialsMetaInput+from backend.integrations.providers import ProviderName++ZeroBounceCredentials = APIKeyCredentials+ZeroBounceCredentialsInput = CredentialsMetaInput[+ Literal[ProviderName.ZEROBOUNCE],+ Literal["api_key"],+]++TEST_CREDENTIALS = APIKeyCredentials(+ id="01234567-89ab-cdef-0123-456789abcdef",+ provider="zerobounce",+ api_key=SecretStr("mock-zerobounce-api-key"),+ title="Mock ZeroBounce API key",+ expires_at=None,+)+TEST_CREDENTIALS_INPUT = {+ "provider": TEST_CREDENTIALS.provider,+ "id": TEST_CREDENTIALS.id,+ "type": TEST_CREDENTIALS.type,+ "title": TEST_CREDENTIALS.title,+}+++def ZeroBounceCredentialsField() -> ZeroBounceCredentialsInput:+ """+ Creates a ZeroBounce credentials input on a block.+ """+ return CredentialsField(+ description="The ZeroBounce integration can be used with an API Key.",+ )diff --git a/autogpt_platform/backend/backend/blocks/zerobounce/validate_emails.py b/autogpt_platform/backend/backend/blocks/zerobounce/validate_emails.pynew file mode 100644index 0000000000..ee87a8f285--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/zerobounce/validate_emails.py@@ -0,0 +1,175 @@+from typing import Optional++from pydantic import BaseModel+from zerobouncesdk.zb_validate_response import (+ ZBValidateResponse,+ ZBValidateStatus,+ ZBValidateSubStatus,+)++from backend.blocks.zerobounce._api import ZeroBounceClient+from backend.blocks.zerobounce._auth import (+ TEST_CREDENTIALS,+ TEST_CREDENTIALS_INPUT,+ ZeroBounceCredentials,+ ZeroBounceCredentialsInput,+)+from backend.data.block import Block, BlockCategory, BlockOutput, BlockSchema+from backend.data.model import SchemaField+++class Response(BaseModel):+ address: str = SchemaField(+ description="The email address you are validating.", default="N/A"+ )+ status: ZBValidateStatus = SchemaField(+ description="The status of the email address.", default=ZBValidateStatus.unknown+ )+ sub_status: ZBValidateSubStatus = SchemaField(+ description="The sub-status of the email address.",+ default=ZBValidateSubStatus.none,+ )+ account: Optional[str] = SchemaField(+ description="The portion of the email address before the '@' symbol.",+ default="N/A",+ )+ domain: Optional[str] = SchemaField(+ description="The portion of the email address after the '@' symbol."+ )+ did_you_mean: Optional[str] = SchemaField(+ description="Suggestive Fix for an email typo",+ default=None,+ )+ domain_age_days: Optional[str] = SchemaField(+ description="Age of the email domain in days or [null].",+ default=None,+ )+ free_email: Optional[bool] = SchemaField(+ description="Whether the email address is a free email provider.", default=False+ )+ mx_found: Optional[bool] = SchemaField(+ description="Whether the MX record was found.", default=False+ )+ mx_record: Optional[str] = SchemaField(+ description="The MX record of the email address.", default=None+ )+ smtp_provider: Optional[str] = SchemaField(+ description="The SMTP provider of the email address.", default=None+ )+ firstname: Optional[str] = SchemaField(+ description="The first name of the email address.", default=None+ )+ lastname: Optional[str] = SchemaField(+ description="The last name of the email address.", default=None+ )+ gender: Optional[str] = SchemaField(+ description="The gender of the email address.", default=None+ )+ city: Optional[str] = SchemaField(+ description="The city of the email address.", default=None+ )+ region: Optional[str] = SchemaField(+ description="The region of the email address.", default=None+ )+ zipcode: Optional[str] = SchemaField(+ description="The zipcode of the email address.", default=None+ )+ country: Optional[str] = SchemaField(+ description="The country of the email address.", default=None+ )+++class ValidateEmailsBlock(Block):+ """Search for people in Apollo"""++ class Input(BlockSchema):+ email: str = SchemaField(+ description="Email to validate",+ )+ ip_address: str = SchemaField(+ description="IP address to validate",+ default="",+ )+ credentials: ZeroBounceCredentialsInput = SchemaField(+ description="ZeroBounce credentials",+ )++ class Output(BlockSchema):+ response: Response = SchemaField(+ description="Response from ZeroBounce",+ )+ error: str = SchemaField(+ description="Error message if the search failed",+ default="",+ )++ def __init__(self):+ super().__init__(+ id="e3950439-fa0b-40e8-b19f-e0dca0bf5853",+ description="Validate emails",+ categories={BlockCategory.SEARCH},+ input_schema=ValidateEmailsBlock.Input,+ output_schema=ValidateEmailsBlock.Output,+ test_credentials=TEST_CREDENTIALS,+ test_input={+ "credentials": TEST_CREDENTIALS_INPUT,+ "email": "[email protected]",+ },+ test_output=[+ (+ "response",+ Response(+ address="[email protected]",+ status=ZBValidateStatus.valid,+ sub_status=ZBValidateSubStatus.allowed,+ account="test",+ domain="test.com",+ did_you_mean=None,+ domain_age_days=None,+ free_email=False,+ mx_found=False,+ mx_record=None,+ smtp_provider=None,+ ),+ )+ ],+ test_mock={+ "validate_email": lambda email, ip_address, credentials: ZBValidateResponse(+ data={+ "address": email,+ "status": ZBValidateStatus.valid,+ "sub_status": ZBValidateSubStatus.allowed,+ "account": "test",+ "domain": "test.com",+ "did_you_mean": None,+ "domain_age_days": None,+ "free_email": False,+ "mx_found": False,+ "mx_record": None,+ "smtp_provider": None,+ }+ )+ },+ )++ @staticmethod+ def validate_email(+ email: str, ip_address: str, credentials: ZeroBounceCredentials+ ) -> ZBValidateResponse:+ client = ZeroBounceClient(credentials.api_key.get_secret_value())+ return client.validate_email(email, ip_address)++ def run(+ self,+ input_data: Input,+ *,+ credentials: ZeroBounceCredentials,+ **kwargs,+ ) -> BlockOutput:+ response: ZBValidateResponse = self.validate_email(+ input_data.email, input_data.ip_address, credentials+ )++ response_model = Response(**response.__dict__)++ yield "response", response_modeldiff --git a/autogpt_platform/backend/backend/executor/manager.py b/autogpt_platform/backend/backend/executor/manager.pyindex 65c84ee1bc..6e7d109d15 100644--- a/autogpt_platform/backend/backend/executor/manager.py+++ b/autogpt_platform/backend/backend/executor/manager.py@@ -210,6 +210,7 @@ def execute_node(for output_name, output_data in node_block.execute(input_data, **extra_exec_kwargs):+ output_data = json.convert_pydantic_to_json(output_data)output_size += len(json.dumps(output_data))log_metadata.info("Node produced output", **{output_name: output_data})db_client.upsert_execution_output(node_exec_id, output_name, output_data)diff --git a/autogpt_platform/backend/backend/integrations/credentials_store.py b/autogpt_platform/backend/backend/integrations/credentials_store.pyindex 5968cbe32d..3284c4b8fe 100644--- a/autogpt_platform/backend/backend/integrations/credentials_store.py+++ b/autogpt_platform/backend/backend/integrations/credentials_store.py@@ -145,6 +145,29 @@ mem0_credentials = APIKeyCredentials(expires_at=None,)+apollo_credentials = APIKeyCredentials(+ id="544c62b5-1d0f-4156-8fb4-9525f11656eb",+ provider="apollo",+ api_key=SecretStr(settings.secrets.apollo_api_key),+ title="Use Credits for Apollo",+ expires_at=None,+)++smartlead_credentials = APIKeyCredentials(+ id="3bcdbda3-84a3-46af-8fdb-bfd2472298b8",+ provider="smartlead",+ api_key=SecretStr(settings.secrets.smartlead_api_key),+ title="Use Credits for SmartLead",+ expires_at=None,+)++zerobounce_credentials = APIKeyCredentials(+ id="63a6e279-2dc2-448e-bf57-85776f7176dc",+ provider="zerobounce",+ api_key=SecretStr(settings.secrets.zerobounce_api_key),+ title="Use Credits for ZeroBounce",+ expires_at=None,+)DEFAULT_CREDENTIALS = [ollama_credentials,@@ -164,6 +187,9 @@ DEFAULT_CREDENTIALS = [mem0_credentials,nvidia_credentials,screenshotone_credentials,+ apollo_credentials,+ smartlead_credentials,+ zerobounce_credentials,]@@ -231,6 +257,12 @@ class IntegrationCredentialsStore:all_credentials.append(screenshotone_credentials)if settings.secrets.mem0_api_key:all_credentials.append(mem0_credentials)+ if settings.secrets.apollo_api_key:+ all_credentials.append(apollo_credentials)+ if settings.secrets.smartlead_api_key:+ all_credentials.append(smartlead_credentials)+ if settings.secrets.zerobounce_api_key:+ all_credentials.append(zerobounce_credentials)return all_credentialsdef get_creds_by_id(self, user_id: str, credentials_id: str) -> Credentials | None:diff --git a/autogpt_platform/backend/backend/integrations/providers.py b/autogpt_platform/backend/backend/integrations/providers.pyindex 6f31988d7f..eb1f513c2e 100644--- a/autogpt_platform/backend/backend/integrations/providers.py+++ b/autogpt_platform/backend/backend/integrations/providers.py@@ -4,6 +4,7 @@ from enum import Enum# --8<-- [start:ProviderName]class ProviderName(str, Enum):ANTHROPIC = "anthropic"+ APOLLO = "apollo"COMPASS = "compass"DISCORD = "discord"D_ID = "d_id"@@ -32,8 +33,10 @@ class ProviderName(str, Enum):REVID = "revid"SCREENSHOTONE = "screenshotone"SLANT3D = "slant3d"+ SMARTLEAD = "smartlead"SMTP = "smtp"TWITTER = "twitter"TODOIST = "todoist"UNREAL_SPEECH = "unreal_speech"+ ZEROBOUNCE = "zerobounce"# --8<-- [end:ProviderName]diff --git a/autogpt_platform/backend/backend/util/json.py b/autogpt_platform/backend/backend/util/json.pyindex 7f88917414..fbec1312a9 100644--- a/autogpt_platform/backend/backend/util/json.py+++ b/autogpt_platform/backend/backend/util/json.py@@ -1,8 +1,9 @@import json-from typing import Any, Type, TypeVar, overload+from typing import Any, Type, TypeGuard, TypeVar, overloadimport jsonschemafrom fastapi.encoders import jsonable_encoder+from pydantic import BaseModelfrom .type import type_match@@ -45,3 +46,17 @@ def validate_with_jsonschema(return Noneexcept jsonschema.ValidationError as e:return str(e)+++def is_list_of_basemodels(value: object) -> TypeGuard[list[BaseModel]]:+ return isinstance(value, list) and all(+ isinstance(item, BaseModel) for item in value+ )+++def convert_pydantic_to_json(output_data: Any) -> Any:+ if isinstance(output_data, BaseModel):+ return output_data.model_dump()+ if is_list_of_basemodels(output_data):+ return [item.model_dump() for item in output_data]+ return output_datadiff --git a/autogpt_platform/backend/backend/util/settings.py b/autogpt_platform/backend/backend/util/settings.pyindex d04293a8a2..bb1ffdb7ef 100644--- a/autogpt_platform/backend/backend/util/settings.py+++ b/autogpt_platform/backend/backend/util/settings.py@@ -364,6 +364,10 @@ class Secrets(UpdateTrackingModel["Secrets"], BaseSettings):screenshotone_api_key: str = Field(default="", description="ScreenshotOne API Key")+ apollo_api_key: str = Field(default="", description="Apollo API Key")+ smartlead_api_key: str = Field(default="", description="SmartLead API Key")+ zerobounce_api_key: str = Field(default="", description="ZeroBounce API Key")+# Add more secret fields as neededmodel_config = SettingsConfigDict(diff --git a/autogpt_platform/backend/poetry.lock b/autogpt_platform/backend/poetry.lockindex 2e88aded96..463ad6ea3f 100644--- a/autogpt_platform/backend/poetry.lock+++ b/autogpt_platform/backend/poetry.lock@@ -5936,6 +5936,21 @@ files = [defusedxml = ">=0.7.1,<0.8.0"requests = "*"+[[package]]+name = "zerobouncesdk"+version = "1.1.1"+description = "ZeroBounce Python API - https://www.zerobounce.net."+optional = false+python-versions = ">=3.7"+groups = ["main"]+files = [+ {file = "zerobouncesdk-1.1.1-py3-none-any.whl", hash = "sha256:9fb9dfa44fe4ce35d6f2e43d5144c31ca03544a3317d75643cb9f86b0c028675"},+ {file = "zerobouncesdk-1.1.1.tar.gz", hash = "sha256:00aa537263d5bc21534c0007dd9f94ce8e0986caa530c5a0bbe0bd917451f236"},+]++[package.dependencies]+requests = ">=2.22.0"+[[package]]name = "zipp"version = "3.21.0"@@ -6072,4 +6087,4 @@ cffi = ["cffi (>=1.11)"][metadata]lock-version = "2.1"python-versions = ">=3.10,<3.13"-content-hash = "1a222b9695cc0506038d4f0b021f71ff9a443490cee021beca5365a47b0437a2"+content-hash = "ba36ce74308bd37e19ca790e63dae387e5ad6173b2945dd63b58b3e918e85b46"diff --git a/autogpt_platform/backend/pyproject.toml b/autogpt_platform/backend/pyproject.tomlindex bcf834a8bd..31be7656fb 100644--- a/autogpt_platform/backend/pyproject.toml+++ b/autogpt_platform/backend/pyproject.toml@@ -37,6 +37,7 @@ ollama = "^0.4.1"openai = "^1.61.1"pika = "^1.3.2"pinecone = "^5.3.1"+poetry = "^2.1.1"postmarker = "^1.0"praw = "~7.8.1"prisma = "^0.15.0"@@ -62,8 +63,8 @@ tweepy = "^4.14.0"uvicorn = { extras = ["standard"], version = "^0.34.0" }websockets = "^13.1"youtube-transcript-api = "^0.6.2"+zerobouncesdk = "^1.1.1"# NOTE: please insert new dependencies in their alphabetical location-poetry = "^2.1.1"[tool.poetry.group.dev.dependencies]aiohappyeyeballs = "^2.4.4"diff --git a/autogpt_platform/frontend/src/app/profile/(user)/integrations/page.tsx b/autogpt_platform/frontend/src/app/profile/(user)/integrations/page.tsxindex 8069664017..182a6b2bb8 100644--- a/autogpt_platform/frontend/src/app/profile/(user)/integrations/page.tsx+++ b/autogpt_platform/frontend/src/app/profile/(user)/integrations/page.tsx@@ -113,6 +113,9 @@ export default function PrivatePage() {"78d19fd7-4d59-4a16-8277-3ce310acf2b7", // E2B"96b83908-2789-4dec-9968-18f0ece4ceb3", // Nvidia"ed55ac19-356e-4243-a6cb-bc599e9b716f", // Mem0+ "544c62b5-1d0f-4156-8fb4-9525f11656eb", // Apollo+ "3bcdbda3-84a3-46af-8fdb-bfd2472298b8", // SmartLead+ "63a6e279-2dc2-448e-bf57-85776f7176dc", // ZeroBounce],[],);diff --git a/autogpt_platform/frontend/src/components/integrations/credentials-input.tsx b/autogpt_platform/frontend/src/components/integrations/credentials-input.tsxindex 9663c8cc5f..16d9f8d0a6 100644--- a/autogpt_platform/frontend/src/components/integrations/credentials-input.tsx+++ b/autogpt_platform/frontend/src/components/integrations/credentials-input.tsx@@ -56,6 +56,7 @@ export const providerIcons: Record<React.FC<{ className?: string }>> = {anthropic: fallbackIcon,+ apollo: fallbackIcon,e2b: fallbackIcon,github: FaGithub,google: FaGoogle,@@ -86,7 +87,9 @@ export const providerIcons: Record<unreal_speech: fallbackIcon,exa: fallbackIcon,hubspot: FaHubspot,+ smartlead: fallbackIcon,todoist: fallbackIcon,+ zerobounce: fallbackIcon,};// --8<-- [end:ProviderIconsEmbed]diff --git a/autogpt_platform/frontend/src/components/integrations/credentials-provider.tsx b/autogpt_platform/frontend/src/components/integrations/credentials-provider.tsxindex 990cc04f99..db98f646c7 100644--- a/autogpt_platform/frontend/src/components/integrations/credentials-provider.tsx+++ b/autogpt_platform/frontend/src/components/integrations/credentials-provider.tsx@@ -18,6 +18,7 @@ const CREDENTIALS_PROVIDER_NAMES = Object.values(// --8<-- [start:CredentialsProviderNames]const providerDisplayNames: Record<CredentialsProviderName, string> = {anthropic: "Anthropic",+ apollo: "Apollo",discord: "Discord",d_id: "D-ID",e2b: "E2B",@@ -40,8 +41,9 @@ const providerDisplayNames: Record<CredentialsProviderName, string> = {openweathermap: "OpenWeatherMap",open_router: "Open Router",pinecone: "Pinecone",- slant3d: "Slant3D",screenshotone: "ScreenshotOne",+ slant3d: "Slant3D",+ smartlead: "SmartLead",smtp: "SMTP",reddit: "Reddit",replicate: "Replicate",@@ -49,6 +51,7 @@ const providerDisplayNames: Record<CredentialsProviderName, string> = {twitter: "Twitter",todoist: "Todoist",unreal_speech: "Unreal Speech",+ zerobounce: "ZeroBounce",} as const;// --8<-- [end:CredentialsProviderNames]diff --git a/autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts b/autogpt_platform/frontend/src/lib/autogpt-server-api/types.tsindex 9734ad2bea..6eb3199518 100644--- a/autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts+++ b/autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts@@ -112,6 +112,7 @@ export type Credentials =// --8<-- [start:BlockIOCredentialsSubSchema]export const PROVIDER_NAMES = {ANTHROPIC: "anthropic",+ APOLLO: "apollo",D_ID: "d_id",DISCORD: "discord",E2B: "e2b",@@ -134,8 +135,9 @@ export const PROVIDER_NAMES = {OPENWEATHERMAP: "openweathermap",OPEN_ROUTER: "open_router",PINECONE: "pinecone",- SLANT3D: "slant3d",SCREENSHOTONE: "screenshotone",+ SLANT3D: "slant3d",+ SMARTLEAD: "smartlead",SMTP: "smtp",TWITTER: "twitter",REPLICATE: "replicate",@@ -143,6 +145,7 @@ export const PROVIDER_NAMES = {REVID: "revid",UNREAL_SPEECH: "unreal_speech",TODOIST: "todoist",+ ZEROBOUNCE: "zerobounce",} as const;// --8<-- [end:BlockIOCredentialsSubSchema]