by jamesponddotco · 2y ago · 0 comments
> Acting as an expert Go developer, write a RoundTripper that retries failed HTTP requests, both GET and POST ones.
GPT-4 takes a few tries but usually takes the POST part into account, saving the body for new retries and whatnot. Phind in the other hand, in the two or three times I tried, ignores the POST part and focus on GET only.
Maybe that problem is just too hard for LLMs? Or the prompt sucks? I'll see how it handle other things since I still have a few tries left.
EDIT: ah, followup replies elucidated me, it's just a goofy name for a Go-only thing
Just tried your query now and it seemed to work well -- what are your thoughts?
https://www.phind.com/search?cache=k56i132ekpg43zdc7j5z1h1x
I'll give chat mode a try. Didn't see that it existed until now.
EDIT
Chat mode didn't do much better:
https://www.phind.com/agent?cache=clsxpl4t80002l008v3vjqw5j
For the record, this is the interface I asked it to implement:
Phind-70B seems to be able to get the right interface every time. Please make sure that it says Phind-70B at the top of the page while it's generating.
Phind still forgot about POST, but at least now it got the interface right.
Only on running the code did I realize that it wasn't doing anything to handle the problem of the request body, where it works on the first attempt, but the ReadCloser is empty on subsequent attempts. It looks like Phind-70B corrected this issue once it was pointed out.
I've seen GPT-4 make plenty of small mistakes when generating code, so being iterative seems normal, even if GPT-4 might have this one specific brain teaser completely memorized.
I am not at the point where I expect any LLM to blindly generate perfect code every time, but if it can usually correct issues with feedback from an error message, then that's still quite good.
There are countless well-documented RoundTripper implementations that handle this case correctly.
This is the sort of thing you whip up in three minutes and move along. To me it seems like a perfect test of LLMs. I don't need an injection of something that's worse than stackoverflow polluting the code I work on.
Eg. Tree of thoughts, ...