Spaces:
Running
Running
acecalisto3
commited on
Commit
•
bcb4a93
1
Parent(s):
0762166
Update app.py
Browse files
app.py
CHANGED
@@ -32,6 +32,20 @@ current_model = None # Store the currently loaded model
|
|
32 |
repo = None # Store the Hugging Face Repository object
|
33 |
model_descriptions = {} # Store model descriptions
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
# --- Functions ---
|
36 |
def format_prompt(message: str, history: List[Tuple[str, str]], max_history_turns: int = 2) -> str:
|
37 |
prompt = ""
|
@@ -275,24 +289,4 @@ def main():
|
|
275 |
preview_button.click(preview_project, outputs=project_output)
|
276 |
|
277 |
if __name__ == "__main__":
|
278 |
-
|
279 |
-
|
280 |
-
if app_mode == "AI Agent Creator":
|
281 |
-
toolbox()
|
282 |
-
|
283 |
-
elif app_mode == "Tool Box":
|
284 |
-
toolbox()
|
285 |
-
|
286 |
-
elif app_mode == "Workspace Chat App":
|
287 |
-
workspace()
|
288 |
-
|
289 |
-
else:
|
290 |
-
raise ValueError("Invalid app mode selected.")
|
291 |
-
|
292 |
-
# Set up Flask app and run it
|
293 |
-
app = Flask(__name__)
|
294 |
-
app.config["MAX_CONTENT_LENGTH"] = 16 * 1024 * 1024
|
295 |
-
app.config["UPLOADED_IMAGES_DEST"] = UPLOADED_IMAGES_DEST
|
296 |
-
app.config["UPLOADED_STATIC_DEST"] = UPLOADED_STATIC_DEST
|
297 |
-
app.register_blueprint(streamlit_blueprint)
|
298 |
-
app.run(debug=True)
|
|
|
32 |
repo = None # Store the Hugging Face Repository object
|
33 |
model_descriptions = {} # Store model descriptions
|
34 |
|
35 |
+
# --- Constants ---
|
36 |
+
PREFIX = """Date: {date_time_str}
|
37 |
+
Purpose: {purpose}
|
38 |
+
Agent Name: {agent_name}
|
39 |
+
"""
|
40 |
+
|
41 |
+
LOG_PROMPT = """Prompt:
|
42 |
+
{content}
|
43 |
+
"""
|
44 |
+
|
45 |
+
LOG_RESPONSE = """Response:
|
46 |
+
{resp}
|
47 |
+
"""
|
48 |
+
|
49 |
# --- Functions ---
|
50 |
def format_prompt(message: str, history: List[Tuple[str, str]], max_history_turns: int = 2) -> str:
|
51 |
prompt = ""
|
|
|
289 |
preview_button.click(preview_project, outputs=project_output)
|
290 |
|
291 |
if __name__ == "__main__":
|
292 |
+
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|