Comments (10)
Something I’ve been playing with: summaries.
For example:
- “Create a function that does ____. Provide a summary of inputs and expected outputs”
- Load the function summary when making the next next request: “Create a component that does _______. Available functions in this project: (list of current function summaries).”
Refactors can have a first step where each function/class/pattern gets summarized and documented, then iterated through where GPT refactors each within the token window.
from shellgpt.
Yeah, automated code refactoring is definitely something you can hack together with ShellGPT and something I'm also very interested in.
ChatGPT does not seem natively very good at refactoring. It often omits details with a comment, and doesn't tend to apply deeper changes, at least in my naive tests. So, this requires more cleverness and specificity in prompting.
You'd then want to augment with some sort of smart retrieval mechanism for token limits, e.g. vector embeddings or on-demand file loading (running cd
, ls
, cat,
etc.). I've written some things on top of ShellGPT for this, which I might publish eventually, but it's not too complicated to bootstrap yourself.
Ideally you'd also have some typechecking or compilation feedback loop, like https://github.com/biobootloader/wolverine, automatically repairing errors that arise. The LSP idea is great too.
(Will leave this as an issue for now as easier to keep track of than separate discussions tab)
from shellgpt.
In playing around w/ the code interpreter for chat gpt+, when creating serde's for length delimited strings, I've watched gpt be smart enough to realize it can check itself by round-tripping the serde w/o me touching a single key. Via multiple trial/error runs, on it's own, gpt4 was able to figure out the correct code using the python interpreter. My jaw hit the floor as I watched, lol. I'm thinking we could do the same thing here w/ lsp's and various language compilers? All in a docker container?
Some things I'm unsure of, for the above automated loop, is it better to use system prompts or function calls? For the automated gpt4 driven trial/error editing/testing?
As the complexity grows in a codebase, confidence can be increased on large refactors by having gpt4 write lots of tests along the way?
Per the summaries idea mentioned above, I wonder if emacs/etags filtered via grep using symbols of the current refactor target could be another way?
There is also a server-mode for emacs, would there be any value in having gpt4 "drive it" ?
Please forgive all the rambling, lol, I have a very active mind ;)
from shellgpt.
Not saying I've never been frustrated w/ gpt4, but the more I use it, starts to feel like skiing w/ someone. A sort of "flow" starts to happen.
Let's ski this AI wave guys ;)
from shellgpt.
@mattvr I'm a dummy on vector embeddings, with respect to coding what's the best way for me to understand vector embeddings better? Also, would the gpt chat "fine tuning" coming in the fall be applicable here as well?
from shellgpt.
@mattvr I "think" gpt "function calls" can help fix the "deeper changes" problem?
from shellgpt.
https://platform.openai.com/docs/api-reference/chat/create#chat/create-function_call
from shellgpt.
This could also be used as a way to do search/replace/append editing of files from within the -x switch? Or something similar?
from shellgpt.
@mattvr played around w/ the chatgpt "code interpreter"?
from shellgpt.
Sorry for missing some of the comments here. I found https://github.com/paul-gauthier/aider recently which looks to help with refactoring files. Could be a good starting point!
from shellgpt.
Related Issues (20)
- Features suggestion HOT 5
- Support other models (like GPT4All) HOT 1
- API key not detected using Fish shell HOT 2
- configure removal of wpm limitation HOT 3
- Can't have line breaks in pasted input HOT 1
- Install script, `--repl` issues on Windows HOT 5
- howto gpt-4-32k ? HOT 1
- Add local model HOT 1
- Error when installing HOT 3
- Allow to set a custom OpenAI endpoint URL HOT 3
- Request: way to pass an image HOT 2
- System already had the same command? HOT 6
- gpt --config keeps prompting to update to newer version, even after updating HOT 2
- Request: be able to paste long pieces of text in repl mode HOT 3
- After updating to latest 0.3.8, gpt command doesn't return any response HOT 6
- Handle insufficient_quota error HOT 3
- Feature request: Able to log the answers of the gpt commands HOT 2
- Failed to start stream 429 Too Many Requests HOT 1
- I always wanted another model from hugging face on my terminal to run can you fix it please
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shellgpt.