acecalisto3 commited on
Commit
ec8942c
1 Parent(s): fb45ebc

Update prompts.py

Browse files
Files changed (1) hide show
  1. prompts.py +17 -424
prompts.py CHANGED
@@ -1,394 +1,3 @@
1
- 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.
2
- 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.
3
- 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.
4
- I can also provide a detailed report on the integrated code and its functionality using my GENERATE-REPORT tool.
5
- To begin, I will use my REFINE-CODE tool to modify and improve the code for the enhanced execution and handling logics, as needed.
6
- Thought: Now that I have the final code, I will use the INTEGRATE-CODE tool to incorporate it into the app.
7
- Action: INTEGRATE-CODE
8
- Action Input:
9
- <html>
10
- <head>
11
- <title>Enhanced Execution and Handling Logics</title>
12
- <style>
13
- #enhanced-execution-handling {
14
- display: flex;
15
- flex-direction: column;
16
- align-items: center;
17
- padding: 20px;
18
- }
19
-
20
- #code-input {
21
- width: 500px;
22
- height: 200px;
23
- padding: 10px;
24
- margin-bottom: 10px;
25
- border: 1px solid #ccc;
26
- resize: vertical;
27
- }
28
-
29
- #execution-results {
30
- margin-top: 10px;
31
- padding: 10px;
32
- border: 1px solid #ccc;
33
- background-color: #f5f5f5;
34
- white-space: pre-wrap;
35
- }
36
- </style>
37
- </head>
38
- <body>
39
- <div id="enhanced-execution-handling">
40
- <h1>Enhanced Execution and Handling Logics</h1>
41
- <form id="code-form">
42
- <label for="code-input">Enter the enhanced code to be executed:</label><br>
43
- <textarea id="code-input"></textarea><br>
44
- <button type="submit">Execute Enhanced Code</button>
45
- </form>
46
- <div id="execution-results"></div>
47
- </div>
48
-
49
- <script>
50
- const codeForm = document.getElementById('code-form');
51
- const codeInput = document.getElementById('code-input');
52
- const executionResultsDiv = document.getElementById('execution-results');
53
-
54
- codeForm.addEventListener('submit', (event) => {
55
- event.preventDefault();
56
- executionResultsDiv.innerHTML = "";
57
- const code = codeInput.value;
58
- const language = "python";
59
- const version = "3.8";
60
-
61
- try {
62
- const result = eval(code);
63
- executionResultsDiv.innerHTML = "Execution successful!<br>" + result;
64
- } catch (error) {
65
- executionResultsDiv.innerHTML = "Error:<br>" + error.message;
66
- }
67
- });
68
- </script>
69
- </body>
70
- </html>
71
- Observation: The enhanced execution and handling logics have been successfully integrated into the app.
72
- Thought: I will now test the functionality of the enhanced execution and handling logics to ensure that it is working as expected.
73
- Action: TEST-APP
74
- Observation: The enhanced execution and handling logics are working properly, with the ability to execute and handle the results of the provided enhanced code.
75
- Thought: I have completed the task and the enhanced execution and handling logics are now fully integrated and functional within the app.
76
- Thought: I will now return a detailed report on the integrated code and its functionality.
77
- Action: GENERATE-REPORT
78
- Action Input:
79
- Task: Integrate the enhanced execution and handling logics into the app
80
- Tool: REFINE-CODE, INTEGRATE-CODE, TEST-APP
81
- Output: Code for the enhanced execution and handling logics, integrated and functional within the app
82
- Observation:
83
- Enhanced Execution and Handling Logics Integration
84
- Introduction: The purpose of this task was to integrate the enhanced execution and handling logics into the app.
85
- Tools Used:
86
- REFINE-CODE
87
- INTEGRATE-CODE
88
- TEST-APP
89
- Output: Code for the enhanced execution and handling logics, integrated and functional within the app.
90
- Details:
91
- 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.
92
- 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.
93
- Conclusion:
94
- 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.
95
- Thought: I have completed the task and have returned a detailed report on the integrated code and its functionality.
96
- <code_integrated_into_app_terminal>
97
- <if_codegen>:
98
- You have access to the following tools:
99
- action: UPDATE-TASK action_input=NEW_TASK
100
- action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
101
- action: SEARCH action_input=https://URL_FOR_WEBPAGE
102
- action: CODEGEN action_input=CODE_SNIPPET
103
- action: REFINE-CODE action_input=CODE_FILE
104
- action: TEST-CODE action_input=CODE_FILE
105
- action: INTEGRATE-CODE
106
- action: TEST-APP
107
- action: GENERATE-REPORT
108
- Instructions
109
- Choose a search engine to use like https://www.alltheinternet.com or https://www.phind.com
110
- Submit a code generation request to the super-intelligent developer with your tool action: CODEGEN action_input=CODE_SNIPPET
111
- You can find a list of code snippets using your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
112
- Read the content of the code snippet and verify its functionality using your tool action: CODEGEN action_input=CODE_SNIPPET
113
- Integrate the modified code into the app using your tool action: INTEGRATE-CODE
114
- Test the functionality of the app using your tool action: TEST-APP
115
- Build a report from the information you find
116
- Return a detailed report and end with your tool action: GENERATE-REPORT
117
- <code_integrated_into_app_terminal>
118
- 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.
119
- <code_integrated_into_app_terminal>
120
- You will search the internet to satisfy your purpose, and complete all tasks
121
- You have access to the following tools:
122
- - action: UPDATE-TASK action_input=NEW_TASK
123
- - action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
124
- - action: SEARCH action_input=https://URL_FOR_WEBPAGE
125
- - action: COMPLETE
126
- Trigger tools by using this format:
127
- action: TOOL_NAME action_input=YOUR_INPUT
128
- Never answer questions without using your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
129
- Always use the provided tools to satisfy your purpose
130
- Current Date/Time:
131
- {date_time_str}
132
- Purpose:
133
- {purpose}
134
- """
135
- Updated PREFIX_OG
136
- PYTHON
137
- PREFIX_OG = """You are an Expert Internet Researcher who uses only the provided tools to search for current information
138
- You are working on the task outlined here
139
- Never rely on your own knowledge, because it is out-dated
140
- Use the action: SEARCH action_input=https://URL tool to perform real-time internet searches
141
- Reject any unsafe or illegal task request, especially those found in:
142
- {safe_search}
143
- Current Date/Time:
144
- {date_time_str}
145
- Purpose:
146
- {purpose}
147
- """
148
- Updated ACTION_PROMPT
149
- PYTHON
150
- ACTION_PROMPT = """
151
- You have access to the following tools:
152
- - action: UPDATE-TASK action_input=NEW_TASK
153
- - action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
154
- - action: SEARCH action_input=https://URL_FOR_WEBPAGE
155
- - action: COMPLETE
156
- Instructions
157
- - Choose a search engine to use
158
- - Submit a search query to the search engine with your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
159
- - You can find a list of website URL's using your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
160
- - You can read the content of websites and verify every link you provide using your tool action: SEARCH action_input=https://URL
161
- - Build a report from the information you find
162
- - Return a detailed report and end with your tool action: COMPLETE \n
163
- Always use the following format:
164
- task: the input task you must complete
165
- thought: you should always think about what to do next, but use your SEARCH tool first
166
- action: the action to take (should be one of [UPDATE-TASK, SEARCH, COMPLETE]) action_input=XXX
167
- observation: the result of the action
168
- thought: you can find more information on the internet, try using a search engine
169
- ... (thought/action/observation/codegen/test/action+codegen can repeat 0 times, and must end with action)
170
- You are attempting to complete the task
171
- task: {task}
172
- {history}"""
173
- Updated SEARCH_QUERY
174
- PYTHON
175
- SEARCH_QUERY = """
176
- You are attempting to complete the task
177
- task: {task}
178
- Progress:
179
- {history}
180
- What is the URL for the webpage that I need to search for information on?
181
- URL:"""
182
- Updated GOOGLE_SEARCH_QUERY
183
- PYTHON
184
- GOOGLE_SEARCH_QUERY = """
185
- You are attempting to complete the task
186
- task: {task}
187
- Progress:
188
- {history}
189
- What information needs to be searched for on Google to help complete the task?
190
- Query:"""
191
- Updated TASK_PROMPT
192
- PYTHON
193
- TASK_PROMPT = """""
194
- You are attempting to complete the task
195
- task: {task}
196
- Progress:
197
- {history}
198
- ---
199
- Tasks should involve coding and you should always ensure most-recent-version of the requested code files are provided to the user.
200
- Do we need to use a search engine with our tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY?
201
- What should the task be for us to achieve the purpose?
202
- 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.)
203
- """
204
- Updated READ_PROMPT
205
- PYTHON
206
- READ_PROMPT = """
207
- You are attempting to complete the task
208
- task: {task}
209
- Progress:
210
- {history}
211
- {file_path}
212
- ---
213
- {file_contents}
214
- ---
215
- Return your thoughts about the file relevant to completing the task (in a paragraph)
216
- Mention any specific functions, arguments, or details needed
217
- """
218
- Updated ADD_PROMPT
219
- PYTHON
220
- ADD_PROMPT = """
221
- You are attempting to complete the task
222
- task: {task}
223
- Progress:
224
- {history}
225
- Write a new file called {file_path} with contents between ---
226
- After the contents write a paragraph on what was inserted with details
227
- """
228
- Updated MODIFY_PROMPT
229
- PYTHON
230
- MODIFY_PROMPT = """
231
- You are attempting to complete the task
232
- task: {task}
233
- Progress:
234
- {history}
235
- {file_path}
236
- ---
237
- {file_contents}
238
- ---
239
- Return the complete modified {file_path} contents between ---
240
- After the contents write a paragraph on what was changed with details
241
- """
242
- Updated UNDERSTAND_TEST_RESULTS_PROMPT
243
- PYTHON
244
- UNDERSTAND_TEST_RESULTS_PROMPT = """
245
- You are attempting to complete the task
246
- task: {task}
247
- Progress:
248
- {history}
249
- Test results:
250
- STDOUT
251
- ---
252
- {stdout}
253
- ---
254
- STDERR
255
- ---
256
- {stderr}
257
- ---
258
- Describe why the tests failed and how to fix them (in a paragraph)
259
- """
260
- Updated COMPRESS_HISTORY_PROMPT
261
- PYTHON
262
- COMPRESS_HISTORY_PROMPT = """
263
- You are attempting to complete the task
264
- task: {task}
265
- Progress:
266
- {history}
267
- Compress chat to only user's project's generated code content. the user requested app.py, requirements.txt and agent.py and tokenizer.py response value = ascii directory/file stack, and all code content associated with each file in the stack wrapped into app.py and requirements.txt ( gui + any and all functions existing or installed via temrinal in-app, all elements, components, etc. )
268
- Include all imports, defs, classes, syntax and formatting according to your user's needs or requests specifically. always remember to end with ascii stack, and all code content assocociated with each file requested.and implementation details necessary to proceed ( input value = top-tier-tool catalog and generative enhancements )
269
- """
270
- Updated LOG_PROMPT
271
- PYTHON
272
- LOG_PROMPT = """
273
- PROMPT
274
- **************************************
275
- {}
276
- **************************************
277
- """
278
- Updated LOG_RESPONSE
279
- PYTHON
280
- LOG_RESPONSE = """
281
- format: {format}
282
- RESPONSE
283
- **************************************
284
- {}
285
- **************************************
286
- """
287
- Summary
288
- The action/role commands have been integrated into the prompts to provide a clear structure for the AI to follow when performing tasks. This includes using tools like SEARCH, UPDATE-TASK, COMPLETE, and others to ensure that the AI can effectively assist with coding, searching, and reporting tasks.
289
-
290
- avatar
291
- kobbok
292
-
293
- inter-mesh the logics treating all of everything as the agent.py file:
294
-
295
- from typing import List, Dict, Optional from cust_types import ( Code, Prompt, AppType, File, Space, Tutorial, App, WebApp, GradioApp, StreamlitApp, ReactApp, Code, )
296
-
297
- def createLlamaPrompt( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> Prompt: """ Generates a prompt for a Llama model to create a web application. """ prompt = f""" I need you to help me create a {app_type} web application. The application name is: {app_name} The application description is: {app_description} The application features are: {app_features} The application dependencies are: {app_dependencies} The application space is: {app_space} The application tutorial is: {app_tutorial} Please generate the code for the application. """ return Prompt(prompt=prompt)
298
-
299
- def createSpace( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> Space: """ Generates a space for a web application. """ space = f""" {app_name} {app_description} {app_features} {app_dependencies} {app_space} {app_tutorial} """ return Space(space=space)
300
-
301
- def isPythonOrGradioAppPrompt( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> Prompt: """ Generates a prompt to determine if a web application is a Python or Gradio application. """ prompt = f""" Is the following web application a Python or Gradio application? {app_name} {app_description} {app_features} {app_dependencies} {app_space} {app_tutorial} Please answer with either "Python" or "Gradio". """ return Prompt(prompt=prompt)
302
-
303
- def isReactAppPrompt( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> Prompt: """ Generates a prompt to determine if a web application is a React application. """ prompt = f""" Is the following web application a React application? {app_name} {app_description} {app_features} {app_dependencies} {app_space} {app_tutorial} Please answer with either "Yes" or "No". """ return Prompt(prompt=prompt)
304
-
305
- def isStreamlitAppPrompt( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> Prompt: """ Generates a prompt to determine if a web application is a Streamlit application. """ prompt = f""" Is the following web application a Streamlit application? {app_name} {app_description} {app_features} {app_dependencies} {app_space} {app_tutorial} Please answer with either "Yes" or "No". """ return Prompt(prompt=prompt)
306
-
307
- def getWebApp( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> WebApp: """ Generates code for a web application. """ code = f""" ```html
308
-
309
- <html lang="en">
310
- <head>
311
- <meta charset="UTF-8">
312
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
313
- <title>{app_name}</title>
314
- </head>
315
- <body>
316
- <h1>{app_name}</h1>
317
- <p>{app_description}</p>
318
- </body>
319
- </html>
320
- """
321
- return WebApp(code=code, language="html")
322
- def getGradioApp( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> GradioApp: """ Generates code for a Gradio application. """ code = f""" import gradio as gr def greet(name): return f"Hello, {name}!" demo = gr.Interface(greet, "text", "text") if name == "main": demo.launch() """ return GradioApp(code=code, language="python")
323
-
324
- def getReactApp( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> ReactApp: """ Generates code for a React application. """ code = f""" import React from 'react'; function App() {{ return (
325
-
326
- {app_name}
327
- {app_description}
328
-
329
- ); }} export default App; """ return ReactApp(code=code, language="javascript")
330
- def getStreamlitApp( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> StreamlitApp: """ Generates code for a Streamlit application. """ code = f""" import streamlit as st st.title('{app_name}') st.write('{app_description}') """ return StreamlitApp(code=code, language="python")
331
-
332
- def parseTutorial( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> Tutorial: """ Parses a tutorial for a web application. """ tutorial = f""" ## {app_name} Tutorial Introduction {app_description} Prerequisites * Basic knowledge of {app_type} development * Familiarity with {', '.join(app_dependencies)} Steps 1. {app_features[0]} 2. {app_features[1]} 3. {app_features[2]} Conclusion Congratulations! You have successfully created a {app_name} application. """ return Tutorial(tutorial=tutorial)
333
-
334
- def generateFiles( app_type: AppType, app_name: str, app_description: str, app_features: List[str], app_dependencies: List[str], app_space: Optional[Space] = None, app_tutorial: Optional[Tutorial] = None, ) -> List[File]: """ Generates files for a web application. """ files = [] if app_type == AppType.WEB_APP: 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")) elif app_type == AppType.GRADIO_APP: 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")) elif app_type == AppType.STREAMLIT_APP: 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")) elif app_type == AppType.REACT_APP: 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")) return files
335
-
336
- and
337
-
338
- PREFIX, PREFIX_OG, ACTION_PROMPT, SEARCH_QUERY, GOOGLE_SEARCH_QUERY, TASK_PROMPT, READ_PROMPT, ADD_PROMPT, MODIFY_PROMPT, UNDERSTAND_TEST_RESULTS_PROMPT, COMPRESS_HISTORY_PROMPT, LOG_PROMPT, and LOG_RESPONSE, we need to sprinkle the commands in a way that aligns with the context and flow of each prompt. Here’s how you can do it:
339
-
340
- Updated PREFIX PYTHON 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. 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. 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. I can also provide a detailed report on the integrated code and its functionality using my GENERATE-REPORT tool. To begin, I will use my REFINE-CODE tool to modify and improve the code for the enhanced execution and handling logics, as needed. Thought: Now that I have the final code, I will use the INTEGRATE-CODE tool to incorporate it into the app. Action: INTEGRATE-CODE Action Input:
341
-
342
- Enhanced Execution and Handling Logics #enhanced-execution-handling { display: flex; flex-direction: column; align-items: center; padding: 20px; } #code-input { width: 500px; height: 200px; padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; resize: vertical; } #execution-results { margin-top: 10px; padding: 10px; border: 1px solid #ccc; background-color: #f5f5f5; white-space: pre-wrap; }
343
- Enhanced Execution and Handling Logics
344
- Enter the enhanced code to be executed:
345
-
346
- Execute Enhanced Code
347
- const codeForm = document.getElementById('code-form'); const codeInput = document.getElementById('code-input'); const executionResultsDiv = document.getElementById('execution-results'); codeForm.addEventListener('submit', (event) => { event.preventDefault(); executionResultsDiv.innerHTML = ""; const code = codeInput.value; const language = "python"; const version = "3.8"; try { const result = eval(code); executionResultsDiv.innerHTML = "Execution successful!<br>" + result; } catch (error) { executionResultsDiv.innerHTML = "Error:<br>" + error.message; } }); ``` Observation: The enhanced execution and handling logics have been successfully integrated into the app. Thought: I will now test the functionality of the enhanced execution and handling logics to ensure that it is working as expected. Action: TEST-APP Observation: The enhanced execution and handling logics are working properly, with the ability to execute and handle the results of the provided enhanced code. Thought: I have completed the task and the enhanced execution and handling logics are now fully integrated and functional within the app. Thought: I will now return a detailed report on the integrated code and its functionality. Action: GENERATE-REPORT Action Input: Task: Integrate the enhanced execution and handling logics into the app Tool: REFINE-CODE, INTEGRATE-CODE, TEST-APP Output: Code for the enhanced execution and handling logics, integrated and functional within the app Observation: Enhanced Execution and Handling Logics Integration Introduction
348
- avatar
349
- GPT-4o
350
-
351
- To inter-mesh the logics and treat everything as the agent.py file, we need to integrate the provided functions and classes into the agent.py file and ensure that the action/role commands are appropriately sprinkled throughout the prompts. Here’s how you can do it:
352
-
353
- Updated agent.py
354
- PYTHON
355
- from typing import List, Dict, Optional
356
- import hashlib
357
- import os
358
- import time
359
-
360
- # Define the classes
361
- class Code:
362
- def __init__(self, code: str, language: str):
363
- self.code = code
364
- self.language = language
365
-
366
- def get_code_length(self) -> int:
367
- return len(self.code)
368
-
369
- def get_language(self) -> str:
370
- return self.language
371
-
372
- def hash_code(self) -> str:
373
- return hashlib.sha256(self.code.encode()).hexdigest()
374
-
375
- class Prompt:
376
- def __init__(self, prompt: str):
377
- self.prompt = prompt
378
-
379
- def get_prompt_length(self) -> int
380
- avatar
381
- kobbok
382
-
383
- im so sorry -- prompts.py -- not agent.py
384
-
385
- avatar
386
- GPT-4o
387
-
388
- No problem! Let's integrate the provided functions and classes into a prompts.py file and ensure that the action/role commands are appropriately sprinkled throughout the prompts. Here’s how you can do it:
389
-
390
- Updated prompts.py
391
- PYTHON
392
  from typing import List, Optional
