Google Cloud's 601 real-world AI use cases
import json
import time
import pandas
import requests
from google import genai
# Complete the values
my_config = {
"GEMINI_API_KEY": "...",
}
genai_client = genai.Client(api_key=my_config["GEMINI_API_KEY"])
contact_list=pandas.read_csv('./contact_list.csv')
display(contact_list)
knowledge_base=""
with open('./knowledge_base.md','r') as f:
knowledge_base = f.read()
print(knowledge_base[0:5000] + "\n\n...")
def generate_email_body(name, industry, function, provided_knowledge_base):
prompt = f"""You are an sales assistant tasked with generating between 3 and 5 AI case studies for your customer.
You are provided a knowledge base consisting of a list of real-world AI use cases, located between the <knowledge_base> tags below.
You know the industry and function of the customer:
* Industry: {industry}
* Work fuction: {function}
Select the case studies that are most relevant to your customer and exhibit the most striking business value, prioritizing the use cases that include quantitative impact.
You must respond with a list of case studies in bullet points in markdown format, with each case study as a bullet point, and the case study details as sub bullet points.
The case study details must include, first, a **summary** sub-bullet point describing the concept of the use case and the name of the company, and second, a **business value** sub-bullet point describing the impacts achieved.
Do not include any other text in the response.
When formatting Markdown, the bullet points must start with a star, and the sub-bullet points must be indented with four spaces followed by a star.
Here is the knowledge base:
<knowledge_base>
{provided_knowledge_base}
</knowledge_base>
"""
# print("Prompt", prompt)
genai_response = genai_client.models.generate_content(
model="gemini-1.5-pro", contents=prompt
)
case_studies = genai_response.text
email_body = f"""Dear {name},
Thank you for joining our AI masterclass last week.
I hope that the session provided you with valuable insights. I just wanted to follow-up and highlight some of the ways that leading companies have applied GenAI in your industry or your function.
Here are a handful of relevant case studies:
{case_studies}
I’d love to continue the conversation and explore how we can help you to identify the right opportunities and create value with AI. If you're open to a quick 30-minute conversation, feel free to share a time that works best.
"""
return prompt, case_studies, email_body
if my_config.get("PROCESS_CONTACT_LIST_AGAIN", False):
outreach_output = contact_list.copy()
for index, row in outreach_output.iterrows():
email = row['email']
name = row['name']
industry = row['industry']
function = row['function']
prompt, case_studies, email_body = generate_email_body(name, industry, function, knowledge_base)
print("Email body:", email_body)
print("----------------------------------------")
outreach_output.at[index, 'prompt'] = prompt
outreach_output.at[index, 'case_studies'] = case_studies
outreach_output.at[index, 'email_body'] = email_body
outreach_output.to_csv('./data/outreach_output.csv', index=False)
else:
outreach_output = pandas.read_csv('./data/outreach_output.csv')
for index, row in outreach_output.iterrows():
print("Email body:", row['email_body'])
print("----------------------------------------")
display(outreach_output)
Now, try it for yourself
name
industry
function
prompt, case_studies, email_body = generate_email_body(name, industry, function, knowledge_base)
print("Email body:", email_body)