4 ms·
I'd be worried about the per-token-cost of using the OpenAI API when submitting an entire codebase. And, I'd probably only use it with open-source codebases.
by photochemsyn 4y ago
I'd be worried about the per-token-cost of using the OpenAI API when submitting an entire codebase. And, I'd probably only use it with open-source codebases.
I've been using chatblade, it has the nice feature of having a cost estimate call:
https://news.ycombinator.com/item?id=35223759 https://news.ycombinator.com/item?id=35223759
As to how to use GPT to help with coding, I wanted to be able to store the chatblade output to a file with a simple one-word call, so I wrote a wrapper that does that, and the first step was to submit this question to GPT:
> "I want to use Python's subprocess module in a script (that takes command-line arguments) to manage a call to an OpenAI API (that takes a variable amount of time to complete), and which prints output to the terminal, and I also want to tee that output to a specified file for storage. What do you recommend, from the perspective of an expert Python programmer?"
It laid out a nice template using several python modules, and I was able to write it in a single morning with a little bit of additional reference to pydocs and a few more questions about specifics, so now all the command-line queries get appended to a file with an up-to-date cost estimate attached to each one. And I'm pretty junior as far as programming goes.
- deathmonger5000 4y agoThanks, chatblade looks cool I'll check it out! I've found GPT to be a phenomenal tool for solving problems with code.