ChillThrills commited on
Commit
638392d
ยท
verified ยท
1 Parent(s): 084ecf2

agent prompt update

Browse files
Files changed (1) hide show
  1. app.py +74 -74
app.py CHANGED
@@ -1786,80 +1786,80 @@ def agent_interface(
1786
  elif WEB_SEARCH_ENABLED and not teams: formatted_search_results = "Web search not performed: Team names were not extracted from your input."
1787
  elif not WEB_SEARCH_ENABLED: formatted_search_results = "Web search feature is disabled."
1788
 
1789
- analysis_prompt_template = (
1790
- "**Analytical Framework:** Hybrid inference system combining:\n"
1791
- "1. Statistical Model (historical performance data)\n"
1792
- "2. Contextual analysis engine (external search results)\n"
1793
- "3. Market efficiency analyzer (odds movement tracking)\n\n"
1794
- "## Input Parameters:\n"
1795
- "* **Match Context:** {match_str}\n"
1796
- "* **Market Odds:** {odds_str} | Implied Probability: {implied_probs_str}\n"
1797
- "* **Statistical Model Prediction:** {prediction_str}\n"
1798
- "* **Statistical Model Probabilities Breakdown:** {probs_str}\n"
1799
- "* **Probability Delta:** {prob_comparison_sentence}\n\n"
1800
- "{formatted_search_results}\n\n"
1801
- "## Pre-processing Instructions:\n"
1802
- "- From Statistical Model Probabilities Breakdown, identify:\n"
1803
- " - `top_outcome`: the single outcome (Home Win, Draw, or Away Win) with the highest probability\n"
1804
- " - `top_prob`: its probability value\n"
1805
- " - `second_outcome`: the single outcome with the second highest probability (must be different from top_outcome; if tie, prioritize based on better market value or arbitrarily)\n"
1806
- " - `second_prob`: its probability value\n"
1807
- "- `top_odds`: market odds for top_outcome from {odds_str}\n"
1808
- "- `second_odds`: market odds for second_outcome from {odds_str}\n"
1809
- "- Calculate `confidence_stars`: โ˜…โ˜†โ˜†โ˜†โ˜† to โ˜…โ˜…โ˜…โ˜…โ˜… based on top_prob (rounded to nearest star, e.g., 40% โ‰ˆ โ˜…โ˜…โ˜†โ˜†โ˜†)\n"
1810
- "- `confidence_range`: [{top_prob:.1f}-5]% to [{top_prob:.1f}+5]%\n"
1811
- "- If no historical odds data: set `line_movement` = 0%\n"
1812
- "- Extract `top_factor`, `secondary_factor`, and weights from external search context\n"
1813
- "- `expiration_time`: 1 hour before match or earlier if breaking news is found\n"
1814
- "- `contextual_summary`: summarize key findings from search results\n"
1815
- "- `contextual_rationale`: summarize contextual reasoning\n"
1816
- "- `weighting_logic`: explain how Statistical Model and Contextual data were combined\n"
1817
- "- `hedging_insight`: explain how to hedge between top_outcome and second_outcome\n"
1818
- "- `preferred_outcome`: top_outcome if contextual supports it stronger; otherwise second_outcome (include brief why)\n\n"
1819
- "## Output Structure Requirements:\n"
1820
- "**CRITICAL FORMATTING RULES:**\n"
1821
- "1. ABSOLUTELY NO SECTION MARKERS (###...###) IN FINAL OUTPUT\n"
1822
- "2. Use ONLY these exact section headers:\n"
1823
- " - **Recommendation**\n"
1824
- " - **Conflict Resolution Analysis**\n"
1825
- " - **Market Efficiency Analysis**\n"
1826
- " - **Risk Analysis**\n"
1827
- " - **Prediction Validity Window**\n"
1828
- "3. Confidence range matches top_prob ยฑ5%\n"
1829
- "4. Dual recommendation contains exactly the top two model outcomes (no more, no less)\n"
1830
- "5. Three key insights in executive summary\n"
1831
- "6. All outcomes in recommendations must be single: Home Win, Draw, or Away Win. Strictly prohibit combined outcomes like 'Aston Villa or Draw (X2)', 'Double Chance', '1X', etc.\n\n"
1832
- "## Mandatory Output Format:\n"
1833
- "**Recommendation**\n"
1834
- "๐Ÿ† DUAL RECOMMENDATION: [top_outcome] @ [top_odds] OR [second_outcome] @ [second_odds] | Confidence: [confidence_stars] ([confidence_range])\n"
1835
- "๐Ÿ” [Key Insight 1] (brief explanation)\n"
1836
- "๐Ÿ” [Key Insight 2] (brief explanation)\n"
1837
- "๐Ÿ” [Key Insight 3] (brief explanation)\n\n"
1838
- "โ–ฎ Recommendation Approach:\n"
1839
- "โšฝ Preferred Outcome: [preferred_outcome] (show why it's stronger)\n\n"
1840
- "**Conflict Resolution Analysis**\n"
1841
- "โ–ฎ Source Discrepancy Breakdown\n"
1842
- "โ–ธ Statistical Model Perspective ({top_prob:.1f}%) - [statistical rationale for top_outcome and second_outcome]\n"
1843
- "โ–ธ External Contextual Analysis - [contextual summary]\n"
1844
- "โ–ธ Resolution Framework - [weighting logic]\n\n"
1845
- "**Market Efficiency Analysis**\n"
1846
- "โ–ธ [Statistical vs implied probability analysis for top two outcomes]\n"
1847
- "โ–ธ [Market pattern recognition]\n\n"
1848
- "**Risk Analysis**\n"
1849
- "โ€ข Statistical Model Uncertainty: [low/med/high] - [reason]\n"
1850
- "โ€ข Context Volatility: [low/med/high] - [reason]\n"
1851
- "โ€ข Market Correlation: [low/med/high] - [hedging insight]\n\n"
1852
- "**Prediction Validity Window**\n"
1853
- "This recommendation is valid until:\n"
1854
- "โ€ข [expiration_time]\n\n"
1855
- "## Validation Checks:\n"
1856
- "BEFORE FINALIZING, VERIFY:\n"
1857
- "1. No section markers present\n"
1858
- "2. All 5 required sections exist with exact headers\n"
1859
- "3. Confidence range matches top_prob ยฑ5%\n"
1860
- "4. Dual recommendation contains exactly two single outcomes\n"
1861
- "5. Three key insights in executive summary\n"
1862
- )
1863
 
1864
  analysis_prompt = analysis_prompt_template.format(
1865
  match_str=match_str,
 
1786
  elif WEB_SEARCH_ENABLED and not teams: formatted_search_results = "Web search not performed: Team names were not extracted from your input."
1787
  elif not WEB_SEARCH_ENABLED: formatted_search_results = "Web search feature is disabled."
1788
 
1789
+ analysis_prompt_template = (
1790
+ "**Analytical Framework:** Hybrid inference system combining:\n"
1791
+ "1. Statistical Model (historical performance data)\n"
1792
+ "2. Contextual analysis engine (external search results)\n"
1793
+ "3. Market efficiency analyzer (odds movement tracking)\n\n"
1794
+ "## Input Parameters:\n"
1795
+ "* **Match Context:** {match_str}\n"
1796
+ "* **Market Odds:** {odds_str} | Implied Probability: {implied_probs_str}\n"
1797
+ "* **Statistical Model Prediction:** {prediction_str}\n"
1798
+ "* **Statistical Model Probabilities Breakdown:** {probs_str}\n"
1799
+ "* **Probability Delta:** {prob_comparison_sentence}\n\n"
1800
+ "{formatted_search_results}\n\n"
1801
+ "## Pre-processing Instructions:\n"
1802
+ "- From Statistical Model Probabilities Breakdown, identify:\n"
1803
+ " - `top_outcome`: the single outcome (Home Win, Draw, or Away Win) with the highest probability\n"
1804
+ " - `top_prob`: its probability value\n"
1805
+ " - `second_outcome`: the single outcome with the second highest probability (must be different from top_outcome; if tie, prioritize based on better market value or arbitrarily)\n"
1806
+ " - `second_prob`: its probability value\n"
1807
+ "- `top_odds`: market odds for top_outcome from {odds_str}\n"
1808
+ "- `second_odds`: market odds for second_outcome from {odds_str}\n"
1809
+ "- Calculate `confidence_stars`: โ˜…โ˜†โ˜†โ˜†โ˜† to โ˜…โ˜…โ˜…โ˜…โ˜… based on top_prob (rounded to nearest star, e.g., 40% โ‰ˆ โ˜…โ˜…โ˜†โ˜†โ˜†)\n"
1810
+ "- `confidence_range`: [{top_prob:.1f}-5]% to [{top_prob:.1f}+5]%\n"
1811
+ "- If no historical odds data: set `line_movement` = 0%\n"
1812
+ "- Extract `top_factor`, `secondary_factor`, and weights from external search context\n"
1813
+ "- `expiration_time`: 1 hour before match or earlier if breaking news is found\n"
1814
+ "- `contextual_summary`: summarize key findings from search results\n"
1815
+ "- `contextual_rationale`: summarize contextual reasoning\n"
1816
+ "- `weighting_logic`: explain how Statistical Model and Contextual data were combined\n"
1817
+ "- `hedging_insight`: explain how to hedge between top_outcome and second_outcome\n"
1818
+ "- `preferred_outcome`: top_outcome if contextual supports it stronger; otherwise second_outcome (include brief why)\n\n"
1819
+ "## Output Structure Requirements:\n"
1820
+ "**CRITICAL FORMATTING RULES:**\n"
1821
+ "1. ABSOLUTELY NO SECTION MARKERS (###...###) IN FINAL OUTPUT\n"
1822
+ "2. Use ONLY these exact section headers:\n"
1823
+ " - **Recommendation**\n"
1824
+ " - **Conflict Resolution Analysis**\n"
1825
+ " - **Market Efficiency Analysis**\n"
1826
+ " - **Risk Analysis**\n"
1827
+ " - **Prediction Validity Window**\n"
1828
+ "3. Confidence range matches top_prob ยฑ5%\n"
1829
+ "4. Dual recommendation contains exactly the top two model outcomes (no more, no less)\n"
1830
+ "5. Three key insights in executive summary\n"
1831
+ "6. All outcomes in recommendations must be single: Home Win, Draw, or Away Win. Strictly prohibit combined outcomes like 'Aston Villa or Draw (X2)', 'Double Chance', '1X', etc.\n\n"
1832
+ "## Mandatory Output Format:\n"
1833
+ "**Recommendation**\n"
1834
+ "๐Ÿ† DUAL RECOMMENDATION: [top_outcome] @ [top_odds] OR [second_outcome] @ [second_odds] | Confidence: [confidence_stars] ([confidence_range])\n"
1835
+ "๐Ÿ” [Key Insight 1] (brief explanation)\n"
1836
+ "๐Ÿ” [Key Insight 2] (brief explanation)\n"
1837
+ "๐Ÿ” [Key Insight 3] (brief explanation)\n\n"
1838
+ "โ–ฎ Recommendation Approach:\n"
1839
+ "โšฝ Preferred Outcome: [preferred_outcome] (show why it's stronger)\n\n"
1840
+ "**Conflict Resolution Analysis**\n"
1841
+ "โ–ฎ Source Discrepancy Breakdown\n"
1842
+ "โ–ธ Statistical Model Perspective ({top_prob:.1f}%) - [statistical rationale for top_outcome and second_outcome]\n"
1843
+ "โ–ธ External Contextual Analysis - [contextual summary]\n"
1844
+ "โ–ธ Resolution Framework - [weighting logic]\n\n"
1845
+ "**Market Efficiency Analysis**\n"
1846
+ "โ–ธ [Statistical vs implied probability analysis for top two outcomes]\n"
1847
+ "โ–ธ [Market pattern recognition]\n\n"
1848
+ "**Risk Analysis**\n"
1849
+ "โ€ข Statistical Model Uncertainty: [low/med/high] - [reason]\n"
1850
+ "โ€ข Context Volatility: [low/med/high] - [reason]\n"
1851
+ "โ€ข Market Correlation: [low/med/high] - [hedging insight]\n\n"
1852
+ "**Prediction Validity Window**\n"
1853
+ "This recommendation is valid until:\n"
1854
+ "โ€ข [expiration_time]\n\n"
1855
+ "## Validation Checks:\n"
1856
+ "BEFORE FINALIZING, VERIFY:\n"
1857
+ "1. No section markers present\n"
1858
+ "2. All 5 required sections exist with exact headers\n"
1859
+ "3. Confidence range matches top_prob ยฑ5%\n"
1860
+ "4. Dual recommendation contains exactly two single outcomes\n"
1861
+ "5. Three key insights in executive summary\n"
1862
+ )
1863
 
1864
  analysis_prompt = analysis_prompt_template.format(
1865
  match_str=match_str,