@@ -335,13 +335,13 @@ def augment_prompt_by_languge(prompt, test_category):
335
335
if test_category == "java" :
336
336
prompt = prompt + "\n Note that the provided function is in Java 8 SDK syntax."
337
337
elif test_category == "javascript" :
338
- prompt = prompt + "\n Note that the provided function is in JavaScript."
338
+ prompt = prompt + "\n Note that the provided function is in JavaScript syntax ."
339
339
else :
340
- prompt = prompt + "\n Note that the provided function is in Python."
340
+ prompt = prompt + "\n Note that the provided function is in Python 3 syntax ."
341
341
return prompt
342
342
343
343
344
- def language_specific_pre_processing (function , test_category , string_param ):
344
+ def language_specific_pre_processing (function , test_category ):
345
345
if type (function ) is dict :
346
346
function = [function ]
347
347
if len (function ) == 0 :
@@ -350,27 +350,28 @@ def language_specific_pre_processing(function, test_category, string_param):
350
350
properties = item ["parameters" ]["properties" ]
351
351
if test_category == "java" :
352
352
for key , value in properties .items ():
353
- if value ["type" ] == "Any" or value ["type" ] == "any" :
354
- properties [key ][
355
- "description"
356
- ] += "This parameter can be of any type of Java object."
353
+ if value ["type" ] == "any" :
357
354
properties [key ]["description" ] += (
358
- "This is Java" + value [ " type" ] + " in string representation."
355
+ " This parameter can be of any type of Java object in string representation."
359
356
)
357
+ else :
358
+ value ["description" ] += (
359
+ " This is Java " + value ["type" ] + " in string representation."
360
+ )
361
+ value ["type" ] = "string"
362
+
360
363
elif test_category == "javascript" :
361
364
for key , value in properties .items ():
362
- if value ["type" ] == "Any" or value ["type" ] == "any" :
363
- properties [key ][
364
- "description"
365
- ] += "This parameter can be of any type of Javascript object."
366
- else :
367
- if "description" not in properties [key ]:
368
- properties [key ]["description" ] = ""
365
+ if value ["type" ] == "any" :
369
366
properties [key ]["description" ] += (
370
- "This is Javascript "
371
- + value ["type" ]
372
- + " in string representation."
367
+ " This parameter can be of any type of JavaScript object."
368
+ )
369
+ else :
370
+ value ["description" ] += (
371
+ " This is JavaScript " + value ["type" ] + " in string representation."
373
372
)
373
+ value ["type" ] = "string"
374
+
374
375
return function
375
376
376
377
0 commit comments