AI assistance in a CoCalc
Help with coding
AI language models in CoCalc
Help fixing code
In this example, a code cell in a Jupyter Notebook returned an error. Clicking the botton to explain the error message creates a message addressed to ChatGPT, which asks for help and to fix the code.
With enough context – the few lines of input code and the lines in the stacktrace – it will attempt to fix the code for you. The fix might not be perfect, but it can be a good starting point.
Mention @chatgpt in any Chatroom in CoCalc
multiply two random matrices in pytorch
Sure enough, ChatGPT generates code that does exactly that. By copying that simple example into your Jupyter Notebook, the user can immediately run it and continue to play around with it.
@gemini to talk to Google's Gemini model.
Generate Jupyter Cells
In a Jupyter Notebook, you can tell a language model to generate a cell for you. This is useful if you want to explore a topic, but don't know where to start. In the example on the left, we ask ChatGPT to generate a cell for us about a linear regression for a stochastic process:
Write a short C program, which iterates over all numbers from 0 to 100 and sums up those, which are divisible by 7!
ChatGPT or Gemini can also generate source code for you. In the example displayed on the left, we first create an empty file named
c-program.cpp in C++. Next, we open the AI Assistant dialogue and prompt it to generate some code:
Writing documents in the typesetting language LaTeX can be challenging. In the example on the left, we ask ChatGPT to generate the LaTeX formulas for the Maxell equations. Sure enough, it answers with a short explanation and a snippet of LaTeX code.
On top of that, it can even assist you in fixing LaTeX error messages. the "Help me fix this…" button, and CoCalc will submit the error message, some context, and a prompt for correction. This will provide you with a useful indicator of the issue and potential solutions.
Start free today. Upgrade later.