Spaces:
Running
Running
prompt update
Browse files
app.py
CHANGED
|
@@ -1787,79 +1787,95 @@ def agent_interface(
|
|
| 1787 |
elif not WEB_SEARCH_ENABLED: formatted_search_results = "Web search feature is disabled."
|
| 1788 |
|
| 1789 |
analysis_prompt_template = (
|
| 1790 |
-
|
| 1791 |
-
|
| 1792 |
-
|
| 1793 |
-
|
| 1794 |
-
|
| 1795 |
-
|
| 1796 |
-
|
| 1797 |
-
|
| 1798 |
-
|
| 1799 |
-
|
| 1800 |
-
|
| 1801 |
-
|
| 1802 |
-
|
| 1803 |
-
|
| 1804 |
-
|
| 1805 |
-
|
| 1806 |
-
|
| 1807 |
-
|
| 1808 |
-
|
| 1809 |
-
|
| 1810 |
-
|
| 1811 |
-
|
| 1812 |
-
|
| 1813 |
-
|
| 1814 |
-
|
| 1815 |
-
|
| 1816 |
-
|
| 1817 |
-
|
| 1818 |
-
|
| 1819 |
-
|
| 1820 |
-
|
| 1821 |
-
|
| 1822 |
-
|
| 1823 |
-
|
| 1824 |
-
|
| 1825 |
-
|
| 1826 |
-
|
| 1827 |
-
|
| 1828 |
-
|
| 1829 |
-
|
| 1830 |
-
|
| 1831 |
-
|
| 1832 |
-
|
| 1833 |
-
|
| 1834 |
-
|
| 1835 |
-
|
| 1836 |
-
|
| 1837 |
-
|
| 1838 |
-
|
| 1839 |
-
|
| 1840 |
-
|
| 1841 |
-
|
| 1842 |
-
|
| 1843 |
-
|
| 1844 |
-
|
| 1845 |
-
|
| 1846 |
-
|
| 1847 |
-
|
| 1848 |
-
|
| 1849 |
-
|
| 1850 |
-
|
| 1851 |
-
|
| 1852 |
-
|
| 1853 |
-
|
| 1854 |
-
|
| 1855 |
-
|
| 1856 |
-
|
| 1857 |
-
|
| 1858 |
-
|
| 1859 |
-
|
| 1860 |
-
|
| 1861 |
-
|
| 1862 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1863 |
|
| 1864 |
analysis_prompt = analysis_prompt_template.format(
|
| 1865 |
match_str=match_str,
|
|
|
|
| 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 |
+
|
| 1795 |
+
"## Input Parameters:\n"
|
| 1796 |
+
"* **Match Context:** {match_str}\n"
|
| 1797 |
+
"* **Market Odds:** {odds_str} | Implied Probability: {implied_probs_str}\n"
|
| 1798 |
+
"* **Statistical Model Prediction:** {prediction_str}\n"
|
| 1799 |
+
"* **Statistical Model Probabilities Breakdown:** {probs_str}\n"
|
| 1800 |
+
"* **Probability Delta:** {prob_comparison_sentence}\n\n"
|
| 1801 |
+
|
| 1802 |
+
"{formatted_search_results}\n\n"
|
| 1803 |
+
|
| 1804 |
+
"## STRICT PRE-PROCESSING INSTRUCTIONS:\n"
|
| 1805 |
+
"1. **OUTCOME SELECTION CRITERIA (MUST FOLLOW):**\n"
|
| 1806 |
+
" - Extract the TOP 2 SINGLE OUTCOMES from the combined analysis\n"
|
| 1807 |
+
" - Combine probabilities from: Statistical Model ({model_conf_pct:.1f}%) + Contextual weighting\n"
|
| 1808 |
+
" - Select the TWO highest probability SINGLE outcomes (Home Win, Draw, or Away Win ONLY)\n"
|
| 1809 |
+
" - **ABSOLUTELY NO DOUBLE CHANCE OUTCOMES (X2, 1X, 12)**\n"
|
| 1810 |
+
" - **ABSOLUTELY NO COMBINED OUTCOMES**\n"
|
| 1811 |
+
" - If Statistical Model and Contextual Analysis agree, still output 2 distinct single outcomes\n"
|
| 1812 |
+
"\n"
|
| 1813 |
+
"2. **Calculate `confidence_stars`:** โ
โโโโ to โ
โ
โ
โ
โ
based on Statistical Model confidence (rounded)\n"
|
| 1814 |
+
"3. **`confidence_range`:** [{model_conf_pct:.1f}-5]% to [{model_conf_pct:.1f}+5]%\n"
|
| 1815 |
+
"4. **If no historical odds:** set `line_movement` = 0%\n"
|
| 1816 |
+
"5. **`expiration_time`:** 1 hour before match or earlier if breaking news\n"
|
| 1817 |
+
"6. **`contextual_summary`:** summarize key findings from search results\n"
|
| 1818 |
+
"7. **`weighting_logic`:** explain how Statistical Model and Contextual data were combined\n"
|
| 1819 |
+
"\n"
|
| 1820 |
+
"## OUTPUT STRUCTURE REQUIREMENTS (CRITICAL):\n"
|
| 1821 |
+
"**FORMAT RULES (NON-NEGOTIABLE):**\n"
|
| 1822 |
+
"1. ABSOLUTELY NO SECTION MARKERS (###...###) IN FINAL OUTPUT\n"
|
| 1823 |
+
"2. Use ONLY these exact section headers:\n"
|
| 1824 |
+
" - **Recommendation**\n"
|
| 1825 |
+
" - **Conflict Resolution Analysis**\n"
|
| 1826 |
+
" - **Market Efficiency Analysis**\n"
|
| 1827 |
+
" - **Risk Analysis**\n"
|
| 1828 |
+
" - **Prediction Validity Window**\n"
|
| 1829 |
+
"\n"
|
| 1830 |
+
"## MANDATORY OUTPUT FORMAT:\n"
|
| 1831 |
+
"**Recommendation**\n"
|
| 1832 |
+
"๐ DUAL RECOMMENDATION: [Outcome 1] @ [Market Odds for Outcome 1] OR [Outcome 2] @ [Market Odds for Outcome 2] | Confidence: [โ
โ
โ
โโ] ([55% to 65%])\n"
|
| 1833 |
+
"**MUST BE ONLY 2 SINGLE OUTCOMES FROM: Home Win, Draw, Away Win**\n"
|
| 1834 |
+
"๐ [Key Insight 1] (brief explanation)\n"
|
| 1835 |
+
"๐ [Key Insight 2] (brief explanation)\n"
|
| 1836 |
+
"๐ [Key Insight 3] (brief explanation)\n"
|
| 1837 |
+
"\n"
|
| 1838 |
+
"โฎ Recommendation Approach:\n"
|
| 1839 |
+
"โฝ Preferred Outcome: [Either Outcome 1 or Outcome 2, whichever has stronger support] (show why it's stronger)\n"
|
| 1840 |
+
"\n"
|
| 1841 |
+
"**Conflict Resolution Analysis**\n"
|
| 1842 |
+
"โฎ Source Discrepancy Breakdown\n"
|
| 1843 |
+
"โธ Statistical Model Perspective ({model_conf_pct:.1f}%) - [statistical rationale for top 2 outcomes]\n"
|
| 1844 |
+
"๏ฟฝ๏ฟฝ External Contextual Analysis - [contextual summary supporting the 2 outcomes]\n"
|
| 1845 |
+
"โธ Resolution Framework - [weighting logic explaining why THESE 2 outcomes were selected]\n"
|
| 1846 |
+
"\n"
|
| 1847 |
+
"**Market Efficiency Analysis**\n"
|
| 1848 |
+
"โธ [Statistical vs implied probability analysis for the 2 selected outcomes]\n"
|
| 1849 |
+
"โธ [Market pattern recognition specifically for these outcomes]\n"
|
| 1850 |
+
"\n"
|
| 1851 |
+
"**Risk Analysis**\n"
|
| 1852 |
+
"โข Statistical Model Uncertainty: [low/med/high] - [reason specific to the 2 outcomes]\n"
|
| 1853 |
+
"โข Context Volatility: [low/med/high] - [reason specific to the 2 outcomes]\n"
|
| 1854 |
+
"โข Market Correlation: [low/med/high] - [hedging insight between the 2 outcomes]\n"
|
| 1855 |
+
"\n"
|
| 1856 |
+
"**Prediction Validity Window**\n"
|
| 1857 |
+
"This recommendation is valid until:\n"
|
| 1858 |
+
"โข [Expiration time]\n"
|
| 1859 |
+
"\n"
|
| 1860 |
+
"## VALIDATION CHECKS (CRITICAL):\n"
|
| 1861 |
+
"BEFORE FINALIZING OUTPUT, VERIFY ALL:\n"
|
| 1862 |
+
"1. โ
DUAL RECOMMENDATION contains EXACTLY 2 SINGLE OUTCOMES (no double chance)\n"
|
| 1863 |
+
"2. โ
Outcomes are from: Home Win, Draw, OR Away Win ONLY\n"
|
| 1864 |
+
"3. โ
No section markers present\n"
|
| 1865 |
+
"4. โ
All 5 required sections exist with exact headers\n"
|
| 1866 |
+
"5. โ
Confidence range matches model confidence ยฑ5%\n"
|
| 1867 |
+
"6. โ
Three key insights in executive summary\n"
|
| 1868 |
+
"7. โ
Market odds correspond to the correct selected outcomes\n"
|
| 1869 |
+
"\n"
|
| 1870 |
+
"## EXAMPLE OF CORRECT FORMAT:\n"
|
| 1871 |
+
"**Recommendation**\n"
|
| 1872 |
+
"๐ DUAL RECOMMENDATION: Home Win @ 2.10 OR Draw @ 3.50 | Confidence: โ
โ
โ
โโ (45% to 55%)\n"
|
| 1873 |
+
"(NOT: Home Win @ 2.10 OR Away Win or Draw @ 1.75 โ THIS IS WRONG)\n"
|
| 1874 |
+
"(NOT: Home Win @ 2.10 OR Draw @ 3.50 OR Away Win @ 3.80 โ THIS IS WRONG)\n"
|
| 1875 |
+
"๐ Insight 1...\n"
|
| 1876 |
+
"๐ Insight 2...\n"
|
| 1877 |
+
"๐ Insight 3...\n"
|
| 1878 |
+
)
|
| 1879 |
|
| 1880 |
analysis_prompt = analysis_prompt_template.format(
|
| 1881 |
match_str=match_str,
|