Skip to content

Commit 2fa7505

Browse files
authored
fix(market-intel-bot): Give more concrete time range for article searches (#8492)
1 parent 4e50c42 commit 2fa7505

File tree

1 file changed

+8
-4
lines changed
  • sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1

1 file changed

+8
-4
lines changed

sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1/query.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ def main():
172172
print("report_date: ")
173173
print(report_date)
174174

175+
# Get the date range of news we are interested in, as a sentence.
176+
news_range_of_interest = f"Please only find recent articles, created on or later than {str(logical_dag_date)}."
177+
175178
# Check both input files exist, if not, error out
176179
gcs_fpath2 = GCS_BUCKET + INPUT_FPATH_2 + logical_dag_date_str + ".txt"
177180
gcs_fpath3 = GCS_BUCKET + INPUT_FPATH_3 + logical_dag_date_str + ".txt"
@@ -232,8 +235,9 @@ def main():
232235

233236
# Prompt #1 - New Features in Popular Browsers
234237
prompt1 = (
235-
"Look for articles from the past month about what new features have been added to popular web browsers, "
236-
"how they are incorporating AI, and how they are navigating challenges like the windows 10 transition. Then summarize these findings."
238+
"Look for articles about what new features have been added to popular web browsers, "
239+
"and how popular browsers are incorporating AI. " + news_range_of_interest
240+
"Then summarize these findings."
237241
"Firefox should be omitted from this search as we are focusing on Firefox's competitors."
238242
)
239243
final_output_1, response_object_1 = summarize_with_open_ai(
@@ -293,7 +297,7 @@ def main():
293297
prompt5 = """Please find articles related to browser & device partnerships.
294298
Firefox should be omitted from this search as we are focusing on Firefox's competitors.
295299
Please find all recent announcements of browser-device partnerships with browsers like Chrome, Edge, Safari, etc. and
296-
devices like mobile phones, Smart TVs, or VR (virtual reality), then summarize these findings."""
300+
devices like mobile phones, Smart TVs, or VR (virtual reality), then summarize these findings.""" + news_range_of_interest
297301
final_output_5, response_object_5 = summarize_with_open_ai(
298302
client,
299303
MODEL_TYPE,
@@ -320,7 +324,7 @@ def main():
320324

321325
# Prompt #7 - AI News
322326
prompt7 = (
323-
"Look for articles from the past month about news related to AI in general."
327+
"Look for articles about news related to AI in general." + news_range_of_interest
324328
)
325329
final_output_7, response_object_7 = summarize_with_open_ai(
326330
client,

0 commit comments

Comments
 (0)