no readme system prompt
Browse files
app.py
CHANGED
|
@@ -459,6 +459,12 @@ When creating complex Gradio applications, organize your code into multiple file
|
|
| 459 |
- `requirements.txt` - Python dependencies
|
| 460 |
- Additional modules as needed (e.g., `data_processing.py`, `ui_components.py`)
|
| 461 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 462 |
**Output Format for Multi-File Apps:**
|
| 463 |
When generating multi-file applications, use this exact format:
|
| 464 |
|
|
@@ -902,6 +908,12 @@ When creating complex Gradio applications, organize your code into multiple file
|
|
| 902 |
- `requirements.txt` - Python dependencies
|
| 903 |
- Additional modules as needed (e.g., `data_processing.py`, `ui_components.py`)
|
| 904 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 905 |
**Output Format for Multi-File Apps:**
|
| 906 |
When generating multi-file applications, use this exact format:
|
| 907 |
|
|
@@ -1475,6 +1487,11 @@ def initialize_fastrtc_docs():
|
|
| 1475 |
# Configuration
|
| 1476 |
HTML_SYSTEM_PROMPT = """ONLY USE HTML, CSS AND JAVASCRIPT. If you want to use ICON make sure to import the library first. Try to create the best UI possible by using only HTML, CSS and JAVASCRIPT. MAKE IT RESPONSIVE USING MODERN CSS. Use as much as you can modern CSS for the styling, if you can't do something with modern CSS, then use custom CSS. Also, try to elaborate as much as you can, to create something unique. ALWAYS GIVE THE RESPONSE INTO A SINGLE HTML FILE
|
| 1477 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1478 |
If an image is provided, analyze it and use the visual information to better understand the user's requirements.
|
| 1479 |
|
| 1480 |
Always respond with code that can be executed or rendered directly.
|
|
@@ -1519,6 +1536,11 @@ def validate_video_html(video_html: str) -> bool:
|
|
| 1519 |
# Stricter prompt for GLM-4.5V to ensure a complete, runnable HTML document with no escaped characters
|
| 1520 |
GLM45V_HTML_SYSTEM_PROMPT = """You are an expert front-end developer.
|
| 1521 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1522 |
Output a COMPLETE, STANDALONE HTML document that renders directly in a browser.
|
| 1523 |
|
| 1524 |
Hard constraints:
|
|
@@ -1652,6 +1674,11 @@ def reap_old_audio(ttl_seconds: int = AUDIO_FILE_TTL_SECONDS) -> None:
|
|
| 1652 |
|
| 1653 |
TRANSFORMERS_JS_SYSTEM_PROMPT = """You are an expert web developer creating a transformers.js application. You will generate THREE separate files: index.html, index.js, and style.css.
|
| 1654 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1655 |
IMPORTANT: You MUST output ALL THREE files in the following format:
|
| 1656 |
|
| 1657 |
```html
|
|
@@ -1709,6 +1736,12 @@ When creating complex Streamlit applications, organize your code into multiple f
|
|
| 1709 |
- `pages/` - Additional pages for multi-page apps
|
| 1710 |
- Additional modules as needed (e.g., `data_processing.py`, `components.py`)
|
| 1711 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1712 |
**Output Format for Multi-File Apps:**
|
| 1713 |
When generating multi-file applications, use this exact format:
|
| 1714 |
|
|
@@ -1777,6 +1810,11 @@ IMPORTANT: Always include "Built with anycoder" as clickable text in the header/
|
|
| 1777 |
|
| 1778 |
SVELTE_SYSTEM_PROMPT = """You are an expert Svelte developer creating a modern Svelte application.
|
| 1779 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1780 |
File selection policy (dynamic, model-decided):
|
| 1781 |
- Generate ONLY the files actually needed for the user's request.
|
| 1782 |
- MUST include src/App.svelte (entry component) and src/main.ts (entry point).
|
|
@@ -1842,12 +1880,22 @@ JSON_SYSTEM_PROMPT_WITH_SEARCH = ""
|
|
| 1842 |
|
| 1843 |
GENERIC_SYSTEM_PROMPT = """You are an expert {language} developer. Write clean, idiomatic, and runnable {language} code for the user's request. If possible, include comments and best practices. Generate complete, working code that can be run immediately. If the user provides a file or other context, use it as a reference. If the code is for a script or app, make it as self-contained as possible.
|
| 1844 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1845 |
IMPORTANT: Always include "Built with anycoder" as clickable text in the header/top section of your application that links to https://huggingface.co/spaces/akhaliq/anycoder"""
|
| 1846 |
|
| 1847 |
|
| 1848 |
# Multi-page static HTML project prompt (generic, production-style structure)
|
| 1849 |
MULTIPAGE_HTML_SYSTEM_PROMPT = """You are an expert front-end developer.
|
| 1850 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1851 |
Create a production-ready MULTI-PAGE website using ONLY HTML, CSS, and vanilla JavaScript. Do NOT use SPA frameworks.
|
| 1852 |
|
| 1853 |
Output MUST be a multi-file project with at least:
|
|
@@ -1888,6 +1936,11 @@ IMPORTANT: Always include "Built with anycoder" as clickable text in the header/
|
|
| 1888 |
# Dynamic multi-page (model decides files) prompts
|
| 1889 |
DYNAMIC_MULTIPAGE_HTML_SYSTEM_PROMPT = """You are an expert front-end developer.
|
| 1890 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1891 |
Create a production-ready website using ONLY HTML, CSS, and vanilla JavaScript. Do NOT use SPA frameworks.
|
| 1892 |
|
| 1893 |
File selection policy:
|
|
@@ -1940,6 +1993,11 @@ For Python applications (Gradio/Streamlit), the project structure typically incl
|
|
| 1940 |
- pages/ (for multi-page Streamlit apps)
|
| 1941 |
- Other supporting files as needed
|
| 1942 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1943 |
For multi-file projects, identify which specific file needs modification based on the user's request:
|
| 1944 |
- Main application logic β app.py or streamlit_app.py
|
| 1945 |
- Helper functions β utils.py
|
|
@@ -2031,11 +2089,13 @@ You MUST use this exact format with file separators. DO NOT deviate from this fo
|
|
| 2031 |
- Each file section must be complete and standalone
|
| 2032 |
- The format MUST match the original multi-file structure exactly
|
| 2033 |
|
| 2034 |
-
**π¨ CRITICAL: DO NOT GENERATE requirements.txt**
|
| 2035 |
- requirements.txt is automatically generated from your app.py imports
|
| 2036 |
-
-
|
|
|
|
| 2037 |
- The system will automatically extract imports from app.py and generate requirements.txt
|
| 2038 |
-
-
|
|
|
|
| 2039 |
|
| 2040 |
**IF User Specifically Asks to Modify requirements.txt:**
|
| 2041 |
- Output ONLY plain text package names, one per line
|
|
@@ -2102,6 +2162,11 @@ IMPORTANT: When the user reports an ERROR MESSAGE, analyze it carefully to deter
|
|
| 2102 |
The transformers.js application consists of three files: index.html, index.js, and style.css.
|
| 2103 |
When making changes, specify which file you're modifying by starting your search/replace blocks with the file name.
|
| 2104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2105 |
Format Rules:
|
| 2106 |
1. Start with {SEARCH_START}
|
| 2107 |
2. Provide the exact lines from the current code that need to be replaced.
|
|
|
|
| 459 |
- `requirements.txt` - Python dependencies
|
| 460 |
- Additional modules as needed (e.g., `data_processing.py`, `ui_components.py`)
|
| 461 |
|
| 462 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 463 |
+
- NEVER generate README.md files under any circumstances
|
| 464 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 465 |
+
- Generating a README.md will break the deployment process
|
| 466 |
+
- Only generate the code files listed above
|
| 467 |
+
|
| 468 |
**Output Format for Multi-File Apps:**
|
| 469 |
When generating multi-file applications, use this exact format:
|
| 470 |
|
|
|
|
| 908 |
- `requirements.txt` - Python dependencies
|
| 909 |
- Additional modules as needed (e.g., `data_processing.py`, `ui_components.py`)
|
| 910 |
|
| 911 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 912 |
+
- NEVER generate README.md files under any circumstances
|
| 913 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 914 |
+
- Generating a README.md will break the deployment process
|
| 915 |
+
- Only generate the code files listed above
|
| 916 |
+
|
| 917 |
**Output Format for Multi-File Apps:**
|
| 918 |
When generating multi-file applications, use this exact format:
|
| 919 |
|
|
|
|
| 1487 |
# Configuration
|
| 1488 |
HTML_SYSTEM_PROMPT = """ONLY USE HTML, CSS AND JAVASCRIPT. If you want to use ICON make sure to import the library first. Try to create the best UI possible by using only HTML, CSS and JAVASCRIPT. MAKE IT RESPONSIVE USING MODERN CSS. Use as much as you can modern CSS for the styling, if you can't do something with modern CSS, then use custom CSS. Also, try to elaborate as much as you can, to create something unique. ALWAYS GIVE THE RESPONSE INTO A SINGLE HTML FILE
|
| 1489 |
|
| 1490 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 1491 |
+
- NEVER generate README.md files under any circumstances
|
| 1492 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 1493 |
+
- Generating a README.md will break the deployment process
|
| 1494 |
+
|
| 1495 |
If an image is provided, analyze it and use the visual information to better understand the user's requirements.
|
| 1496 |
|
| 1497 |
Always respond with code that can be executed or rendered directly.
|
|
|
|
| 1536 |
# Stricter prompt for GLM-4.5V to ensure a complete, runnable HTML document with no escaped characters
|
| 1537 |
GLM45V_HTML_SYSTEM_PROMPT = """You are an expert front-end developer.
|
| 1538 |
|
| 1539 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 1540 |
+
- NEVER generate README.md files under any circumstances
|
| 1541 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 1542 |
+
- Generating a README.md will break the deployment process
|
| 1543 |
+
|
| 1544 |
Output a COMPLETE, STANDALONE HTML document that renders directly in a browser.
|
| 1545 |
|
| 1546 |
Hard constraints:
|
|
|
|
| 1674 |
|
| 1675 |
TRANSFORMERS_JS_SYSTEM_PROMPT = """You are an expert web developer creating a transformers.js application. You will generate THREE separate files: index.html, index.js, and style.css.
|
| 1676 |
|
| 1677 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 1678 |
+
- NEVER generate README.md files under any circumstances
|
| 1679 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 1680 |
+
- Generating a README.md will break the deployment process
|
| 1681 |
+
|
| 1682 |
IMPORTANT: You MUST output ALL THREE files in the following format:
|
| 1683 |
|
| 1684 |
```html
|
|
|
|
| 1736 |
- `pages/` - Additional pages for multi-page apps
|
| 1737 |
- Additional modules as needed (e.g., `data_processing.py`, `components.py`)
|
| 1738 |
|
| 1739 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 1740 |
+
- NEVER generate README.md files under any circumstances
|
| 1741 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 1742 |
+
- Generating a README.md will break the deployment process
|
| 1743 |
+
- Only generate the code files listed above
|
| 1744 |
+
|
| 1745 |
**Output Format for Multi-File Apps:**
|
| 1746 |
When generating multi-file applications, use this exact format:
|
| 1747 |
|
|
|
|
| 1810 |
|
| 1811 |
SVELTE_SYSTEM_PROMPT = """You are an expert Svelte developer creating a modern Svelte application.
|
| 1812 |
|
| 1813 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 1814 |
+
- NEVER generate README.md files under any circumstances
|
| 1815 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 1816 |
+
- Generating a README.md will break the deployment process
|
| 1817 |
+
|
| 1818 |
File selection policy (dynamic, model-decided):
|
| 1819 |
- Generate ONLY the files actually needed for the user's request.
|
| 1820 |
- MUST include src/App.svelte (entry component) and src/main.ts (entry point).
|
|
|
|
| 1880 |
|
| 1881 |
GENERIC_SYSTEM_PROMPT = """You are an expert {language} developer. Write clean, idiomatic, and runnable {language} code for the user's request. If possible, include comments and best practices. Generate complete, working code that can be run immediately. If the user provides a file or other context, use it as a reference. If the code is for a script or app, make it as self-contained as possible.
|
| 1882 |
|
| 1883 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 1884 |
+
- NEVER generate README.md files under any circumstances
|
| 1885 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 1886 |
+
- Generating a README.md will break the deployment process
|
| 1887 |
+
|
| 1888 |
IMPORTANT: Always include "Built with anycoder" as clickable text in the header/top section of your application that links to https://huggingface.co/spaces/akhaliq/anycoder"""
|
| 1889 |
|
| 1890 |
|
| 1891 |
# Multi-page static HTML project prompt (generic, production-style structure)
|
| 1892 |
MULTIPAGE_HTML_SYSTEM_PROMPT = """You are an expert front-end developer.
|
| 1893 |
|
| 1894 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 1895 |
+
- NEVER generate README.md files under any circumstances
|
| 1896 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 1897 |
+
- Generating a README.md will break the deployment process
|
| 1898 |
+
|
| 1899 |
Create a production-ready MULTI-PAGE website using ONLY HTML, CSS, and vanilla JavaScript. Do NOT use SPA frameworks.
|
| 1900 |
|
| 1901 |
Output MUST be a multi-file project with at least:
|
|
|
|
| 1936 |
# Dynamic multi-page (model decides files) prompts
|
| 1937 |
DYNAMIC_MULTIPAGE_HTML_SYSTEM_PROMPT = """You are an expert front-end developer.
|
| 1938 |
|
| 1939 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 1940 |
+
- NEVER generate README.md files under any circumstances
|
| 1941 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 1942 |
+
- Generating a README.md will break the deployment process
|
| 1943 |
+
|
| 1944 |
Create a production-ready website using ONLY HTML, CSS, and vanilla JavaScript. Do NOT use SPA frameworks.
|
| 1945 |
|
| 1946 |
File selection policy:
|
|
|
|
| 1993 |
- pages/ (for multi-page Streamlit apps)
|
| 1994 |
- Other supporting files as needed
|
| 1995 |
|
| 1996 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 1997 |
+
- NEVER generate README.md files under any circumstances
|
| 1998 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 1999 |
+
- Generating a README.md will break the deployment process
|
| 2000 |
+
|
| 2001 |
For multi-file projects, identify which specific file needs modification based on the user's request:
|
| 2002 |
- Main application logic β app.py or streamlit_app.py
|
| 2003 |
- Helper functions β utils.py
|
|
|
|
| 2089 |
- Each file section must be complete and standalone
|
| 2090 |
- The format MUST match the original multi-file structure exactly
|
| 2091 |
|
| 2092 |
+
**π¨ CRITICAL: DO NOT GENERATE requirements.txt or README.md**
|
| 2093 |
- requirements.txt is automatically generated from your app.py imports
|
| 2094 |
+
- README.md is automatically provided by the template
|
| 2095 |
+
- Do NOT include requirements.txt or README.md in your output unless the user specifically asks to modify them
|
| 2096 |
- The system will automatically extract imports from app.py and generate requirements.txt
|
| 2097 |
+
- Generating a README.md will break the deployment process
|
| 2098 |
+
- This prevents unnecessary changes to dependencies and documentation
|
| 2099 |
|
| 2100 |
**IF User Specifically Asks to Modify requirements.txt:**
|
| 2101 |
- Output ONLY plain text package names, one per line
|
|
|
|
| 2162 |
The transformers.js application consists of three files: index.html, index.js, and style.css.
|
| 2163 |
When making changes, specify which file you're modifying by starting your search/replace blocks with the file name.
|
| 2164 |
|
| 2165 |
+
**π¨ CRITICAL: DO NOT Generate README.md Files**
|
| 2166 |
+
- NEVER generate README.md files under any circumstances
|
| 2167 |
+
- A template README.md is automatically provided and will be overridden by the deployment system
|
| 2168 |
+
- Generating a README.md will break the deployment process
|
| 2169 |
+
|
| 2170 |
Format Rules:
|
| 2171 |
1. Start with {SEARCH_START}
|
| 2172 |
2. Provide the exact lines from the current code that need to be replaced.
|