Add Google Financial News Analysis Prompt generator#39
Conversation
Added `Finance/generate_news_prompt.py` to generate a structured prompt for analyzing financial news based on user input. Added `Finance/test_generate_news_prompt.py` to test the generator script. Co-authored-by: ewdlop <25368970+ewdlop@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
This PR adds a reusable Python script and accompanying tests to generate a standardized Traditional Chinese prompt for Google financial news analysis, aligning with the existing written prompt specification.
Changes:
- Implemented
Finance/generate_news_prompt.pyto render the financial news analysis prompt from a parameterized template and expose a CLI for keyword/time-range/region/focus inputs. - Added
Finance/test_generate_news_prompt.pyto validate prompt content substitution and CLI behavior, including default and explicit argument handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Finance/generate_news_prompt.py | Defines the parameterized Traditional Chinese prompt template and a CLI entrypoint to generate prompts for different keywords, time ranges, regions, and focuses. |
| Finance/test_generate_news_prompt.py | Adds unit tests for direct function usage and CLI execution to ensure correct interpolation of parameters and default values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,113 @@ | |||
| import argparse | |||
| import sys | |||
There was a problem hiding this comment.
The imported sys module is never used in this file; consider removing it to avoid unused-import warnings and keep dependencies minimal.
| import sys |
| # Add parent directory to path to allow importing the script | ||
| sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
|
|
||
| from Finance.generate_news_prompt import generate_prompt, PROMPT_TEMPLATE |
There was a problem hiding this comment.
PROMPT_TEMPLATE is imported but not used in these tests; removing the unused import will keep the test module clean and avoid linter warnings.
| from Finance.generate_news_prompt import generate_prompt, PROMPT_TEMPLATE | |
| from Finance.generate_news_prompt import generate_prompt |
Implemented a Python script to generate a standardized Google Financial News Analysis prompt. The script accepts command-line arguments for keyword, time range, region, and focus, and outputs a structured prompt in Traditional Chinese. This allows for consistent and professional financial news analysis requests to AI models. Also included a unit test suite to verify the script's functionality.
PR created automatically by Jules for task 10113856596980622387 started by @ewdlop