Hacker News new | ask | show | jobs
by tantony 1289 days ago
Where can I find api.py?
3 comments

There is no api.py, as OpenAI has not yet chosen to release an API, I'm not releasing a reverse engineered version. If anyone wants to use it, you have to unfortunately make it work yourself.

The OpenAI CEO has already sort of implied there may be an API before Christmas, and if so I'd be willing to clean things up, and make it as convenient as it should be.

Maybe I’m missing something but isn’t the whole point to actually release api.py? Everything else seems trivial.
The GPT-3 model has an API, and can do a lot of this
If you look at the dockerfile you can see that it’s copied from alice.py
I believe you misread that.

COPY alice.py api.py /

will copy both the files alice.py and api.py to the root of the docker image (same as cp).

https://docs.docker.com/engine/reference/builder/#copy

Ask ChatGPT to create one for you

(Note: although this is a joke, it's probably actually possible to do). Here's how it handles signing up for hacker news:

Prompt:

---

There is a website with a login form at https://news.ycombinator.com/login with a username and password field. Write a javascript function that creates a new user on that page with a random username and password and returns the credentials

Output (the second output was better than the first):

---

Here is an example of a JavaScript function that could be used to create a new user on the Hacker News login page:

    // Function for creating a new user on the Hacker News login page

    // This function takes in the following parameters:
    // - username: the desired username for the new account
    // - password: the password for the new account

    function createHackerNewsUser(username, password) {
        // First, we need to navigate to the login page
        window.location.href = "https://news.ycombinator.com/login";

        // Next, we need to find the username and password fields on the page
        const usernameField = document.querySelector("input[name='acct']");
        const passwordField = document.querySelector("input[name='pw']");

        // Once we have found the fields, we can fill them in with the provided username and password
        usernameField.value = username;
        passwordField.value = password;

        // Finally, we can submit the form to create the new user
        document.querySelector("form").submit();

        // Once the form is submitted, the page will redirect to the user's profile page
        // We can return the username and password as an object to the caller
        return { username, password };
    }
This function can be used as follows:

    // Example usage of the createHackerNewsUser function

    // Generate a random username and password
    const username = "user" + Math.random().toString(36).substring(7);
    const password = Math.random().toString(36).substring(7);

    // Attempt to create a new user on the Hacker News login page
    const credentials = createHackerNewsUser(username, password);
    console.log("Successfully created a new user on Hacker News with the following credentials:", credentials);
Please note that this function is just an example and has not been tested. It is also worth mentioning that creating users on a website without the permission of the website owner is generally considered to be a bad idea. This function is provided for educational purposes only.