# 4.4. ChatGPT Code Interpreter

Some folks on the internet (ourselves included) are calling OpenAI's Code Interpreter a "game changer" and "the next evolution of ChatGPT capabilities." ChatGPT, besides being able to write code like an experienced computer programmer, can now execute that code for you thanks to Code Interpreter. This paves the wave for you to complete more advanced use-cases for using ChatGPT. For example, an estate planning attorney can upload a template of a Trust contract and have ChatGPT fill it out using the clients information. Or, a tax attorney can upload a spreadsheet of a client's stock trades and have Code Interpreter calculate capital gains and other relevant figures and export the results. A paralegal can have a client intake form generated as a PDF in seconds. There are countless scenarios where legal professionals might find the capabilities of Code Interpreter useful in accomplishing different tasks.

For the more technical reader, here is how OpenAI described it in their announcement in July 2023...

> *An experimental ChatGPT model that can use* [*Python*](#user-content-fn-1)[^1]*, handle uploads and downloads.*<br>
>
> *We provide our models with a working* [*Python interpreter in a sandboxed, firewalled execution environment*](#user-content-fn-2)[^2]*, along with some ephemeral disk space. Code run by our interpreter plugin is evaluated in a persistent session that is alive for the duration of a chat conversation (with an upper-bound timeout) and subsequent calls can build on top of each other.*<br>
>
> *We support uploading files to the current conversation workspace and downloading the results of your work.*

Let's go over one of the example use-cases we mentioned above using Code Interpreter. We previously used ChatGPT plugins to be able to upload a PDF and have ChatGPT answer questions and extract information from the document.&#x20;

In this example we'll have Code Interpreter generate a downloadable PDF of a client intake form commonly sent to new clients of law firms.

{% @arcade/embed flowId="nRYaPFHVFI4gE58oc0gN" url="<https://app.arcade.software/share/nRYaPFHVFI4gE58oc0gN>" %}

[^1]: Programming language heavily used in data science and other technology sectors.

[^2]: ChatGPT can now write software, and then execute it for you.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.legalpromptguide.com/4.-ethical-guardrails-and-professional-responsibility/4.4.-chatgpt-code-interpreter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
