Showcasing Codex

Hi, as I am completely new to the world of openai (only used it for a limited time), I figured I should showcase it to my manager to get his input on it.

I wanted to use it to generate some Javascript React code, and one thing I did not understand is the imports that the codex generates.

For example, asking it to generate react code for a checkbox list (also tried with checklist) with christmas movies will generate the following code, where it imports the ‘./checkbox’ file from the local storage.

I am curious if it actually generates that file and it’s only an issue with the generation/export. Or if it doesn’t and I should be the one to create it.

/* react component with simple checkbox list of 10 christmas movies */
var React = require('react');
var ReactDOM = require('react-dom');
var Checkbox = require('./checkbox.jsx');
var ChristmasMovie = React.createClass({
  render: function() {
    return (
      <div>
        <h1>{this.props.name}</h1>
        <Checkbox />
      </div>
    );
  }

/// Removed rest of the code from here on

Codex works similar to GPT-3 in that it is creating generations that seem “likely”. Since you asked:

Codex pulls what it knows about React, components and keywords you typed (Christmas, list, etc) to create a plausible output.

Things to try:

  • lower temperature to zero
  • use Codex results as a starting point for the regular coding process, mediate expectations for getting 100% correct results
1 Like

TLDR:
It’s not magic.