Update config.py
Browse files
config.py
CHANGED
@@ -1,45 +1,29 @@
|
|
1 |
# /config.py
|
|
|
2 |
|
3 |
-
"""
|
4 |
-
Centralized configuration for the AnyCoder application.
|
5 |
-
"""
|
6 |
from typing import List, Dict, Union
|
7 |
|
8 |
-
# ---
|
9 |
-
HTML_SYSTEM_PROMPT = """..."""
|
10 |
-
GENERIC_SYSTEM_PROMPT = """..."""
|
11 |
-
HTML_SYSTEM_PROMPT_WITH_SEARCH = """..."""
|
12 |
-
GENERIC_SYSTEM_PROMPT_WITH_SEARCH = """..."""
|
13 |
-
FOLLOW_UP_SYSTEM_PROMPT = """..."""
|
14 |
-
|
15 |
-
# --- Search/Replace Constants --- (No changes needed)
|
16 |
SEARCH_START = "<<<<<<< SEARCH"
|
17 |
DIVIDER = "======="
|
18 |
REPLACE_END = ">>>>>>> REPLACE"
|
19 |
|
20 |
-
# ---
|
|
|
|
|
|
|
|
|
|
|
21 |
|
|
|
22 |
AVAILABLE_MODELS: List[Dict[str, str]] = [
|
23 |
-
# --- OpenAI Models ---
|
24 |
{"name": "OpenAI GPT-4o", "id": "openai/gpt-4o"},
|
25 |
{"name": "OpenAI GPT-4 Turbo", "id": "openai/gpt-4-turbo"},
|
26 |
-
|
27 |
-
# --- Groq Models (Fastest) ---
|
28 |
{"name": "Groq Llama3 70b", "id": "groq/llama3-70b-8192"},
|
29 |
-
{"name": "Groq Llama3 8b", "id": "groq/llama3-8b-8192"},
|
30 |
{"name": "Groq Mixtral 8x7b", "id": "groq/mixtral-8x7b-32768"},
|
31 |
-
|
32 |
-
# --- Google Gemini Models ---
|
33 |
{"name": "Google Gemini 1.5 Pro", "id": "gemini/gemini-1.5-pro-latest"},
|
34 |
-
|
35 |
-
# --- DeepSeek Models (Direct API) ---
|
36 |
{"name": "DeepSeek Coder V2", "id": "deepseek/deepseek-coder-v2-instruct"},
|
37 |
-
{"name": "DeepSeek Chat V2", "id": "deepseek/deepseek-chat"},
|
38 |
-
|
39 |
-
# --- Fireworks AI Models ---
|
40 |
{"name": "Fireworks Firefunction V1", "id": "fireworks/accounts/fireworks/models/firefunction-v1"},
|
41 |
-
|
42 |
-
# --- Hugging Face Multimodal Models ---
|
43 |
{"name": "HuggingFace ERNIE-VL", "id": "huggingface/baidu/ERNIE-4.5-VL-424B-A47B-Base-PT"},
|
44 |
{"name": "HuggingFace GLM-VL", "id": "huggingface/THUDM/GLM-4.1V-9B-Thinking"},
|
45 |
]
|
@@ -49,26 +33,11 @@ MULTIMODAL_MODELS: List[str] = [
|
|
49 |
"huggingface/THUDM/GLM-4.1V-9B-Thinking",
|
50 |
]
|
51 |
|
52 |
-
# (
|
53 |
-
|
54 |
-
DEMO_LIST: List[Dict[str, str]] = [
|
55 |
-
{"title": "Todo App", "description": "Create a simple todo application with add, delete, and mark as complete functionality"},
|
56 |
-
{"title": "Calculator", "description": "Build a basic calculator with standard arithmetic operations"},
|
57 |
-
{"title": "Chat Interface", "description": "Build a chat interface with message history and user input"},
|
58 |
-
{"title": "E-commerce Product Card", "description": "Create a responsive product card for an e-commerce website"},
|
59 |
-
{"title": "Login Form", "description": "Build a modern, responsive login form with validation"},
|
60 |
-
{"title": "Dashboard Layout", "description": "Create a dashboard layout with a sidebar and main content area"},
|
61 |
-
{"title": "UI from Image", "description": "Upload an image of a UI design and I'll generate the HTML/CSS code for it"},
|
62 |
-
{"title": "Website Redesign", "description": "Enter a website URL to extract its content and redesign it"},
|
63 |
-
{"title": "Modify HTML", "description": "After generating HTML, ask me to modify it with specific changes. For example: 'Change the title to My New App'"},
|
64 |
-
]
|
65 |
|
66 |
-
# --- Supported Languages for Gradio Syntax Highlighting ---
|
67 |
-
# From: https://www.gradio.app/docs/code
|
68 |
GRADIO_SUPPORTED_LANGUAGES: List[Union[str, None]] = [
|
69 |
-
"python", "c", "cpp", "markdown", "latex", "json", "html", "css",
|
70 |
-
"
|
71 |
-
"
|
72 |
-
"sql-
|
73 |
-
"sql-gpSQL", "sql-sparkSQL", "sql-esper", None
|
74 |
]
|
|
|
1 |
# /config.py
|
2 |
+
""" Centralized configuration for the AnyCoder application. """
|
3 |
|
|
|
|
|
|
|
4 |
from typing import List, Dict, Union
|
5 |
|
6 |
+
# --- Search/Replace Constants ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
SEARCH_START = "<<<<<<< SEARCH"
|
8 |
DIVIDER = "======="
|
9 |
REPLACE_END = ">>>>>>> REPLACE"
|
10 |
|
11 |
+
# --- System Prompts ---
|
12 |
+
HTML_SYSTEM_PROMPT = """...""" # (Copy from your original file)
|
13 |
+
GENERIC_SYSTEM_PROMPT = """...""" # (Copy from your original file)
|
14 |
+
HTML_SYSTEM_PROMPT_WITH_SEARCH = """...""" # (Copy from your original file)
|
15 |
+
GENERIC_SYSTEM_PROMPT_WITH_SEARCH = """...""" # (Copy from your original file)
|
16 |
+
FollowUpSystemPrompt = f"""...""" # (Copy from your original file)
|
17 |
|
18 |
+
# --- Models & UI ---
|
19 |
AVAILABLE_MODELS: List[Dict[str, str]] = [
|
|
|
20 |
{"name": "OpenAI GPT-4o", "id": "openai/gpt-4o"},
|
21 |
{"name": "OpenAI GPT-4 Turbo", "id": "openai/gpt-4-turbo"},
|
|
|
|
|
22 |
{"name": "Groq Llama3 70b", "id": "groq/llama3-70b-8192"},
|
|
|
23 |
{"name": "Groq Mixtral 8x7b", "id": "groq/mixtral-8x7b-32768"},
|
|
|
|
|
24 |
{"name": "Google Gemini 1.5 Pro", "id": "gemini/gemini-1.5-pro-latest"},
|
|
|
|
|
25 |
{"name": "DeepSeek Coder V2", "id": "deepseek/deepseek-coder-v2-instruct"},
|
|
|
|
|
|
|
26 |
{"name": "Fireworks Firefunction V1", "id": "fireworks/accounts/fireworks/models/firefunction-v1"},
|
|
|
|
|
27 |
{"name": "HuggingFace ERNIE-VL", "id": "huggingface/baidu/ERNIE-4.5-VL-424B-A47B-Base-PT"},
|
28 |
{"name": "HuggingFace GLM-VL", "id": "huggingface/THUDM/GLM-4.1V-9B-Thinking"},
|
29 |
]
|
|
|
33 |
"huggingface/THUDM/GLM-4.1V-9B-Thinking",
|
34 |
]
|
35 |
|
36 |
+
DEMO_LIST: List[Dict[str, str]] = [...] # (Copy from your original file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
|
|
|
|
38 |
GRADIO_SUPPORTED_LANGUAGES: List[Union[str, None]] = [
|
39 |
+
"python", "c", "cpp", "markdown", "latex", "json", "html", "css", "javascript",
|
40 |
+
"jinja2", "typescript", "yaml", "dockerfile", "shell", "r", "sql", "sql-msSQL",
|
41 |
+
"sql-mySQL", "sql-mariaDB", "sql-sqlite", "sql-cassandra", "sql-plSQL", "sql-hive",
|
42 |
+
"sql-pgSQL", "sql-gql", "sql-gpSQL", "sql-sparkSQL", "sql-esper", None
|
|
|
43 |
]
|