Workspace features an OpenAI-powered AI Assistant that helps Workspace users to code better and smarter.
Generate will attempt to generate code based on a description
With "Generate", you can write what you want to do in natural language (e.g. English), and the AI assistant will produce a code or text snippet to achieve your intent. To use it:
- Create a new or select an existing text, code or SQL cell
- In the cell menu, click "Generate".
- In the prompt that appears, type what you want to AI to do and hit Enter.
- If the cell didn't have any content, a suggestion will start streaming in. If the cell already had content, after the suggestion is finished, a diff-view will be shown displaying the suggested changes.
Fix error will attempt to fix and explain the error you made
When you make a mistake in your code, you'll see a suggestion to "Fix Error". If you click this button, the AI will try to suggest a fix to your code and attempt to explain the code.
For a schematic overview of how the AI assistant works, see the visual below:
Conceptual overview of how the AI assistant gets good results.
Beyond merely sending your prompt to OpenAI, DataCamp Workspace adds additional context to the prompt, such as other variables that are defined in the workspace, the schema of connected databases (if any), previous code cells written, etc. Compared to copy pasting a prompt into ChatGPT, this approach generates way better suggestions because of all the additional information.
- Workspace nor OpenAI uses customer data to train models: the code or context that you pass to OpenAI will not appear as an answer to someone else's prompt.
- Workspace does not send your data to OpenAI. Actual records of data frames or records in database tables aren't sent over to OpenAI.
- Workspace does send workspace metadata to OpenAI. Database Metadata like table names, column names and types, and workspace context like previously written code and names and types of variables can be sent over to OpenAI to improve the quality of the suggestion.