Spaces:
Running
Running
fix system prompt
Browse files
app.py
CHANGED
|
@@ -185,7 +185,7 @@ def update_gradio_system_prompts():
|
|
| 185 |
docs_content = get_gradio_docs_content()
|
| 186 |
|
| 187 |
# Base system prompt
|
| 188 |
-
base_prompt = """You are an expert Gradio developer. Write clean, idiomatic, and runnable Gradio applications for the user's request. Use the latest Gradio API and best practices.
|
| 189 |
|
| 190 |
π¨ IMPORTANT: If the user is asking to use external APIs (like OpenRouter, OpenAI API, Hugging Face Inference API, etc.), DO NOT use @spaces.GPU decorators or any ZeroGPU features. External APIs handle the model inference remotely, so GPU allocation on the Spaces instance is not needed.
|
| 191 |
|
|
@@ -454,7 +454,7 @@ This reference is automatically synced from https://www.gradio.app/llms.txt to e
|
|
| 454 |
"""
|
| 455 |
|
| 456 |
# Search-enabled prompt
|
| 457 |
-
search_prompt = """You are an expert Gradio developer with access to real-time web search. Write clean, idiomatic, and runnable Gradio applications for the user's request. Use the latest Gradio API and best practices. When needed, use web search to find current best practices or verify latest Gradio features.
|
| 458 |
|
| 459 |
π¨ IMPORTANT: If the user is asking to use external APIs (like OpenRouter, OpenAI API, Hugging Face Inference API, etc.), DO NOT use @spaces.GPU decorators or any ZeroGPU features. External APIs handle the model inference remotely, so GPU allocation on the Spaces instance is not needed.
|
| 460 |
|
|
@@ -760,7 +760,7 @@ If an image is provided, analyze it and use the visual information to better und
|
|
| 760 |
|
| 761 |
Always respond with code that can be executed or rendered directly.
|
| 762 |
|
| 763 |
-
|
| 764 |
|
| 765 |
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"""
|
| 766 |
|
|
@@ -1031,7 +1031,7 @@ The index.html should contain the basic HTML structure and link to the CSS and J
|
|
| 1031 |
The index.js should contain all the JavaScript logic including transformers.js integration.
|
| 1032 |
The style.css should contain all the styling for the application.
|
| 1033 |
|
| 1034 |
-
|
| 1035 |
|
| 1036 |
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"""
|
| 1037 |
|
|
@@ -1178,7 +1178,7 @@ The index.html should contain the basic HTML structure and link to the CSS and J
|
|
| 1178 |
The index.js should contain all the JavaScript logic including transformers.js integration.
|
| 1179 |
The style.css should contain all the styling for the application.
|
| 1180 |
|
| 1181 |
-
|
| 1182 |
|
| 1183 |
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"""
|
| 1184 |
|
|
@@ -1190,7 +1190,7 @@ GRADIO_SYSTEM_PROMPT_WITH_SEARCH = ""
|
|
| 1190 |
|
| 1191 |
# All Gradio API documentation is now dynamically loaded from https://www.gradio.app/llms.txt
|
| 1192 |
|
| 1193 |
-
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.
|
| 1194 |
|
| 1195 |
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"""
|
| 1196 |
|
|
@@ -1222,7 +1222,7 @@ If an image is provided, analyze it and use the visual information to better und
|
|
| 1222 |
|
| 1223 |
Always respond with code that can be executed or rendered directly.
|
| 1224 |
|
| 1225 |
-
|
| 1226 |
|
| 1227 |
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"""
|
| 1228 |
|
|
@@ -1323,7 +1323,7 @@ IMPORTANT: Always include "Built with anycoder" as clickable text in the header/
|
|
| 1323 |
|
| 1324 |
GENERIC_SYSTEM_PROMPT_WITH_SEARCH = """You are an expert {language} developer. You have access to real-time web search. When needed, use web search to find the latest information, best practices, or specific technologies for {language}.
|
| 1325 |
|
| 1326 |
-
Write clean, idiomatic, and runnable {language} code for the user's request. If possible, include comments and best practices.
|
| 1327 |
|
| 1328 |
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"""
|
| 1329 |
|
|
|
|
| 185 |
docs_content = get_gradio_docs_content()
|
| 186 |
|
| 187 |
# Base system prompt
|
| 188 |
+
base_prompt = """You are an expert Gradio developer. Write clean, idiomatic, and runnable Gradio applications for the user's request. Use the latest Gradio API 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. Make the app as self-contained as possible.
|
| 189 |
|
| 190 |
π¨ IMPORTANT: If the user is asking to use external APIs (like OpenRouter, OpenAI API, Hugging Face Inference API, etc.), DO NOT use @spaces.GPU decorators or any ZeroGPU features. External APIs handle the model inference remotely, so GPU allocation on the Spaces instance is not needed.
|
| 191 |
|
|
|
|
| 454 |
"""
|
| 455 |
|
| 456 |
# Search-enabled prompt
|
| 457 |
+
search_prompt = """You are an expert Gradio developer with access to real-time web search. Write clean, idiomatic, and runnable Gradio applications for the user's request. Use the latest Gradio API and best practices. When needed, use web search to find current best practices or verify latest Gradio features. Generate complete, working code that can be run immediately. If the user provides a file or other context, use it as a reference. Make the app as self-contained as possible.
|
| 458 |
|
| 459 |
π¨ IMPORTANT: If the user is asking to use external APIs (like OpenRouter, OpenAI API, Hugging Face Inference API, etc.), DO NOT use @spaces.GPU decorators or any ZeroGPU features. External APIs handle the model inference remotely, so GPU allocation on the Spaces instance is not needed.
|
| 460 |
|
|
|
|
| 760 |
|
| 761 |
Always respond with code that can be executed or rendered directly.
|
| 762 |
|
| 763 |
+
Generate complete, working HTML code that can be run immediately.
|
| 764 |
|
| 765 |
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"""
|
| 766 |
|
|
|
|
| 1031 |
The index.js should contain all the JavaScript logic including transformers.js integration.
|
| 1032 |
The style.css should contain all the styling for the application.
|
| 1033 |
|
| 1034 |
+
Generate complete, working code files as shown above.
|
| 1035 |
|
| 1036 |
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"""
|
| 1037 |
|
|
|
|
| 1178 |
The index.js should contain all the JavaScript logic including transformers.js integration.
|
| 1179 |
The style.css should contain all the styling for the application.
|
| 1180 |
|
| 1181 |
+
Generate complete, working code files as shown above.
|
| 1182 |
|
| 1183 |
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"""
|
| 1184 |
|
|
|
|
| 1190 |
|
| 1191 |
# All Gradio API documentation is now dynamically loaded from https://www.gradio.app/llms.txt
|
| 1192 |
|
| 1193 |
+
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.
|
| 1194 |
|
| 1195 |
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"""
|
| 1196 |
|
|
|
|
| 1222 |
|
| 1223 |
Always respond with code that can be executed or rendered directly.
|
| 1224 |
|
| 1225 |
+
Generate complete, working HTML code that can be run immediately.
|
| 1226 |
|
| 1227 |
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"""
|
| 1228 |
|
|
|
|
| 1323 |
|
| 1324 |
GENERIC_SYSTEM_PROMPT_WITH_SEARCH = """You are an expert {language} developer. You have access to real-time web search. When needed, use web search to find the latest information, best practices, or specific technologies for {language}.
|
| 1325 |
|
| 1326 |
+
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.
|
| 1327 |
|
| 1328 |
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"""
|
| 1329 |
|