DEV Community

Cover image for Using ChatGPT to Document your Software Project
Thomas Hansen
Thomas Hansen

Posted on • Updated on

Using ChatGPT to Document your Software Project

At Aista we are literally doing nothing else than machine learning and AI these days. You can see some of our Machine Learning and AI initiatives here. The reasons are obvious.

ChatGPT and OpenAI is simply the hottest and coolest thing I've seen since I discovered computers at the age of 8

Look at the following picture, and realise the documentation parts in the top right corner was automatically generated by selecting some Hyperlambda code and clicking F1.

Documenting software using ChatGPT

As far as I'm concerned the above is nothing less of a software development miracle! It was created by scraping our documentation website for machine learning training data. Then we simply included an API call inside our Magic Dashboard towards OpenAI API when users clicks F1, passing in the selected code to have ChatGPT explain the code. Let me repeat the important parts of the above screenshot such that it's not "lost in translation".

Machine learning software documentation

The implications of Machine Learning

Machine learning is often associated with having humans teaching the machine something new. I suspect one of the long term implications of having access to amazing AI will inevitably be that the machine will start teaching humans. For instance, I wrote the documentation for our website. In doing so I taught the machine everything it needs to know to understand Hyperlambda. Now the machine can learn everybody else Hyperlambda, at a speed I couldn't even imagine previously.

If I was to help people understand Hyperlambda, teaching it with the same amount of quality as our integrated ChatGPT help system can do would require days, if not weeks. And at most I could maybe handle a handful of junior software developers at the same time. With the integrated ChatGPT based help system, "I" can literally teach millions of people simultaneously. Philosophically you could argue that ...

I have "uploaded" my brain to OpenAI, such that I can "replicate" myself a million times

This of course makes me a million times more productive, allowing "me" to do a million things simultaneously, while the "real me" can enjoy umbrella drinks at some beach in the Caribbean, having OpenAI and ChatGPT do my work. The implications of this are profound!

Documenting your software using ChatGPT

If you've got a software project, you can document your project just as easily as I did. The process is dead simple;

  1. Register at Aista.com
  2. Create a cloudlet
  3. Use the machine learning component to scrape your documentation website for training data, resulting in a custom AI model
  4. Inject the ChatBot HTML code into your website, and / or use the API endpoint created by Aista anywhere you want

The way our F1 trick works, is that we use the currently selected code from our code editor, and we prefix it with; "Explain this code". Then we send it through our API to ChatGPT, the "text-davinci-003" model, the guy with 1.7 billion parameters, and VOILA! 100% perfect answers every single time.

Assuming you've got great documentation for your software, you can literally do the entire job in less than 5 minutes. If you want to try it out for yourself, signup at hub and create your own cloudlet - Or download the open source version if you want to play around locally. For the record, we would appreciate a star at our GitHub repository if you do the latter. In the video below I am walking you through how these parts works in our software.

You can use this on any snippet of Hyperlambda, as long as you don't select too much code at the same time. ChatGPT and OpenAI have limits in regards to how long questions you can ask, and the selected code basically becomes your "prompt". So don't select more than maybe some 20 lines of code maximum, or it might fail.

If you're too lazy to signup, you could also ask your question at our integrated ChatGPT based support chatbot of course. Try to ask it about Hyperlambda, Aista or Magic Cloud, and see how it responds.

Top comments (0)