Spaces:
Running
Running
milwright
Claude
commited on
Commit
·
a2232be
1
Parent(s):
be0e3cc
Remove title and description fields from deployment configuration
Browse files- Replace user-configurable name/description with fixed values
- Update preview and config displays to remove these fields
- Maintain backward compatibility with fixed default values
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- app.py +9 -14
- support_docs.py +1 -5
app.py
CHANGED
|
@@ -744,6 +744,8 @@ def generate_zip(system_prompt, model, api_key_var, temperature, max_tokens, exa
|
|
| 744 |
|
| 745 |
# Create config
|
| 746 |
config = {
|
|
|
|
|
|
|
| 747 |
'system_prompt': system_prompt,
|
| 748 |
'model': model,
|
| 749 |
'api_key_var': api_key_var,
|
|
@@ -854,8 +856,8 @@ def on_preview_combined(system_prompt, model, temperature, max_tokens, examples_
|
|
| 854 |
|
| 855 |
# Create configuration for preview
|
| 856 |
config_data = {
|
| 857 |
-
'name': name
|
| 858 |
-
'description': description
|
| 859 |
'system_prompt': final_system_prompt,
|
| 860 |
'model': model,
|
| 861 |
'temperature': temperature,
|
|
@@ -879,10 +881,8 @@ def on_preview_combined(system_prompt, model, temperature, max_tokens, examples_
|
|
| 879 |
# Generate preview displays with example prompts
|
| 880 |
examples_preview = "\n".join([f"• {ex}" for ex in examples_list[:3]]) # Show first 3 examples
|
| 881 |
|
| 882 |
-
preview_text = f"""**
|
| 883 |
config_display = f"""> **Configuration**:
|
| 884 |
-
- **Name:** {name}
|
| 885 |
-
- **Description:** {description or 'No description provided'}
|
| 886 |
- **Model:** {model}
|
| 887 |
- **Temperature:** {temperature}
|
| 888 |
- **Max Response Tokens:** {max_tokens}
|
|
@@ -895,7 +895,7 @@ def on_preview_combined(system_prompt, model, temperature, max_tokens, examples_
|
|
| 895 |
"""
|
| 896 |
|
| 897 |
# Show success notification
|
| 898 |
-
gr.Info(f"✅ Preview generated successfully
|
| 899 |
|
| 900 |
# Determine how many URLs are configured
|
| 901 |
all_urls = [url1, url2, url3, url4, url5, url6, url7, url8, url9, url10]
|
|
@@ -972,14 +972,10 @@ def update_preview_display(config_data):
|
|
| 972 |
examples_list = config_data.get('examples_list', [])
|
| 973 |
examples_preview = "\n".join([f"• {ex}" for ex in examples_list[:3]]) # Show first 3 examples
|
| 974 |
|
| 975 |
-
preview_text = f"""**
|
| 976 |
|
| 977 |
config_display = f"""### Current Configuration
|
| 978 |
|
| 979 |
-
**Space Details:**
|
| 980 |
-
- **Name:** {config_data['name']}
|
| 981 |
-
- **Description:** {config_data.get('description', 'No description provided')}
|
| 982 |
-
|
| 983 |
**Model Settings:**
|
| 984 |
- **Model:** {config_data['model']}
|
| 985 |
- **Temperature:** {config_data['temperature']}
|
|
@@ -1019,7 +1015,6 @@ To test your assistant with real API responses, please:
|
|
| 1019 |
3. Or add it to your `.env` file: `OPENROUTER_API_KEY=your_key_here`
|
| 1020 |
|
| 1021 |
**Your Configuration:**
|
| 1022 |
-
- **Name:** {config_data.get('name', 'your assistant')}
|
| 1023 |
- **Model:** {config_data.get('model', 'unknown model')}
|
| 1024 |
- **Temperature:** {config_data.get('temperature', 0.7)}
|
| 1025 |
- **Max Tokens:** {config_data.get('max_tokens', 500)}
|
|
@@ -1194,8 +1189,8 @@ def on_generate(system_prompt, model, api_key_var, temperature, max_tokens, exam
|
|
| 1194 |
|
| 1195 |
# Update sandbox preview
|
| 1196 |
config_data = {
|
| 1197 |
-
'name': name
|
| 1198 |
-
'description': description
|
| 1199 |
'system_prompt': final_system_prompt,
|
| 1200 |
'model': model,
|
| 1201 |
'temperature': temperature,
|
|
|
|
| 744 |
|
| 745 |
# Create config
|
| 746 |
config = {
|
| 747 |
+
'name': 'AI Assistant', # Fixed name for deployed spaces
|
| 748 |
+
'description': 'A customizable AI assistant', # Fixed description
|
| 749 |
'system_prompt': system_prompt,
|
| 750 |
'model': model,
|
| 751 |
'api_key_var': api_key_var,
|
|
|
|
| 856 |
|
| 857 |
# Create configuration for preview
|
| 858 |
config_data = {
|
| 859 |
+
'name': 'AI Assistant', # Fixed name
|
| 860 |
+
'description': 'A customizable AI assistant', # Fixed description
|
| 861 |
'system_prompt': final_system_prompt,
|
| 862 |
'model': model,
|
| 863 |
'temperature': temperature,
|
|
|
|
| 881 |
# Generate preview displays with example prompts
|
| 882 |
examples_preview = "\n".join([f"• {ex}" for ex in examples_list[:3]]) # Show first 3 examples
|
| 883 |
|
| 884 |
+
preview_text = f"""**AI Assistant** is ready to test. Use the example prompts below or type your own message."""
|
| 885 |
config_display = f"""> **Configuration**:
|
|
|
|
|
|
|
| 886 |
- **Model:** {model}
|
| 887 |
- **Temperature:** {temperature}
|
| 888 |
- **Max Response Tokens:** {max_tokens}
|
|
|
|
| 895 |
"""
|
| 896 |
|
| 897 |
# Show success notification
|
| 898 |
+
gr.Info(f"✅ Preview generated successfully! Switch to Preview tab.")
|
| 899 |
|
| 900 |
# Determine how many URLs are configured
|
| 901 |
all_urls = [url1, url2, url3, url4, url5, url6, url7, url8, url9, url10]
|
|
|
|
| 972 |
examples_list = config_data.get('examples_list', [])
|
| 973 |
examples_preview = "\n".join([f"• {ex}" for ex in examples_list[:3]]) # Show first 3 examples
|
| 974 |
|
| 975 |
+
preview_text = f"""**AI Assistant** is ready to test. Use the example prompts below or type your own message."""
|
| 976 |
|
| 977 |
config_display = f"""### Current Configuration
|
| 978 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 979 |
**Model Settings:**
|
| 980 |
- **Model:** {config_data['model']}
|
| 981 |
- **Temperature:** {config_data['temperature']}
|
|
|
|
| 1015 |
3. Or add it to your `.env` file: `OPENROUTER_API_KEY=your_key_here`
|
| 1016 |
|
| 1017 |
**Your Configuration:**
|
|
|
|
| 1018 |
- **Model:** {config_data.get('model', 'unknown model')}
|
| 1019 |
- **Temperature:** {config_data.get('temperature', 0.7)}
|
| 1020 |
- **Max Tokens:** {config_data.get('max_tokens', 500)}
|
|
|
|
| 1189 |
|
| 1190 |
# Update sandbox preview
|
| 1191 |
config_data = {
|
| 1192 |
+
'name': 'AI Assistant', # Fixed name
|
| 1193 |
+
'description': 'A customizable AI assistant', # Fixed description
|
| 1194 |
'system_prompt': final_system_prompt,
|
| 1195 |
'model': model,
|
| 1196 |
'temperature': temperature,
|
support_docs.py
CHANGED
|
@@ -36,7 +36,7 @@ def create_support_docs():
|
|
| 36 |
gr.Markdown("""
|
| 37 |
### Essential Settings
|
| 38 |
|
| 39 |
-
**
|
| 40 |
|
| 41 |
**Model Selection:**
|
| 42 |
- **Gemini 2.0 Flash** - Fast, reliable (recommended)
|
|
@@ -318,10 +318,6 @@ Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}
|
|
| 318 |
"""
|
| 319 |
|
| 320 |
# Add basic configuration details
|
| 321 |
-
if config_metadata.get('name'):
|
| 322 |
-
markdown_content += f"**Assistant Name:** {config_metadata['name']}\n"
|
| 323 |
-
if config_metadata.get('description'):
|
| 324 |
-
markdown_content += f"**Description:** {config_metadata['description']}\n"
|
| 325 |
if config_metadata.get('model'):
|
| 326 |
markdown_content += f"**Model:** {config_metadata['model']}\n"
|
| 327 |
if config_metadata.get('temperature'):
|
|
|
|
| 36 |
gr.Markdown("""
|
| 37 |
### Essential Settings
|
| 38 |
|
| 39 |
+
**System Prompt** - Define your assistant's role, behavior, and capabilities
|
| 40 |
|
| 41 |
**Model Selection:**
|
| 42 |
- **Gemini 2.0 Flash** - Fast, reliable (recommended)
|
|
|
|
| 318 |
"""
|
| 319 |
|
| 320 |
# Add basic configuration details
|
|
|
|
|
|
|
|
|
|
|
|
|
| 321 |
if config_metadata.get('model'):
|
| 322 |
markdown_content += f"**Model:** {config_metadata['model']}\n"
|
| 323 |
if config_metadata.get('temperature'):
|