lgaleana commited on
Commit
c7accd0
·
1 Parent(s): 11e0376

More fixes

Browse files
Files changed (1) hide show
  1. components.py +8 -8
components.py CHANGED
@@ -193,13 +193,13 @@ class CodeTask(TaskComponent):
193
  try:
194
  raw_output = llm_call(
195
  f"""
196
- Write a python function for the following request:
197
  {code_prompt}
198
 
199
- Do't save anything to disk. Instead, the function should return the necessary data.
200
  Use pip packages where available.
201
- For example, make a google search, use the googlesearch-python package instead of scraping google.
202
- Include necessary imports.
 
203
  """
204
  )
205
  with ThreadPoolExecutor() as executor:
@@ -208,10 +208,10 @@ class CodeTask(TaskComponent):
208
  llm_call,
209
  [
210
  f"""
211
- The following text has a python function with some packages that might need to be installed:
212
  {raw_output}
213
 
214
- Find the packages that need to be installed with pip and get their corresponsing names in pip.
215
  Package names in the imports and in pip might be different. Use the correct pip names.
216
 
217
  Put them in a JSON:
@@ -222,10 +222,10 @@ class CodeTask(TaskComponent):
222
  ```
223
  """,
224
  f"""
225
- The following text has a python function with some imports:
226
  {raw_output}
227
 
228
- Extract the imports and the function definition. Nothing else.
229
  """,
230
  ],
231
  )
 
193
  try:
194
  raw_output = llm_call(
195
  f"""
196
+ Write one python function for the following request:
197
  {code_prompt}
198
 
 
199
  Use pip packages where available.
200
+ For example, if you wanted to make a google search, use the googlesearch-python package instead of scraping google.
201
+ Include only the necessary imports.
202
+ Instead of printing or saving to disk, the function should return the data.
203
  """
204
  )
205
  with ThreadPoolExecutor() as executor:
 
208
  llm_call,
209
  [
210
  f"""
211
+ The following text has some python code:
212
  {raw_output}
213
 
214
+ Find the pip packages that need to be installed and get their corresponsing names in pip.
215
  Package names in the imports and in pip might be different. Use the correct pip names.
216
 
217
  Put them in a JSON:
 
222
  ```
223
  """,
224
  f"""
225
+ The following text has some python code:
226
  {raw_output}
227
 
228
+ Extract it. Remove anything after the function definition.
229
  """,
230
  ],
231
  )