ChatGPT can transform how you use CoCalc for learning, writing programs, and writing scientific documents.
Here are some areas where CoCalc’s context-sensitive ChatGPT help can save you time and effort:
You can read all CoCalc ChatGPT announcements to date and join the discussion at the links shown:
Cocalc chatrooms now support reply message threads, and chatgpt now has “long memory” of the entire thread it was involved in.
CoCalc Jupyter notebooks now have a new “Explain” button in Jupyter notebooks.
Easily use the OpenAI ChatGPT API from your Jupyter notebooks in CoCalc.
Have you ever been using a Jupyter notebook and got an error message? You can now click a button and ChatGPT will automatically try to figure out how to fix the error and tell you in a chat next to your main document.
It is often helpful to chat back and forth with ChatGPT in Side Chat to refine the initial answer. Use the “Reply” button in side chat to ask follow-up questions.
ChatGPT can help you understand and fix execution errors in a Jupyter notebook code cell.
Here is an example of a code suggestion using ChatGPT with a python Jupyter notebook.
Sample request: plot time series data using a pandas dataframe
Ask the question in the ChatGPT box above the Jupyter notebook.
Copy the code from the response in side chat.
Paste the code into a notebook code cell.
Inspect the code for correctness.
Run the code.
ChatGPT can explain what is going on in a Jupyter notebook code cell.
The “Explain” button in the upper right of the cell always uses exactly the current cell.
The “ChatGPT” button at the top uses: the current selection, or if there is no selection, the current cell, or if the cell is empty, all the cells.
You can get help from ChatGPT when an error occurs while running a sage worksheet, too. See ChatGPT help with sage worksheets for details.
Editing Python, R, and Other Files
For programming language file types such as .py, .R, pl, and .c, the CoCalc Frame Editor includes ChatGPT buttons in the top menu. ChatGPT editor support actually works for hundreds of file types (basically everything that exists), including LaTeX (“.tex”) and R markdown (“.rmd”).
Open a .py file in CoCalc.
Notice there’s a ChatGPT button in the top menu bar.
ChatGPT in combination with the Linux terminal is extremely powerful, because ChatGPT can help you write a script for any command that can be invoked from the command shell. See the next subsections for example.
Linux Terminal windows include a ChatGPT button at the top.
Suggest Code for Shell Scripts
You can get help with basic shell scripting as well as with advanced CoCalc commands.
replace ‘x’ by ‘y’ in all files
how can I use pari/gp to compute the number of primes up to 2023
count the total number of lines of code in all coffeescript files under git in all subdirectories then follow-up with: can you exclude counting blank lines and comments?
write a SQL query with psql - full example below.
Help Writing SQL Queries
I am using psql to query a table with a column called “time”. I would like to make a table showing the number of entries in my table for each of the last 7 days.
Typeset Scientific Content with LaTeX
You can describe a formula in English and have ChatGPT turn it into a latex formula. Sample requests:
Use latex to typeset the following formula: the integral from 0 to infinity of sin(x^2)
Use latex to typeset the following formula: (a + b + c) / alpha
ChatGPT on Sign-in and Feature Pages
You can ask a question at the start of your CoCalc session. ChatGPT help boxes are at the top of the sign-in page and all feature headings (landing pages).
ChatGPT is available near the top of the CoCalc features main page and each of the individual feature pages.
ChatGPT in Chat Rooms and Side Chat
In a chat room or in the side chat next to an open file, you can do an @-mention of ChatGPT and enter your question there.
CoCalc Admins: add ChatGPT to your site
CoCalc-Docker: ChatGPT integration in latest image.