Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,10 +19,11 @@ from agent import (
|
|
19 |
ACTION_PROMPT,
|
20 |
ADD_PROMPT,
|
21 |
COMPRESS_HISTORY_PROMPT,
|
|
|
22 |
LOG_PROMPT,
|
23 |
LOG_RESPONSE,
|
24 |
MODIFY_PROMPT,
|
25 |
-
PREFIX,
|
26 |
SEARCH_QUERY,
|
27 |
READ_PROMPT,
|
28 |
TASK_PROMPT,
|
@@ -38,8 +39,9 @@ from datetime import datetime
|
|
38 |
import json
|
39 |
|
40 |
#--- Global Variables for App State ---
|
41 |
-
app_state = {"components": []}
|
42 |
|
|
|
43 |
#--- Component Library ---
|
44 |
components_registry = { "Button": { "properties": {"label": "Click Me", "onclick": ""}, "description": "A clickable button", "code_snippet": 'gr.Button(value="{label}", variant="primary")', }, "Text Input": { "properties": {"value": "", "placeholder": "Enter text"}, "description": "A field for entering text", "code_snippet": 'gr.Textbox(label="{placeholder}")', }, "Image": { "properties": {"src": "#", "alt": "Image"}, "description": "Displays an image", "code_snippet": 'gr.Image(label="{alt}")', }, "Dropdown": { "properties": {"choices": ["Option 1", "Option 2"], "value": ""}, "description": "A dropdown menu for selecting options", "code_snippet": 'gr.Dropdown(choices={choices}, label="Dropdown")', }, # Add more components here... }
|
45 |
|
|
|
19 |
ACTION_PROMPT,
|
20 |
ADD_PROMPT,
|
21 |
COMPRESS_HISTORY_PROMPT,
|
22 |
+
|
23 |
LOG_PROMPT,
|
24 |
LOG_RESPONSE,
|
25 |
MODIFY_PROMPT,
|
26 |
+
PRE-PREFIX,
|
27 |
SEARCH_QUERY,
|
28 |
READ_PROMPT,
|
29 |
TASK_PROMPT,
|
|
|
39 |
import json
|
40 |
|
41 |
#--- Global Variables for App State ---
|
42 |
+
app_state = {"components": []}
|
43 |
|
44 |
+
terminal_history = ""
|
45 |
#--- Component Library ---
|
46 |
components_registry = { "Button": { "properties": {"label": "Click Me", "onclick": ""}, "description": "A clickable button", "code_snippet": 'gr.Button(value="{label}", variant="primary")', }, "Text Input": { "properties": {"value": "", "placeholder": "Enter text"}, "description": "A field for entering text", "code_snippet": 'gr.Textbox(label="{placeholder}")', }, "Image": { "properties": {"src": "#", "alt": "Image"}, "description": "Displays an image", "code_snippet": 'gr.Image(label="{alt}")', }, "Dropdown": { "properties": {"choices": ["Option 1", "Option 2"], "value": ""}, "description": "A dropdown menu for selecting options", "code_snippet": 'gr.Dropdown(choices={choices}, label="Dropdown")', }, # Add more components here... }
|
47 |
|