News for hackers. Stuff that matters.
Re:What Is ChatGPT Doing and Why Does It Work? by scarface74 on Wednesday February 15, 2023 @12:27AM (#34800434)
This is a script I told ChatGPT wrote

“Write a Python script that returns a comma separated list of arns of all AWS roles that contain policies I specify with the “-p” parameter using argparse”

Then I noticed there was a bug, AWS API calls are paginated and it would only return the first 50 results.

“that won’t work with more than 50 roles”

Then it modified the code to use “paginators”

Yes, you can find similar code on StackOverflow

https://stackoverflow.com/questions/66127551/list-of-all-rol...

But ChatGPT met my specifications exactly.

ChatGPT “knows” the AWS SDK for Python pretty well. I’ve used it to write a dozen or so similar scripts. Some more complicated than the others.

Re:What Is ChatGPT Doing and Why Does It Work? by jeremyjh on Wednesday February 15, 2023 @12:35AM (#34800485)
Ok that actually sounds hugely useful. It makes sense for very well known APIs it will get them quite accurately.
Re:What Is ChatGPT Doing and Why Does It Work? by scarface74 on Wednesday February 15, 2023 @01:01AM (#34800614)
I wonder how well it would work if you seeded it with the inputs and outputs of custom APIs and then tell it to write code based on your API.
Re:What Is ChatGPT Doing and Why Does It Work? by jeremyjh on Wednesday February 15, 2023 @01:35AM (#34800775)
Well I'd hope that is what is going on in Copilot. It definitely does seem to be trained on my code to some extent, but it doesn't have anything I'd call a semantic understanding of it.