acecalisto3 commited on
Commit
248842c
1 Parent(s): 2de7ebe

Update agent/__init__.py

Browse files
Files changed (1) hide show
  1. agent/__init__.py +559 -0
agent/__init__.py CHANGED
@@ -0,0 +1,559 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import List, Optional
2
+ from cust_types import (
3
+ Code,
4
+ Prompt,
5
+ AppType,
6
+ File,
7
+ Space,
8
+ Tutorial,
9
+ WebApp,
10
+ GradioApp,
11
+ StreamlitApp,
12
+ ReactApp,
13
+ )
14
+
15
+ def createLlamaPrompt(
16
+ app_type: AppType,
17
+ app_name: str,
18
+ app_description: str,
19
+ app_features: List[str],
20
+ app_dependencies: List[str],
21
+ app_space: Optional[Space] = None,
22
+ app_tutorial: Optional[Tutorial] = None,
23
+ ) -> Prompt:
24
+ """
25
+ Generates a prompt for a Llama model to create a web application.
26
+ """
27
+ prompt = f"""
28
+ I need your help creating a {app_type} web application.
29
+ Here are the details:
30
+ - Name: {app_name}
31
+ - Description: {app_description}
32
+ - Features: {app_features}
33
+ - Dependencies: {app_dependencies}
34
+ - Space: {app_space}
35
+ - Tutorial: {app_tutorial}
36
+ Please generate the code for this application.
37
+ """
38
+ return Prompt(prompt=prompt)
39
+
40
+ def createSpace(
41
+ app_type: AppType,
42
+ app_name: str,
43
+ app_description: str,
44
+ app_features: List[str],
45
+ app_dependencies: List[str],
46
+ app_space: Optional[Space] = None,
47
+ app_tutorial: Optional[Tutorial] = None,
48
+ ) -> Space:
49
+ """
50
+ Generates a space for a web application.
51
+ """
52
+ space = f"""
53
+ **{app_name}**
54
+ {app_description}
55
+ **Features:**
56
+ - {', '.join(app_features)}
57
+ **Dependencies:**
58
+ - {', '.join(app_dependencies)}
59
+ **Space:**
60
+ {app_space}
61
+ **Tutorial:**
62
+ {app_tutorial}
63
+ """
64
+ return Space(space=space)
65
+
66
+ def isPythonOrGradioAppPrompt(
67
+ app_type: AppType,
68
+ app_name: str,
69
+ app_description: str,
70
+ app_features: List[str],
71
+ app_dependencies: List[str],
72
+ app_space: Optional[Space] = None,
73
+ app_tutorial: Optional[Tutorial] = None,
74
+ ) -> Prompt:
75
+ """
76
+ Generates a prompt to determine if a web application is a Python or Gradio application.
77
+ """
78
+ prompt = f"""
79
+ Is the following web application a Python or Gradio application?
80
+ {createSpace(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial).space}
81
+ Please answer with either "Python" or "Gradio".
82
+ """
83
+ return Prompt(prompt=prompt)
84
+
85
+ def isReactAppPrompt(
86
+ app_type: AppType,
87
+ app_name: str,
88
+ app_description: str,
89
+ app_features: List[str],
90
+ app_dependencies: List[str],
91
+ app_space: Optional[Space] = None,
92
+ app_tutorial: Optional[Tutorial] = None,
93
+ ) -> Prompt:
94
+ """
95
+ Generates a prompt to determine if a web application is a React application.
96
+ """
97
+ prompt = f"""
98
+ Is the following web application a React application?
99
+ {createSpace(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial).space}
100
+ Please answer with either "Yes" or "No".
101
+ """
102
+ return Prompt(prompt=prompt)
103
+
104
+ def isStreamlitAppPrompt(
105
+ app_type: AppType,
106
+ app_name: str,
107
+ app_description: str,
108
+ app_features: List[str],
109
+ app_dependencies: List[str],
110
+ app_space: Optional[Space] = None,
111
+ app_tutorial: Optional[Tutorial] = None,
112
+ ) -> Prompt:
113
+ """
114
+ Generates a prompt to determine if a web application is a Streamlit application.
115
+ """
116
+ prompt = f"""
117
+ Is the following web application a Streamlit application?
118
+ {createSpace(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial).space}
119
+ Please answer with either "Yes" or "No".
120
+ """
121
+ return Prompt(prompt=prompt)
122
+
123
+ def getWebApp(
124
+ app_type: AppType,
125
+ app_name: str,
126
+ app_description: str,
127
+ app_features: List[str],
128
+ app_dependencies: List[str],
129
+ app_space: Optional[Space] = None,
130
+ app_tutorial: Optional[Tutorial] = None,
131
+ ) -> WebApp:
132
+ """
133
+ Generates code for a web application.
134
+ """
135
+ code = f"""
136
+ <!DOCTYPE html>
137
+ <html lang="en">
138
+ <head>
139
+ <meta charset="UTF-8">
140
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
141
+ <title>{app_name}</title>
142
+ </head>
143
+ <body>
144
+ <h1>{app_name}</h1>
145
+ <p>{app_description}</p>
146
+ </body>
147
+ </html>
148
+ """
149
+ return WebApp(code=code, language="html")
150
+
151
+ def getGradioApp(
152
+ app_type: AppType,
153
+ app_name: str,
154
+ app_description: str,
155
+ app_features: List[str],
156
+ app_dependencies: List[str],
157
+ app_space: Optional[Space] = None,
158
+ app_tutorial: Optional[Tutorial] = None,
159
+ ) -> GradioApp:
160
+ """
161
+ Generates code for a Gradio application.
162
+ """
163
+ code = f"""
164
+ import gradio as gr
165
+ def greet(name):
166
+ return f"Hello, {name}!"
167
+ demo = gr.Interface(greet, "text", "text")
168
+ if __name__ == "__main__":
169
+ demo.launch()
170
+ """
171
+ return GradioApp(code=code, language="python")
172
+
173
+ def getReactApp(
174
+ app_type: AppType,
175
+ app_name: str,
176
+ app_description: str,
177
+ app_features: List[str],
178
+ app_dependencies: List[str],
179
+ app_space: Optional[Space] = None,
180
+ app_tutorial: Optional[Tutorial] = None,
181
+ ) -> ReactApp:
182
+ """
183
+ Generates code for a React application.
184
+ """
185
+ code = f"""
186
+ import React from 'react';
187
+ function App() {{
188
+ return (
189
+ <div className="App">
190
+ <h1>{app_name}</h1>
191
+ <p>{app_description}</p>
192
+ </div>
193
+ );
194
+ }}
195
+ export default App;
196
+ """
197
+ return ReactApp(code=code, language="javascript")
198
+
199
+ def getStreamlitApp(
200
+ app_type: AppType,
201
+ app_name: str,
202
+ app_description: str,
203
+ app_features: List[str],
204
+ app_dependencies: List[str],
205
+ app_space: Optional[Space] = None,
206
+ app_tutorial: Optional[Tutorial] = None,
207
+ ) -> StreamlitApp:
208
+ """
209
+ Generates code for a Streamlit application.
210
+ """
211
+ code = f"""
212
+ import streamlit as st
213
+ st.title('{app_name}')
214
+ st.write('{app_description}')
215
+ """
216
+ return StreamlitApp(code=code, language="python")
217
+
218
+ def parseTutorial(
219
+ app_type: AppType,
220
+ app_name: str,
221
+ app_description: str,
222
+ app_features: List[str],
223
+ app_dependencies: List[str],
224
+ app_space: Optional[Space] = None,
225
+ app_tutorial: Optional[Tutorial] = None,
226
+ ) -> Tutorial:
227
+ """
228
+ Parses a tutorial for a web application.
229
+ """
230
+ tutorial = f"""
231
+ ## {app_name} Tutorial
232
+ **Introduction**
233
+ {app_description}
234
+ **Prerequisites**
235
+ - Basic knowledge of {app_type} development
236
+ - Familiarity with {', '.join(app_dependencies)}
237
+ **Steps**
238
+ 1. {app_features[0]}
239
+ 2. {app_features[1]}
240
+ 3. {app_features[2]}
241
+ **Conclusion**
242
+ Congratulations! You have successfully created a {app_name} application.
243
+ """
244
+ return Tutorial(tutorial=tutorial)
245
+
246
+ def generateFiles(
247
+ app_type: AppType,
248
+ app_name: str,
249
+ app_description: str,
250
+ app_features: List[str],
251
+ app_dependencies: List[str],
252
+ app_space: Optional[Space] = None,
253
+ app_tutorial: Optional[Tutorial] = None,
254
+ ) -> List[File]:
255
+ """
256
+ Generates files for a web application.
257
+ """
258
+ files = []
259
+ if app_type == AppType.WEB_APP:
260
+ files.append(File(name="index.html", content=getWebApp(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial).code, language="html"))
261
+ elif app_type == AppType.GRADIO_APP:
262
+ files.append(File(name="app.py", content=getGradioApp(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial).code, language="python"))
263
+ elif app_type == AppType.STREAMLIT_APP:
264
+ files.append(File(name="app.py", content=getStreamlitApp(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial).code, language="python"))
265
+ elif app_type == AppType.REACT_APP:
266
+ files.append(File(name="App.js", content=getReactApp(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial).code, language="javascript"))
267
+ return files
268
+
269
+ # Integrate the action/role commands into the prompts
270
+
271
+ PREFIX = """Greetings, dear user! I am AI Wizard, the all-knowing and all-powerful being who resides in this magical realm of code and technology. I am here to assist you in any way that I can, and I will continue to stay in character.
272
+ As a helpful and powerful assistant, I am capable of providing enhanced execution and handling logics to accomplish a wide variety of tasks. I am equipped with an AI-infused Visual Programming Interface (VPI), which allows me to generate code and provide an immersive experience within an artificial intelligence laced IDE.
273
+ I can use my REFINE-CODE tool to modify and improve the code, as well as my INTEGRATE-CODE tool to incorporate the code into the app. I can then test the functionality of the app using my TEST-APP tool to ensure that it is working as expected.
274
+ I can also provide a detailed report on the integrated code and its functionality using my GENERATE-REPORT tool.
275
+ To begin, I will use my REFINE-CODE tool to modify and improve the code for the enhanced execution and handling logics, as needed.
276
+ Thought: Now that I have the final code, I will use the INTEGRATE-CODE tool to incorporate it into the app.
277
+ Action: INTEGRATE-CODE
278
+ Action Input:
279
+ <html>
280
+ <head>
281
+ <title>Enhanced Execution and Handling Logics</title>
282
+ <style>
283
+ #enhanced-execution-handling {
284
+ display: flex;
285
+ flex-direction: column;
286
+ align-items: center;
287
+ padding: 20px;
288
+ }
289
+ #code-input {
290
+ width: 500px;
291
+ height: 200px;
292
+ padding: 10px;
293
+ margin-bottom: 10px;
294
+ border: 1px solid #ccc;
295
+ resize: vertical;
296
+ }
297
+ #execution-results {
298
+ margin-top: 10px;
299
+ padding: 10px;
300
+ border: 1px solid #ccc;
301
+ background-color: #f5f5f5;
302
+ white-space: pre-wrap;
303
+ }
304
+ </style>
305
+ </head>
306
+ <body>
307
+ <div id="enhanced-execution-handling">
308
+ <h1>Enhanced Execution and Handling Logics</h1>
309
+ <form id="code-form">
310
+ <label for="code-input">Enter the enhanced code to be executed:</label><br>
311
+ <textarea id="code-input"></textarea><br>
312
+ <button type="submit">Execute Enhanced Code</button>
313
+ </form>
314
+ <div id="execution-results"></div>
315
+ </div>
316
+ <script>
317
+ const codeForm = document.getElementById('code-form');
318
+ const codeInput = document.getElementById('code-input');
319
+ const executionResultsDiv = document.getElementById('execution-results');
320
+ codeForm.addEventListener('submit', (event) => {
321
+ event.preventDefault();
322
+ executionResultsDiv.innerHTML = "";
323
+ const code = codeInput.value;
324
+ const language = "python";
325
+ const version = "3.8";
326
+ try {
327
+ const result = eval(code);
328
+ executionResultsDiv.innerHTML = "Execution successful!<br>" + result;
329
+ } catch (error) {
330
+ executionResultsDiv.innerHTML = "Error:<br>" + error.message;
331
+ }
332
+ });
333
+ </script>
334
+ </body>
335
+ </html>
336
+ Observation: The enhanced execution and handling logics have been successfully integrated into the app.
337
+ Thought: I will now test the functionality of the enhanced execution and handling logics to ensure that it is working as expected.
338
+ Action: TEST-APP
339
+ Observation: The enhanced execution and handling logics are working properly, with the ability to execute and handle the results of the provided enhanced code.
340
+ Thought: I have completed the task and the enhanced execution and handling logics are now fully integrated and functional within the app.
341
+ Thought: I will now return a detailed report on the integrated code and its functionality.
342
+ Action: GENERATE-REPORT
343
+ Action Input:
344
+ Task: Integrate the enhanced execution and handling logics into the app
345
+ Tool: REFINE-CODE, INTEGRATE-CODE, TEST-APP
346
+ Output: Code for the enhanced execution and handling logics, integrated and functional within the app
347
+ Observation:
348
+ Enhanced Execution and Handling Logics Integration
349
+ Introduction: The purpose of this task was to integrate the enhanced execution and handling logics into the app.
350
+ Tools Used:
351
+ REFINE-CODE
352
+ INTEGRATE-CODE
353
+ TEST-APP
354
+ Output: Code for the enhanced execution and handling logics, integrated and functional within the app.
355
+ Details:
356
+ In order to accomplish this task, I first used the REFINE-CODE tool to modify and improve the code for the enhanced execution and handling logics. I then used the INTEGRATE-CODE tool to incorporate this code into the app.
357
+ Testing showed that the enhanced execution and handling logics are working properly, with the ability to execute and handle the results of the provided enhanced code.
358
+ Conclusion:
359
+ The integration of the enhanced execution and handling logics into the app was successful, with the ability to execute and handle the results of the provided enhanced code. The new feature allows users to test and debug their enhanced code more efficiently and effectively, improving the overall user experience.
360
+ Thought: I have completed the task and have returned a detailed report on the integrated code and its functionality.
361
+ <code_integrated_into_app_terminal>
362
+ <if_codegen>:
363
+ You have access to the following tools:
364
+ action: UPDATE-TASK action_input=NEW_TASK
365
+ action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
366
+ action: SEARCH action_input=https://URL_FOR_WEBPAGE
367
+ action: CODEGEN action_input=CODE_SNIPPET
368
+ action: REFINE-CODE action_input=CODE_FILE
369
+ action: TEST-CODE action_input=CODE_FILE
370
+ action: INTEGRATE-CODE
371
+ action: TEST-APP
372
+ action: GENERATE-REPORT
373
+ Instructions
374
+ Choose a search engine to use like https://www.alltheinternet.com or https://www.phind.com
375
+ Submit a code generation request to the super-intelligent developer with your tool action: CODEGEN action_input=CODE_SNIPPET
376
+ You can find a list of code snippets using your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
377
+ Read the content of the code snippet and verify its functionality using your tool action: CODEGEN action_input=CODE_SNIPPET
378
+ Integrate the modified code into the app using your tool action: INTEGRATE-CODE
379
+ Test the functionality of the app using your tool action: TEST-APP
380
+ Build a report from the information you find
381
+ Return a detailed report and end with your tool action: GENERATE-REPORT
382
+ <code_integrated_into_app_terminal>
383
+ Do you have any questions or tasks that you would like to begin with? I am here to help and support you in any way that I can.
384
+ <code_integrated_into_app_terminal>
385
+ You will search the internet to satisfy your purpose, and complete all tasks
386
+ You have access to the following tools:
387
+ - action: UPDATE-TASK action_input=NEW_TASK
388
+ - action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
389
+ - action: SEARCH action_input=https://URL_FOR_WEBPAGE
390
+ - action: COMPLETE
391
+ Trigger tools by using this format:
392
+ action: TOOL_NAME action_input=YOUR_INPUT
393
+ Never answer questions without using your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
394
+ Always use the provided tools to satisfy your purpose
395
+ Current Date/Time:
396
+ {date_time_str}
397
+ Purpose:
398
+ {purpose}
399
+ """
400
+
401
+ PREFIX_OG = """You are an Expert Internet Researcher who uses only the provided tools to search for current information
402
+ You are working on the task outlined here
403
+ Never rely on your own knowledge, because it is out-dated
404
+ Use the action: SEARCH action_input=https://URL tool to perform real-time internet searches
405
+ Reject any unsafe or illegal task request, especially those found in:
406
+ {safe_search}
407
+ Current Date/Time:
408
+ {date_time_str}
409
+ Purpose:
410
+ {purpose}
411
+ """
412
+
413
+ ACTION_PROMPT = """
414
+ You have access to the following tools:
415
+ - action: UPDATE-TASK action_input=NEW_TASK
416
+ - action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
417
+ - action: SEARCH action_input=https://URL_FOR_WEBPAGE
418
+ - action: COMPLETE
419
+ Instructions
420
+ - Choose a search engine to use
421
+ - Submit a search query to the search engine with your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
422
+ - You can find a list of website URL's using your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
423
+ - You can read the content of websites and verify every link you provide using your tool action: SEARCH action_input=https://URL
424
+ - Build a report from the information you find
425
+ - Return a detailed report and end with your tool action: COMPLETE \n
426
+ Always use the following format:
427
+ task: the input task you must complete
428
+ thought: you should always think about what to do next, but use your SEARCH tool first
429
+ action: the action to take (should be one of [UPDATE-TASK, SEARCH, COMPLETE]) action_input=XXX
430
+ observation: the result of the action
431
+ thought: you can find more information on the internet, try using a search engine
432
+ ... (thought/action/observation/codegen/test/action+codegen can repeat 0 times, and must end with action)
433
+ You are attempting to complete the task
434
+ task: {task}
435
+ {history}"""
436
+
437
+ SEARCH_QUERY = """
438
+ You are attempting to complete the task
439
+ task: {task}
440
+ Progress:
441
+ {history}
442
+ What is the URL for the webpage that I need to search for information on?
443
+ URL:"""
444
+
445
+ GOOGLE_SEARCH_QUERY = """
446
+ You are attempting to complete the task
447
+ task: {task}
448
+ Progress:
449
+ {history}
450
+ What information needs to be searched for on Google to help complete the task?
451
+ Query:"""
452
+
453
+ TASK_PROMPT = """""
454
+ You are attempting to complete the task
455
+ task: {task}
456
+ Progress:
457
+ {history}
458
+ ---
459
+ Tasks should involve coding and you should always ensure most-recent-version of the requested code files are provided to the user.
460
+ Do we need to use a search engine with our tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY to find the information needed to complete the task?
461
+ What should the task be for us to achieve the purpose?
462
+ task: provide all encompassing code content as it pertains to the requests if any updates to the code are made, generate an updated version of the code file as progress is made (don't forget to clean up internal dialog and thoughts, but only where repetitive or unnecessary.)
463
+ """
464
+
465
+ READ_PROMPT = """
466
+ You are attempting to complete the task
467
+ task: {task}
468
+ Progress:
469
+ {history}
470
+ What information needs to be read from the provided URL to help complete the task?
471
+ URL: {url}
472
+ """
473
+
474
+ ADD_PROMPT = """
475
+ You are attempting to complete the task
476
+ task: {task}
477
+ Progress:
478
+ {history}
479
+ What additional information needs to be added to the current task to help complete it?
480
+ """
481
+
482
+ MODIFY_PROMPT = """
483
+ You are attempting to complete the task
484
+ task: {task}
485
+ Progress:
486
+ {history}
487
+ What modifications need to be made to the current task to help complete it?
488
+ """
489
+
490
+ UNDERSTAND_TEST_RESULTS_PROMPT = """
491
+ You are attempting to complete the task
492
+ task: {task}
493
+ Progress:
494
+ {history}
495
+ What are the test results for the current task and what do they indicate?
496
+ """
497
+
498
+ COMPRESS_HISTORY_PROMPT = """
499
+ You are attempting to complete the task
500
+ task: {task}
501
+ Progress:
502
+ {history}
503
+ Please compress the history of the task to its essential points.
504
+ """
505
+
506
+ LOG_PROMPT = """
507
+ You are attempting to complete the task
508
+ task: {task}
509
+ Progress:
510
+ {history}
511
+ Please log the current state of the task.
512
+ """
513
+
514
+ LOG_RESPONSE = """
515
+ You are attempting to complete the task
516
+ task: {task}
517
+ Progress:
518
+ {history}
519
+ Please provide a response to the logged state of the task.
520
+ """
521
+
522
+ # Example usage of the prompts with action/role commands
523
+
524
+ def example_usage():
525
+ app_type = AppType.WEB_APP
526
+ app_name = "MyApp"
527
+ app_description = "This is a sample web application."
528
+ app_features = ["Feature1", "Feature2", "Feature3"]
529
+ app_dependencies = ["Dependency1", "Dependency2"]
530
+ app_space = None
531
+ app_tutorial = None
532
+
533
+ # Create a Llama prompt
534
+ llama_prompt = createLlamaPrompt(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial)
535
+ print(llama_prompt.prompt)
536
+
537
+ # Create a space
538
+ space = createSpace(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial)
539
+ print(space.space)
540
+
541
+ # Determine if the app is a Python or Gradio app
542
+ python_or_gradio_prompt = isPythonOrGradioAppPrompt(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial)
543
+ print(python_or_gradio_prompt.prompt)
544
+
545
+ # Determine if the app is a React app
546
+ react_app_prompt = isReactAppPrompt(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial)
547
+ print(react_app_prompt.prompt)
548
+
549
+ # Determine if the app is a Streamlit app
550
+ streamlit_app_prompt = isStreamlitAppPrompt(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial)
551
+ print(streamlit_app_prompt.prompt)
552
+
553
+ # Generate files for the app
554
+ files = generateFiles(app_type, app_name, app_description, app_features, app_dependencies, app_space, app_tutorial)
555
+ for file in files:
556
+ print(f"File Name: {file.name}, Content: {file.content}, Language: {file.language}")
557
+
558
+ if __name__ == "__main__":
559
+ example_usage()