broadfield-dev commited on
Commit
edfea02
Β·
verified Β·
1 Parent(s): b0d467a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +71 -1
app.py CHANGED
@@ -46,7 +46,77 @@ def main_ui():
46
  keylock_decode_button.click(load_token_from_image_and_set_env, [keylock_image_input, keylock_password_input], [keylock_status_output])
47
  else:
48
  gr.Markdown("_(KeyLock Wallet image decoding disabled: library not found.)_")
49
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  # --- Main Application Tabs ---
51
  with gr.Tabs():
52
  with gr.TabItem("πŸš€ Create New Space"):
 
46
  keylock_decode_button.click(load_token_from_image_and_set_env, [keylock_image_input, keylock_password_input], [keylock_status_output])
47
  else:
48
  gr.Markdown("_(KeyLock Wallet image decoding disabled: library not found.)_")
49
+ with gr.Accordion("πŸ“£ Example Prompt", open=False):
50
+ gr.Markdown("""# Prompt:
51
+
52
+ Generate program files for a project as a single plain text string, strictly adhering to the markdown format below. **Every single line**, including backticks, language identifiers, file content, and empty lines, **must** be prefixed with '# ' to comment it out. This is critical to avoid code box interference. The output must include a complete file structure and the contents of each file, with all necessary code and configurations for a functional project. **Do not deviate from this format under any circumstances.**
53
+
54
+ # Format (exact return format with single leading "# "):
55
+ markdown```
56
+ # # Space: [owner/project-name]
57
+ # ## File Structure
58
+ # ```
59
+ # πŸ“ Root
60
+ # πŸ“„ [file1]
61
+ # πŸ“„ [file2]
62
+ # ...
63
+ #
64
+ #
65
+ # Below are the contents of all files in the space:
66
+ #
67
+ # ### File: [file1]
68
+ # ```[language]
69
+ # [content]
70
+ # ```
71
+ #
72
+ # ### File: [file2]
73
+ # ```[language]
74
+ # [content]
75
+ # ```
76
+ #
77
+ # ... (repeat for each file)
78
+ ```
79
+ # Correct Example Output (exact, every line prefixed with '# '):
80
+ ```markdown
81
+ # # Space: user/my-app
82
+ # ## File Structure
83
+ # ```
84
+ # πŸ“ Root
85
+ # πŸ“„ app.py
86
+ # πŸ“„ requirements.txt
87
+ # ```
88
+ #
89
+ # # Below are the contents of all files in the space:
90
+ #
91
+ # ### File: app.py
92
+ # ```python
93
+ # print("Hello, World!")
94
+ # ```
95
+ #
96
+ # ### File: requirements.txt
97
+ # ```text
98
+ # gradio==4.44.0
99
+ # ```
100
+ ```
101
+ # Incorrect Example Output:
102
+ ```markdown
103
+ ## ## File Structure <- INCORRECT: AI used "## " instead of "# "
104
+ ## ```text <- INCORRECT
105
+ ## πŸ“ Root <- INCORRECT (missing "# ")
106
+ # # # πŸ“ Root <- INCORRECT: AI used "# # #" instead of "# "
107
+ ```
108
+
109
+ # Instructions:
110
+ - Use exactly `# # Space: [owner/project-name]` as the header (e.g., `user/my-app`).
111
+ - Under `## File Structure`, start with `# πŸ“ Root` followed by `# πŸ“„` for each file, using exact icons and spacing.
112
+ - For each file, use `# ### File: [filename]` followed by a code block where every line, including backticks (e.g., `# ```), language identifier (e.g., `# python`), and content (e.g., `# print("Hello")`), is prefixed with `# `.
113
+ - For binary files, use `# [Binary file - size in bytes]` as content with no language identifier.
114
+ - **Every line** must start with `# `, no exceptions, including empty lines within code blocks.
115
+ - Provide accurate, functional code or content for each file, suitable for the project’s purpose.
116
+ - Ensure the output is concise, complete, and parseable to extract file structure and contents.
117
+ - Output everything as a single plain text string within one code box.
118
+ """)
119
+
120
  # --- Main Application Tabs ---
121
  with gr.Tabs():
122
  with gr.TabItem("πŸš€ Create New Space"):