#Code Fixer - GPT assisted edits for VSCode !

40 messages Β· Page 1 of 1 (latest)

vestal gorge
#

Hello everyone! We just published this new vscode extension. New features will come in the next days, waiting for your feedback! πŸ™‚

gloomy valley
#

Interesesting, i will try.

#

Can i ask you something? Im looking for something to optimize Python scripts (300-400 lines) tried chat gpt but at some point it fails.

#

You have any idea if theres something or how can i manage to do it?

south coyote
#

would be nitce to have a video example of it working

#

not jsut for here, but for the vcsoce amrketplace

vestal gorge
#

try with our extension πŸ™‚

tame marsh
fair island
#

Is it free ?

tame marsh
#

It requires an openai account

fair island
tame marsh
#
OpenAI API Community Forum

Hi all! We’re rolling out new versions of GPT-3 and Codex! These models introduce two new capabilities, Insert and Edit that allow you to change existing text, rather than just completing it. Insert The new insert capability adds contextually relevant text in the middle of existing content, by providing the ability to not only specify a promp...

#

Only while it is in beta

fair island
#

Ok thx πŸ˜„ ❀️

gloomy valley
#

but im looking something to optimize my code wich is working but can be better.

#

a little example

#

categories_to_remove = ['Hombre', 'Ropa de Mujer', 'Zapatos', 'Zapatos de Mujer']
for category in categories_to_remove:
if category in sheincat and category in categories_to_remove:
sheincat.remove(category)
print("No esta en categories_to_remove")
else:
pass

vestal gorge
#

so, not really. actually it uses (again) the openai edit's api

#

so you can ask anything basically

#

if you can provide a complete snippet of code (this one misses vars) i can run it for you

gloomy valley
#

in that line if category in sheincat and category in categories_to_remove: "category in categories_to_remove" is redundant

vestal gorge
#

categories_to_remove = ['Hombre', 'Ropa de Mujer', 'Zapatos', 'Zapatos de Mujer', 'Ropa de Hombre']
sheincat = [category for category in sheincat if category not in categories_to_remove]

#

it returned me this

#

the prompt was : "improve code"

gloomy valley
#

let me try..

gloomy valley
#

can you try with this?

#

sheincat = []

for cat in categoriashein:
    categoria = cat.text
    categoria = categoria.replace("&", "&")
    sheincat.append(categoria)

sheincat = sheincat[1:-1]

categories_to_remove = ['Hombre', 'Ropa de Mujer', 'Zapatos', 'Zapatos de Mujer']
for category in categories_to_remove:
    if category in sheincat and category in categories_to_remove:
        sheincat.remove(category)
        print("No esta en categories_to_remove")
    else:
        pass
#

wait. lol

#

i dont know how to format it here

tame marsh
#

It gave me this:

categories_shein = driver.find_elements("xpath", '//div[@class="bread-crumb__inner"]//div[@class="bread-crumb__item"][a or span]')[1:-1]

sheincat = [cat.text.replace("&", "&") for cat in categories_shein]

categories_to_remove = ['Hombre', 'Ropa de Mujer', 'Zapatos', 'Zapatos de Mujer', 'Ropa de Hombre']
sheincat = [x for x in sheincat if x not in categories_to_remove]
#

I had to run it twice with the prompt "improve code"

#

but if you give it more elabored prompts, it could give you better results πŸ™‚

vestal gorge
#
categoriashein = driver.find_elements("xpath", '//div[@class="bread-crumb__inner"]//div[@class="bread-crumb__item"][a or span]')

sheincat = []

for cat in categoriashein:
    categoria = cat.text
    categoria = categoria.replace("&", "&")
    sheincat.append(categoria)

sheincat = sheincat[1:-1]

categories_to_remove = ["Hombre", "Ropa de Mujer", "Zapatos", "Zapatos de Mujer"]
for category in categories_to_remove:
    if category in sheincat and category in categories_to_remove:
        sheincat.remove(category)
        print("No esta en categories_to_remove")
    else:
        pass
#

it gave me this