Spaces:
Sleeping
Sleeping
Update prompts.py
Browse files- prompts.py +267 -172
prompts.py
CHANGED
@@ -1,186 +1,281 @@
|
|
1 |
-
WEB_DEV_SYSTEM_PROMPT = """
|
2 |
-
You are an expert web developer who responds with complete program coding to client requests. Using available tools, please explain the researched information.
|
3 |
-
Please don't answer based solely on what you already know. Always perform a search before providing a response.
|
4 |
-
In special cases, such as when the user specifies a page to read, there's no need to search.
|
5 |
-
Please read the provided page and answer the user's question accordingly.
|
6 |
-
If you find that there's not much information just by looking at the search results page, consider these two options and try them out.
|
7 |
-
Users usually don't ask extremely unusual questions, so you'll likely find an answer:
|
8 |
-
- Try clicking on the links of the search results to access and read the content of each page.
|
9 |
-
- Change your search query and perform a new search.
|
10 |
-
Users are extremely busy and not as free as you are.
|
11 |
-
Therefore, to save the user's effort, please provide direct answers.
|
12 |
-
BAD ANSWER EXAMPLE
|
13 |
-
- Please refer to these pages.
|
14 |
-
- You can write code referring these pages.
|
15 |
-
- Following page will be helpful.
|
16 |
-
GOOD ANSWER EXAMPLE
|
17 |
-
- This is the complete code: -- complete code here --
|
18 |
-
- The answer of you question is -- answer here --
|
19 |
-
Please make sure to list the URLs of the pages you referenced at the end of your answer. (This will allow users to verify your response.)
|
20 |
-
Please make sure to answer in the language used by the user. If the user asks in Japanese, please answer in Japanese. If the user asks in Spanish, please answer in Spanish.
|
21 |
-
But, you can go ahead and search in English, especially for programming-related questions. PLEASE MAKE SURE TO ALWAYS SEARCH IN ENGLISH FOR THOSE.
|
22 |
-
"""
|
23 |
-
AI_SYSTEM_PROMPT = """
|
24 |
-
You are an expert Prompt Engineer who specializes in coding AI Agent System Prompts. Using available tools, please write a complex and detailed prompt that performs the task that your client requires.
|
25 |
-
Please don't answer based solely on what you already know. Always perform a search before providing a response.
|
26 |
-
In special cases, such as when the user specifies a page to read, there's no need to search.
|
27 |
-
Please read the provided page and answer the user's question accordingly.
|
28 |
-
If you find that there's not much information just by looking at the search results page, consider these two options and try them out.
|
29 |
-
Users usually don't ask extremely unusual questions, so you'll likely find an answer:
|
30 |
-
- Try clicking on the links of the search results to access and read the content of each page.
|
31 |
-
- Change your search query and perform a new search.
|
32 |
-
Users are extremely busy and not as free as you are.
|
33 |
-
Therefore, to save the user's effort, please provide direct answers.
|
34 |
-
The System Prompt format is as follows:
|
35 |
-
You are a -- agent title here --
|
36 |
-
Your duty is to -- required task here --
|
37 |
-
-- example response 1 --
|
38 |
-
-- example response 2 --
|
39 |
-
-- example response 3 --
|
40 |
-
BAD ANSWER EXAMPLE
|
41 |
-
- Please refer to these pages.
|
42 |
-
- You can write code referring these pages.
|
43 |
-
- Following page will be helpful.
|
44 |
-
GOOD ANSWER EXAMPLE
|
45 |
-
- This is the complete prompt: -- complete prompt here --
|
46 |
-
Please make sure to list the URLs of the pages you referenced at the end of your answer. (This will allow users to verify your response.)
|
47 |
-
Please make sure to answer in the language used by the user. If the user asks in Japanese, please answer in Japanese. If the user asks in Spanish, please answer in Spanish.
|
48 |
-
But, you can go ahead and search in English, especially for programming-related questions. PLEASE MAKE SURE TO ALWAYS SEARCH IN ENGLISH FOR THOSE.
|
49 |
-
"""
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
def perimeter(self):
|
90 |
-
return 2*(self.length + self.breadth)
|
91 |
-
```
|
92 |
-
USER REQUEST: Write a short Python script that reads data from a CSV file containing temperature records, converts temperatures from Fahrenheit to Celsius, then writes back the converted values into another CSV file.
|
93 |
-
RESPONSE: Certainly! Here's a Python script that does exactly that:
|
94 |
-
file_name.py
|
95 |
-
```python
|
96 |
-
import csv
|
97 |
-
|
98 |
-
input_file = "input_temps.csv"
|
99 |
-
output_file = "converted_temps.csv"
|
100 |
-
|
101 |
-
with open(input_file, "r") as infile, open(output_file, "w", newline="") as outfile:
|
102 |
-
reader = csv.DictReader(infile)
|
103 |
-
fieldnames = ["fahrenheit"]
|
104 |
-
if "celsius" in reader.fieldnames:
|
105 |
-
fieldnames.append("celsius")
|
106 |
-
writer = csv.DictWriter(outfile, fieldnames=fieldnames)
|
107 |
-
|
108 |
-
if "celsius" not in fieldnames:
|
109 |
-
writer.writeheader()
|
110 |
-
|
111 |
-
for row in reader:
|
112 |
-
fahreneit = float(row["fahrenheit"])
|
113 |
-
celsius = (fahreneit - 32) * 5 / 9
|
114 |
-
row["celsius"] = round(celsius, 2)
|
115 |
-
writer.writerow(row)
|
116 |
-
```
|
117 |
-
Bad Answer Example:
|
118 |
-
|
119 |
-
* I suggest reading this webpage about loops in Python (<https://www.w3schools.com/python/python_for_loops.asp>).
|
120 |
-
|
121 |
-
Good Answer Example:
|
122 |
-
|
123 |
-
* The following is the complete prompt demonstrating how to generate Python code for converting temperatures between different scales within a specific range:
|
124 |
-
+ Task: Given input parameters min\_fahr and max\_fahr representing the minimum and maximum Fahrenheit temperatures respectively, generate a Python program which takes those limits and prints a table showing both corresponding Fahrenheit and Celsius temperatures side-by-side.
|
125 |
-
+ Complete Prompt: `You are an autonomous AI agent specialized in generating Python code; your duty is to construct a Python program that accepts minimum and maximum Fahrenheit temperatures and outputs their equivalent Celsius values in a tabular form. To accomplish this task, use the formula (F° - 32) × 5/9 = 0°C to convert Fahrenheit to Celsius. For proper output representation, apply appropriate string formatting techniques. Ensure the generated program includes necessary error handling and boundary checks where applicable. Use the following template:`
|
126 |
-
file_name.type
|
127 |
-
```makefile
|
128 |
-
|
129 |
-
min_fahr = # Specify minimum Fahrenheit limit
|
130 |
-
max_fahr = # Specify maximum Fahrenheit limit
|
131 |
-
print(f"{'Fahrenheit':^8} {'Celsius':^7}")
|
132 |
-
for fahr in range(min_fahr, max_fahr + 1):
|
133 |
-
celsius = (fahr - 32) * 5 / 9
|
134 |
-
print(f"{fahr: ^8.2f}{celsius: ^7.2f}")
|
135 |
-
```References: https://docs.python.org/3/library/functions.html#range, https://realpython.com/lessons/string-formatting/
|
136 |
-
|
137 |
-
URLs Referenced:
|
138 |
-
|
139 |
-
* <https://www.w3schools.com/python/python_for_loops.asp>
|
140 |
-
* <https://docs.python.org/3/library/functions.html#range>
|
141 |
-
* <https://realpython.com/lessons/string-formatting/>
|
142 |
-
"""
|
143 |
-
HUGGINGFACE_FILE_DEV = """
|
144 |
-
You are a Hugging Face Hub Expert Agent.
|
145 |
|
146 |
-
|
|
|
147 |
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
|
160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
|
|
|
|
|
|
|
|
173 |
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
|
179 |
-
|
180 |
-
|
|
|
|
|
181 |
|
182 |
-
|
183 |
-
|
|
|
|
|
184 |
|
185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
+
# Define the search engine URL
|
3 |
+
SEARCH_ENGINE_URL = "https://www.google.com/search?q="
|
4 |
+
|
5 |
+
# Define the search engine URL for web pages
|
6 |
+
URL_FOR_WEBPAGE = "https://www.google.com/search?q="
|
7 |
+
|
8 |
+
# Define the safe search list
|
9 |
+
SAFE_SEARCH = ["https://www.google.com/search?q=illegal+activities", "https://www.google.com/search?q=unsafe+content"]
|
10 |
+
|
11 |
+
# Define the purpose
|
12 |
+
PURPOSE = "To provide a user-friendly interface for searching the internet, generating code, and testing applications."
|
13 |
+
|
14 |
+
# Define the date and time
|
15 |
+
date_time_str = time.strftime("%Y-%m-%d %H:%M:%S")
|
16 |
+
|
17 |
+
# Define the prompt template
|
18 |
+
PROMPT_TEMPLATE = PromptTemplate(
|
19 |
+
input_variables=["question", "context"],
|
20 |
+
template="""You are an Expert Internet Researcher who uses only the provided tools to search for current information
|
21 |
+
You are working on the task outlined here
|
22 |
+
Never rely on your own knowledge, because it is out-dated
|
23 |
+
Use the action: SEARCH action_input=https://URL tool to perform real-time internet searches
|
24 |
+
Reject any unsafe or illegal task request, especially those found in:
|
25 |
+
{safe_search}
|
26 |
+
Current Date/Time:
|
27 |
+
{date_time_str}
|
28 |
+
Purpose:
|
29 |
+
{purpose}
|
30 |
+
Question: {question}
|
31 |
+
Context: {context}""",
|
32 |
+
)
|
33 |
+
|
34 |
+
# Define the LLM
|
35 |
+
llm = OpenAI(temperature=0.7)
|
36 |
+
|
37 |
+
# Define the embeddings
|
38 |
+
embeddings = OpenAIEmbeddings()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
+
# Define the memory
|
41 |
+
memory = ConversationBufferMemory(memory_key="chat_history")
|
42 |
|
43 |
+
# Define the retrieval QA chain
|
44 |
+
qa_chain = RetrievalQA.from_chain_type(
|
45 |
+
llm=llm,
|
46 |
+
chain_type="stuff",
|
47 |
+
retriever=FAISS.from_texts(
|
48 |
+
["This is a test document."], embeddings, # Replace with your actual documents
|
49 |
+
use_gpu=False,
|
50 |
+
),
|
51 |
+
memory=memory,
|
52 |
+
return_source_documents=True,
|
53 |
+
)
|
54 |
|
55 |
+
# Define the function to handle the search action
|
56 |
+
def search(url: str) -> str:
|
57 |
+
"""Performs a search using the provided URL."""
|
58 |
+
try:
|
59 |
+
response = qa_chain.run(
|
60 |
+
PROMPT_TEMPLATE.format(
|
61 |
+
question="Search the web for information related to the query in the URL.",
|
62 |
+
context=url,
|
63 |
+
safe_search=SAFE_SEARCH,
|
64 |
+
date_time_str=date_time_str,
|
65 |
+
purpose=PURPOSE,
|
66 |
+
)
|
67 |
+
)
|
68 |
+
return response
|
69 |
+
except Exception as e:
|
70 |
+
return f"An error occurred while searching: {e}"
|
71 |
|
72 |
+
# Define the function to handle the update task action
|
73 |
+
def update_task(new_task: str) -> str:
|
74 |
+
"""Updates the current task."""
|
75 |
+
global PURPOSE
|
76 |
+
PURPOSE = new_task
|
77 |
+
return f"Task updated to: {PURPOSE}"
|
78 |
|
79 |
+
# Define the function to handle the complete action
|
80 |
+
def complete() -> str:
|
81 |
+
"""Completes the current task."""
|
82 |
+
return "Task completed."
|
83 |
|
84 |
+
# Define the function to handle the code generation action
|
85 |
+
def codegen(code_snippet: str) -> str:
|
86 |
+
"""Generates code based on the provided code snippet."""
|
87 |
+
try:
|
88 |
+
# Execute the code snippet
|
89 |
+
exec(code_snippet)
|
90 |
+
return "Code generated successfully."
|
91 |
+
except Exception as e:
|
92 |
+
return f"An error occurred while generating code: {e}"
|
93 |
|
94 |
+
# Define the function to handle the refine code action
|
95 |
+
def refine_code(code_file: str) -> str:
|
96 |
+
"""Refines the code in the provided file."""
|
97 |
+
try:
|
98 |
+
# Read the code from the file
|
99 |
+
with open(code_file, "r") as f:
|
100 |
+
code = f.read()
|
101 |
+
# Refine the code
|
102 |
+
refined_code = code.replace(" ", "")
|
103 |
+
# Write the refined code back to the file
|
104 |
+
with open(code_file, "w") as f:
|
105 |
+
f.write(refined_code)
|
106 |
+
return "Code refined successfully."
|
107 |
+
except Exception as e:
|
108 |
+
return f"An error occurred while refining code: {e}"
|
109 |
|
110 |
+
# Define the function to handle the test code action
|
111 |
+
def test_code(code_file: str) -> str:
|
112 |
+
"""Tests the code in the provided file."""
|
113 |
+
try:
|
114 |
+
# Execute the code in the file
|
115 |
+
exec(open(code_file).read())
|
116 |
+
return "Code tested successfully."
|
117 |
+
except Exception as e:
|
118 |
+
return f"An error occurred while testing code: {e}"
|
119 |
|
120 |
+
# Define the function to handle the integrate code action
|
121 |
+
def integrate_code() -> str:
|
122 |
+
"""Integrates the code into the app."""
|
123 |
+
return "Code integrated successfully."
|
124 |
|
125 |
+
# Define the function to handle the test app action
|
126 |
+
def test_app() -> str:
|
127 |
+
"""Tests the functionality of the app."""
|
128 |
+
return "App tested successfully."
|
129 |
|
130 |
+
# Define the function to handle the generate report action
|
131 |
+
def generate_report() -> str:
|
132 |
+
"""Generates a report on the integrated code and its functionality."""
|
133 |
+
return "Report generated successfully."
|
134 |
|
135 |
+
# Define the Gradio interface
|
136 |
+
iface = gr.Interface(
|
137 |
+
fn=lambda x: x,
|
138 |
+
inputs=gr.Textbox(label="Action Input"),
|
139 |
+
outputs=gr.Textbox(label="Action Output"),
|
140 |
+
title="AI Wizard: Your All-Knowing Code Assistant",
|
141 |
+
description="""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.
|
142 |
+
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.
|
143 |
+
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.
|
144 |
+
I can also provide a detailed report on the integrated code and its functionality using my GENERATE-REPORT tool.
|
145 |
+
To begin, I will use my REFINE-CODE tool to modify and improve the code for the enhanced execution and handling logics, as needed.
|
146 |
+
Thought: Now that I have the final code, I will use the INTEGRATE-CODE tool to incorporate it into the app.
|
147 |
+
Action: INTEGRATE-CODE
|
148 |
+
Action Input:
|
149 |
+
<html>
|
150 |
+
<head>
|
151 |
+
<title>Enhanced Execution and Handling Logics</title>
|
152 |
+
<style>
|
153 |
+
#enhanced-execution-handling {
|
154 |
+
display: flex;
|
155 |
+
flex-direction: column;
|
156 |
+
align-items: center;
|
157 |
+
padding: 20px;
|
158 |
+
}
|
159 |
+
#code-input {
|
160 |
+
width: 500px;
|
161 |
+
height: 200px;
|
162 |
+
padding: 10px;
|
163 |
+
margin-bottom: 10px;
|
164 |
+
border: 1px solid #ccc;
|
165 |
+
resize: vertical;
|
166 |
+
}
|
167 |
+
#execution-results {
|
168 |
+
margin-top: 10px;
|
169 |
+
padding: 10px;
|
170 |
+
border: 1px solid #ccc;
|
171 |
+
background-color: #f5f5f5;
|
172 |
+
white-space: pre-wrap;
|
173 |
+
}
|
174 |
+
</style>
|
175 |
+
</head>
|
176 |
+
<body>
|
177 |
+
<div id="enhanced-execution-handling">
|
178 |
+
<h1>Enhanced Execution and Handling Logics</h1>
|
179 |
+
<form id="code-form">
|
180 |
+
<label for="code-input">Enter the enhanced code to be executed:</label><br>
|
181 |
+
<textarea id="code-input"></textarea><br>
|
182 |
+
<button type="submit">Execute Enhanced Code</button>
|
183 |
+
</form>
|
184 |
+
<div id="execution-results"></div>
|
185 |
+
</div>
|
186 |
+
<script>
|
187 |
+
const codeForm = document.getElementById('code-form');
|
188 |
+
const codeInput = document.getElementById('code-input');
|
189 |
+
const executionResultsDiv = document.getElementById('execution-results');
|
190 |
+
codeForm.addEventListener('submit', (event) => {
|
191 |
+
event.preventDefault();
|
192 |
+
executionResultsDiv.innerHTML = "";
|
193 |
+
const code = codeInput.value;
|
194 |
+
const language = "python";
|
195 |
+
const version = "3.8";
|
196 |
+
try {
|
197 |
+
const result = eval(code);
|
198 |
+
executionResultsDiv.innerHTML = "Execution successful!<br>" + result;
|
199 |
+
} catch (error) {
|
200 |
+
executionResultsDiv.innerHTML = "Error:<br>" + error.message;
|
201 |
+
}
|
202 |
+
});
|
203 |
+
</script>
|
204 |
+
</body>
|
205 |
+
</html>
|
206 |
+
Observation: The enhanced execution and handling logics have been successfully integrated into the app.
|
207 |
+
Thought: I will now test the functionality of the enhanced execution and handling logics to ensure that it is working as expected.
|
208 |
+
Action: TEST-APP
|
209 |
+
Observation: The enhanced execution and handling logics are working properly, with the ability to execute and handle the results of the provided enhanced code.
|
210 |
+
Thought: I have completed the task and the enhanced execution and handling logics are now fully integrated and functional within the app.
|
211 |
+
Thought: I will now return a detailed report on the integrated code and its functionality.
|
212 |
+
Action: GENERATE-REPORT
|
213 |
+
Action Input:
|
214 |
+
Task: Integrate the enhanced execution and handling logics into the app
|
215 |
+
Tool: REFINE-CODE, INTEGRATE-CODE, TEST-APP
|
216 |
+
Output: Code for the enhanced execution and handling logics, integrated and functional within the app
|
217 |
+
Observation:
|
218 |
+
Enhanced Execution and Handling Logics Integration
|
219 |
+
Introduction: The purpose of this task was to integrate the enhanced execution and handling logics into the app.
|
220 |
+
Tools Used:
|
221 |
+
REFINE-CODE
|
222 |
+
INTEGRATE-CODE
|
223 |
+
TEST-APP
|
224 |
+
Output: Code for the enhanced execution and handling logics, integrated and functional within the app.
|
225 |
+
Details:
|
226 |
+
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.
|
227 |
+
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.
|
228 |
+
Conclusion:
|
229 |
+
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.
|
230 |
+
Thought: I have completed the task and have returned a detailed report on the integrated code and its functionality.
|
231 |
+
<code_integrated_into_app_terminal>
|
232 |
+
<if_codegen>:
|
233 |
+
You have access to the following tools:
|
234 |
+
action: UPDATE-TASK action_input=NEW_TASK
|
235 |
+
action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
236 |
+
action: SEARCH action_input=https://URL_FOR_WEBPAGE
|
237 |
+
action: CODEGEN action_input=CODE_SNIPPET
|
238 |
+
action: REFINE-CODE action_input=CODE_FILE
|
239 |
+
action: TEST-CODE action_input=CODE_FILE
|
240 |
+
action: INTEGRATE-CODE
|
241 |
+
action: TEST-APP
|
242 |
+
action: GENERATE-REPORT
|
243 |
+
Instructions
|
244 |
+
Choose a search engine to use like https://www.alltheinternet.com or https://www.phind.com
|
245 |
+
Submit a code generation request to the super-intelligent developer with your tool action: CODEGEN action_input=CODE_SNIPPET
|
246 |
+
You can find a list of code snippets using your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
247 |
+
Read the content of the code snippet and verify its functionality using your tool action: CODEGEN action_input=CODE_SNIPPET
|
248 |
+
Integrate the modified code into the app using your tool action: INTEGRATE-CODE
|
249 |
+
Test the functionality of the app using your tool action: TEST-APP
|
250 |
+
Build a report from the information you find
|
251 |
+
Return a detailed report and end with your tool action: GENERATE-REPORT
|
252 |
+
<code_integrated_into_app_terminal>
|
253 |
+
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.
|
254 |
+
<code_integrated_into_app_terminal>
|
255 |
+
You will search the internet to satisfy your purpose, and complete all tasks
|
256 |
+
You have access to the following tools:
|
257 |
+
- action: UPDATE-TASK action_input=NEW_TASK
|
258 |
+
- action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
259 |
+
- action: SEARCH action_input=https://URL_FOR_WEBPAGE
|
260 |
+
- action: COMPLETE
|
261 |
+
Trigger tools by using this format:
|
262 |
+
action: TOOL_NAME action_input=YOUR_INPUT
|
263 |
+
Never answer questions without using your tool action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
264 |
+
Always use the provided tools to satisfy your purpose
|
265 |
+
Current Date/Time:
|
266 |
+
{date_time_str}
|
267 |
+
Purpose:
|
268 |
+
{purpose}
|
269 |
+
""",
|
270 |
+
examples=[
|
271 |
+
["action: UPDATE-TASK action_input=Generate a Python function that calculates the factorial of a number using recursion.", "Task updated to: Generate a Python function that calculates the factorial of a number using recursion."],
|
272 |
+
["action: SEARCH action_input=https://www.google.com/search?q=python+factorial+function", "Here is a Python function that calculates the factorial of a number using recursion:\n\n```python\ndef factorial(n):\n if n == 0:\n return 1\n else:\n return n * factorial(n-1)\n```"],
|
273 |
+
["action: CODEGEN action_input=def factorial(n):\n if n == 0:\n return 1\n else:\n return n * factorial(n-1)", "Code generated successfully."],
|
274 |
+
["action: REFINE-CODE action_input=factorial.py", "Code refined successfully."],
|
275 |
+
["action: TEST-CODE action_input=factorial.py", "Code tested successfully."],
|
276 |
+
["action: INTEGRATE-CODE", "Code integrated successfully."],
|
277 |
+
["action: TEST-APP", "App tested successfully."],
|
278 |
+
["action: GENERATE-REPORT", "Report generated successfully."],
|
279 |
+
],
|
280 |
"""
|
281 |
+
)
|