Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Incubator Q&A

Welcome to the staging ground for new communities! Each proposal has a description in the "Descriptions" category and a body of questions and answers in "Incubator Q&A". You can ask questions (and get answers, we hope!) right away, and start new proposals.

Are you here to participate in a specific proposal? Click on the proposal tag (with the dark outline) to see only posts about that proposal and not all of the others that are in progress. Tags are at the bottom of each post.

Comments on How to get back only code from ChatGPT responses?

Post

How to get back only code from ChatGPT responses? Question

+3
−0

I want to use ChatGPT to edit individual source code files. When I give it the file and state what changes I want, it tends to do those quite well, but it's also very chatty and includes a lot of explanation that I don't care about. Is it possible to get just the code in my responses?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

2 comment threads

Existing examples (2 comments)
Distinguishing features (1 comment)
Existing examples
trichoplax‭ wrote over 1 year ago · edited over 1 year ago

I don't know the names off hand, but I believe there are automated projects already using large language models for development assistance in the following form:

  1. Ask for code to solve a problem.
  2. Ask for a solution if it does not compile.
  3. Ask for problems with the code.
  4. Ask for solutions to those problems.
  5. Repeat until no further problems are detected.

I would expect such a project to either already have the solution you are seeking, or to have found a way to work around it.

Mentioning in case anyone more familiar wants to write an answer based on such a project.

trichoplax‭ wrote over 1 year ago

I believe the example I heard of involved the Rust programming language if that helps in searching online.