From 1041d84d30530cb68a9b8092624698d939c31770 Mon Sep 17 00:00:00 2001 From: Katie Windau Date: Fri, 21 Nov 2025 16:40:33 -0600 Subject: [PATCH 1/2] fix(DENG-10164): Fix string formatting issue --- .../market_intel_bot_v1/query.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1/query.py b/sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1/query.py index 28df5768421..a96ab06cd2d 100644 --- a/sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1/query.py +++ b/sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1/query.py @@ -172,6 +172,9 @@ def main(): print("report_date: ") print(report_date) + # Get the date range of news we are interested in, as a sentence. + news_range_of_interest = f"Please only find recent articles, created on or later than {str(logical_dag_date)}." + # Check both input files exist, if not, error out gcs_fpath2 = GCS_BUCKET + INPUT_FPATH_2 + logical_dag_date_str + ".txt" gcs_fpath3 = GCS_BUCKET + INPUT_FPATH_3 + logical_dag_date_str + ".txt" @@ -232,8 +235,10 @@ def main(): # Prompt #1 - New Features in Popular Browsers prompt1 = ( - "Look for articles from the past month about what new features have been added to popular web browsers, " - "how they are incorporating AI, and how they are navigating challenges like the windows 10 transition. Then summarize these findings." + "Look for articles about what new features have been added to popular web browsers, " + "and how popular browsers are incorporating AI. " + f"{news_range_of_interest} " + "Then summarize these findings." "Firefox should be omitted from this search as we are focusing on Firefox's competitors." ) final_output_1, response_object_1 = summarize_with_open_ai( @@ -290,10 +295,13 @@ def main(): More details can be found here: [Chrome Dev Tools](https://developer.chrome.com/docs/devtools/news?hl=en#whats-new)""" # Prompt #5 - Browser & Device Partnership News - prompt5 = """Please find articles related to browser & device partnerships. + prompt5 = ( + """Please find articles related to browser & device partnerships. Firefox should be omitted from this search as we are focusing on Firefox's competitors. Please find all recent announcements of browser-device partnerships with browsers like Chrome, Edge, Safari, etc. and devices like mobile phones, Smart TVs, or VR (virtual reality), then summarize these findings.""" + + news_range_of_interest + ) final_output_5, response_object_5 = summarize_with_open_ai( client, MODEL_TYPE, @@ -306,7 +314,10 @@ def main(): final_report += f"\n{final_output_5}\n\n" # Prompt #6 - Online Advertising News - prompt6 = "Look for articles from the past month about news related to online advertising, and summarize the findings." + prompt6 = ( + "Look for articles about news related to online advertising, and summarize the findings." + + news_range_of_interest + ) final_output_6, response_object_6 = summarize_with_open_ai( client, MODEL_TYPE, @@ -320,7 +331,8 @@ def main(): # Prompt #7 - AI News prompt7 = ( - "Look for articles from the past month about news related to AI in general." + "Look for articles about news related to AI in general." + + news_range_of_interest ) final_output_7, response_object_7 = summarize_with_open_ai( client, From 5efdb40e4249fe63c4ff036ee7c8c0434c63214c Mon Sep 17 00:00:00 2001 From: Katie Windau Date: Fri, 21 Nov 2025 21:59:07 -0600 Subject: [PATCH 2/2] Add missing space --- .../external_derived/market_intel_bot_v1/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1/query.py b/sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1/query.py index a96ab06cd2d..9d1469a39fe 100644 --- a/sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1/query.py +++ b/sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1/query.py @@ -238,7 +238,7 @@ def main(): "Look for articles about what new features have been added to popular web browsers, " "and how popular browsers are incorporating AI. " f"{news_range_of_interest} " - "Then summarize these findings." + "Then summarize these findings. " "Firefox should be omitted from this search as we are focusing on Firefox's competitors." ) final_output_1, response_object_1 = summarize_with_open_ai(