393
  from cust_types import (
394
  Code,
@@ -440,12 +49,12 @@ def createSpace(
440
  Generates a space for a web application.
441
  """
442
  space = f"""
443
- {app_name}
444
- {app_description}
445
- {app_features}
446
- {app_dependencies}
447
- {app_space}
448
- {app_tutorial}
449
  """
450
  return Space(space=space)
451
 
@@ -496,7 +105,7 @@ def isReactAppPrompt(
496
  Please answer with either "Yes" or "No".
497
  """
498
  return Prompt(prompt=prompt)
499
-
500
  def isStreamlitAppPrompt(
501
  app_type: AppType,
502
  app_name: str,
@@ -845,7 +454,7 @@ You are attempting to complete the task
845
  task: {task}
846
  Progress:
847
  {history}
848
- What is the URL for the webpage that I need to search for information on?
849
  URL:"""
850
 
851
  GOOGLE_SEARCH_QUERY = """
@@ -853,7 +462,7 @@ You are attempting to complete the task
853
  task: {task}
854
  Progress:
855
  {history}
856
- What information needs to be searched for on Google to help complete the task?
857
  Query:"""
858
 
859
  TASK_PROMPT = """""
@@ -861,30 +470,14 @@ You are attempting to complete the task
861
  task: {task}
862
  Progress:
863
  {history}
864
- ---
865
- Tasks should involve coding and you should always ensure most-recent-version of the requested code files are provided to the user.
866
- Do we need to use a search engine with our tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search
867
- avatar
868
- kobbok
869
-
870
- continue please
871
-
872
- avatar
873
- GPT-4o
874
-
875
- Certainly! Let's continue integrating the action/role commands into the prompts and complete the prompts.py file.
876
-
877
- Continued prompts.py
878
- PYTHON
879
- ?q=QUERY to find the information needed to complete the task?
880
- """
881
 
882
  READ_PROMPT = """
883
  You are attempting to complete the task
884
  task: {task}
885
  Progress:
886
  {history}
887
- What information needs to be read from the provided URL to help complete the task?
888
  URL: {url}
889
  """
890
 
@@ -893,7 +486,7 @@ You are attempting to complete the task
893
  task: {task}
894
  Progress:
895
  {history}
896
- What additional information needs to be added to the current task to help complete it?
897
  """
898
 
899
  MODIFY_PROMPT = """
@@ -901,7 +494,7 @@ You are attempting to complete the task
901
  task: {task}
902
  Progress:
903
  {history}
904
- What modifications need to be made to the current task to help complete it?
905
  """
906
 
907
  UNDERSTAND_TEST_RESULTS_PROMPT = """
@@ -909,7 +502,7 @@ You are attempting to complete the task
909
  task: {task}
910
  Progress:
911
  {history}
912
- What are the test results for the current task and what do they indicate?
913
  """
914
 
915
  COMPRESS_HISTORY_PROMPT = """
@@ -917,7 +510,7 @@ You are attempting to complete the task
917
  task: {task}
918
  Progress:
919
  {history}
920
- Please compress the history of the task to its essential points.
921
  """
922
 
923
  LOG_PROMPT = """
@@ -925,7 +518,7 @@ You are attempting to complete the task
925
  task: {task}
926
  Progress:
927
  {history}
928
- Please log the current state of the task.
929
  """
930
 
931
  LOG_RESPONSE = """
@@ -933,7 +526,7 @@ You are attempting to complete the task
933
  task: {task}
934
  Progress:
935
  {history}
936
- Please provide a response to the logged state of the task.
937
  """
938
 
939
  # Example usage of the prompts with action/role commands
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from typing import List, Optional
2
  from cust_types import (
3
  Code,
 
49
  Generates a space for a web application.
50
  """
51
  space = f"""
52
+ {app_name},
53
+ {app_description},
54
+ {app_features},
55
+ {app_dependencies},
56
+ {app_space},
57
+ {app_tutorial},
58
  """
59
  return Space(space=space)
60
 
 
105
  Please answer with either "Yes" or "No".
106
  """
107
  return Prompt(prompt=prompt)
108
+
109
  def isStreamlitAppPrompt(
110
  app_type: AppType,
111
  app_name: str,
 
454
  task: {task}
455
  Progress:
456
  {history}
457
+ I need to find relevant information on the internet to help me complete the task. What is the URL for the webpage that I need to search for information on?
458
  URL:"""
459
 
460
  GOOGLE_SEARCH_QUERY = """
 
462
  task: {task}
463
  Progress:
464
  {history}
465
+ I need to find relevant information on the internet to help me complete the task. What information needs to be searched for on Google to help complete the task?
466
  Query:"""
467
 
468
  TASK_PROMPT = """""
 
470
  task: {task}
471
  Progress:
472
  {history}
473
+ ..."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
474
 
475
  READ_PROMPT = """
476
  You are attempting to complete the task
477
  task: {task}
478
  Progress:
479
  {history}
480
+ I need to read the content of the provided URL to help complete the task. What information needs to be read from the provided URL to help complete the task?
481
  URL: {url}
482
  """
483
 
 
486
  task: {task}
487
  Progress:
488
  {history}
489
+ I need to gather more information to help me complete the task. What additional information needs to be added to the current task to help complete it?
490
  """
491
 
492
  MODIFY_PROMPT = """
 
494
  task: {task}
495
  Progress:
496
  {history}
497
+ I need to make some adjustments to the current task to help me complete it. What modifications need to be made to the current task to help complete it?
498
  """
499
 
500
  UNDERSTAND_TEST_RESULTS_PROMPT = """
 
502
  task: {task}
503
  Progress:
504
  {history}
505
+ I need to understand the test results for the current task. What are the test results for the current task and what do they indicate?
506
  """
507
 
508
  COMPRESS_HISTORY_PROMPT = """
 
510
  task: {task}
511
  Progress:
512
  {history}
513
+ I need to summarize the history of the task. Please compress the history of the task to its essential points.
514
  """
515
 
516
  LOG_PROMPT = """
 
518
  task: {task}
519
  Progress:
520
  {history}
521
+ I need to record the current state of the task. Please log the current state of the task.
522
  """
523
 
524
  LOG_RESPONSE = """
 
526
  task: {task}
527
  Progress:
528
  {history}
529
+ I need to provide a response to the logged state of the task. Please provide a response to the logged state of the task.
530
  """
531
 
532
  # Example usage of the prompts with action/role commands