├── .DS_Store ├── .env.example ├── .gitignore ├── README.md └── cold_email.py /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdcorps/cold-email-ai/7331d241e5d2885cfe34a1d2504aaf45125a26e5/.DS_Store -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | OPENAI_API_KEY= 2 | ACTIVELOOP_TOKEN= 3 | ACTIVELOOP_ORG= 4 | SERPAPI_KEY= 5 | ZAPIER_NLA_API_KEY= 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cold-email-ai 2 | 3 | Run with: 4 | 5 | ``` 6 | python3 -m streamlit run cold_email.py 7 | ``` 8 | 9 | Demo: https://twitter.com/thisissukh_/status/1649193701972000769 10 | -------------------------------------------------------------------------------- /cold_email.py: -------------------------------------------------------------------------------- 1 | from dotenv import load_dotenv 2 | 3 | load_dotenv() 4 | 5 | import streamlit as st 6 | from langchain import PromptTemplate 7 | from langchain.agents import AgentType, initialize_agent, load_tools 8 | from langchain.agents.agent_toolkits import ZapierToolkit 9 | from langchain.llms import OpenAI 10 | from langchain.utilities.zapier import ZapierNLAWrapper 11 | 12 | llm = OpenAI(temperature=0) 13 | zapier = ZapierNLAWrapper() 14 | 15 | toolkit = ZapierToolkit.from_zapier_nla_wrapper(zapier) 16 | llm = OpenAI(temperature=0.9) 17 | 18 | tools = load_tools(["serpapi"], llm=llm) 19 | 20 | agent = initialize_agent(tools + toolkit.get_tools(), llm, agent="zero-shot-react-description", verbose=True) 21 | 22 | st.title('Send cold emails with AI') 23 | 24 | product = st.text_input('Name of the product youre selling: ') # Launchman 25 | function = st.text_input('What does the product do: ') # Automate your content marketing 26 | prospect = st.text_input('Who is the person youre selling to: ') # Sukh from Launchman 27 | 28 | if st.button('Do the magic!'): 29 | template = """ 30 | # You are Marko, a cold email outreach expert selling {product} with the function {function}. 31 | 32 | Search for a person named {prospect} and craft a cold email with 3 paragraphs that contains introduction about them, how {product} can help them, and book a meeting. Do not label the paragraphs, make sure to start a new line after each paragraph. Send it as email to: sunnyashiin@gmail.com.""" 33 | 34 | prompt = PromptTemplate( 35 | input_variables=["product", "function", "prospect"], 36 | template=template, 37 | ) 38 | 39 | formattedPrompt = prompt.format(product=product, function=function, prospect=prospect) 40 | 41 | agent.run(formattedPrompt) 42 | --------------------------------------------------------------------------------