Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -31
src/streamlit_app.py
CHANGED
|
@@ -209,26 +209,7 @@ def process_emails(worksheet, method='waterfall_both'):
|
|
| 209 |
st.write("Email verification step complete.")
|
| 210 |
|
| 211 |
# --- Helper function for row deletion ---
|
| 212 |
-
|
| 213 |
-
def delete_row(worksheet, row_number):
|
| 214 |
-
if hasattr(worksheet, "delete_row"):
|
| 215 |
-
worksheet.delete_row(row_number)
|
| 216 |
-
else:
|
| 217 |
-
sheet_id = worksheet.id
|
| 218 |
-
request_body = {
|
| 219 |
-
"requests": [{
|
| 220 |
-
"deleteDimension": {
|
| 221 |
-
"range": {
|
| 222 |
-
"sheetId": sheet_id,
|
| 223 |
-
"dimension": "ROWS",
|
| 224 |
-
"startIndex": row_number - 1,
|
| 225 |
-
"endIndex": row_number
|
| 226 |
-
}
|
| 227 |
-
}
|
| 228 |
-
}]
|
| 229 |
-
}
|
| 230 |
-
worksheet.spreadsheet.batch_update(request_body)
|
| 231 |
-
'''
|
| 232 |
# === Google Sheets Setup Helper Functions ===
|
| 233 |
def get_worksheet(sheet_id):
|
| 234 |
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
|
@@ -298,9 +279,9 @@ def get_grouping(first_name, last_name, company_name, designation, domain, linke
|
|
| 298 |
f"Domain: {domain}\n"
|
| 299 |
f"LinkedIn: {linkedin}\n\n"
|
| 300 |
"Please classify this person as follows:\n"
|
| 301 |
-
"• Reply with only 'Group 1' if the person is directly involved in
|
| 302 |
-
"• Reply with only 'Group 2' if the person is associated with
|
| 303 |
-
"• Reply with only 'Group 0' if and only if they are not associated with the any of
|
| 304 |
"Do not include any additional text."
|
| 305 |
)
|
| 306 |
result = generate_with_perplexity(grouping_prompt, max_tokens=30, use_response_format=False)
|
|
@@ -356,9 +337,9 @@ def get_introduction(first_name, last_name, designation, company_name, linkedin)
|
|
| 356 |
intro_prompt = (
|
| 357 |
"You are a skilled writer in crafting personalized introductions for emails targeting executives. "
|
| 358 |
"I am writing cold emails to folks for the fundraising of my company - but do not mention this anywhere. "
|
| 359 |
-
"Give me a
|
| 360 |
"Part 1:\n"
|
| 361 |
-
"Write a single, elegant, thought-provoking introductory sentence.
|
| 362 |
"then quote 'this is what you said' - and I completely resonate/agree. "
|
| 363 |
f"This person {first_name} {last_name} is a {designation} at {company_name} and their LinkedIn is {linkedin} (Optional). "
|
| 364 |
"Refer to the most recent web data/articles/news/ linkedin posts if possible; focus on a perspective, foundational insight, or a philosophy they’ve expressed. "
|
|
@@ -366,12 +347,6 @@ def get_introduction(first_name, last_name, designation, company_name, linkedin)
|
|
| 366 |
"Think of it as a conversational nudge that adds value and sparks curiosity. Draw on broad themes like industry trends, history, or entrepreneurial parallels. "
|
| 367 |
"Make it human, intriguing, witty, and effortless. Use natural language that doesn’t sound like it was generated by AI. "
|
| 368 |
"Do not use em dashes or colons. No quotation marks, no greetings, no names, no over-intellectualizing. Keep it simple, clean, and elegant.\n\n"
|
| 369 |
-
"Part 2 (after a blank line):\n"
|
| 370 |
-
"Add a second sentence - ask a question: something witty or charmingly curious, connecting from my background and inviting engagement, "
|
| 371 |
-
"but starting the line using - From steering Zebpay through India’s crypto ban into a global success to now building a platform powering the next era of crypto innovation..."
|
| 372 |
-
"Then give a topic/highlighting what founders like me struggle with - along with a reference to one of his portfolio companies "
|
| 373 |
-
"(include portfolio companies - if not his - check for the fund he belongs to similar to my company- if none then skip) "
|
| 374 |
-
"in that particular sector and end with asking for their time to connect or pick their brains on that..."
|
| 375 |
"Do not add any tags other than the personalised intro itself. No em dashes or hyphens. Do not give me a suggestion as to how i must do it or the process. Instead just give me the personalised intro itselfNo tags no references, no source tages, just the personalization line after researching the entire web"
|
| 376 |
)
|
| 377 |
|
|
|
|
| 209 |
st.write("Email verification step complete.")
|
| 210 |
|
| 211 |
# --- Helper function for row deletion ---
|
| 212 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
# === Google Sheets Setup Helper Functions ===
|
| 214 |
def get_worksheet(sheet_id):
|
| 215 |
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
|
|
|
| 279 |
f"Domain: {domain}\n"
|
| 280 |
f"LinkedIn: {linkedin}\n\n"
|
| 281 |
"Please classify this person as follows:\n"
|
| 282 |
+
"• Reply with only 'Group 1' if the person is directly involved in AI, Data, Data scaling, Data Annotation, AI Agents, Artificial Intelligence, ML, Machine Learning investments.\n"
|
| 283 |
+
"• Reply with only 'Group 2' if the person is associated with AI, Data, Data scaling, Data Annotation, AI Agents, Artificial Intelligence, ML, Machine Learning related topics (e.g., mentioned in keywords or linked with relevant articles) but not directly involved in an investment.\n"
|
| 284 |
+
"• Reply with only 'Group 0' if and only if they are not associated with the any of AI, Data, Data scaling, Data Annotation, AI Agents, Artificial Intelligence, ML, Machine Learning or related sectors in mentions or investments.\n"
|
| 285 |
"Do not include any additional text."
|
| 286 |
)
|
| 287 |
result = generate_with_perplexity(grouping_prompt, max_tokens=30, use_response_format=False)
|
|
|
|
| 337 |
intro_prompt = (
|
| 338 |
"You are a skilled writer in crafting personalized introductions for emails targeting executives. "
|
| 339 |
"I am writing cold emails to folks for the fundraising of my company - but do not mention this anywhere. "
|
| 340 |
+
"Give me a crisp ice-breaker opener, under 20 words total, for the fundraising outreach.\n\n"
|
| 341 |
"Part 1:\n"
|
| 342 |
+
"Write a single, elegant, thought-provoking introductory sentence."
|
| 343 |
"then quote 'this is what you said' - and I completely resonate/agree. "
|
| 344 |
f"This person {first_name} {last_name} is a {designation} at {company_name} and their LinkedIn is {linkedin} (Optional). "
|
| 345 |
"Refer to the most recent web data/articles/news/ linkedin posts if possible; focus on a perspective, foundational insight, or a philosophy they’ve expressed. "
|
|
|
|
| 347 |
"Think of it as a conversational nudge that adds value and sparks curiosity. Draw on broad themes like industry trends, history, or entrepreneurial parallels. "
|
| 348 |
"Make it human, intriguing, witty, and effortless. Use natural language that doesn’t sound like it was generated by AI. "
|
| 349 |
"Do not use em dashes or colons. No quotation marks, no greetings, no names, no over-intellectualizing. Keep it simple, clean, and elegant.\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 350 |
"Do not add any tags other than the personalised intro itself. No em dashes or hyphens. Do not give me a suggestion as to how i must do it or the process. Instead just give me the personalised intro itselfNo tags no references, no source tages, just the personalization line after researching the entire web"
|
| 351 |
)
|
| 352 |
|