Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using --server command in terminal leads to 404 not found #1330

Open
blazerfanbc opened this issue Jul 4, 2024 · 0 comments
Open

Using --server command in terminal leads to 404 not found #1330

blazerfanbc opened this issue Jul 4, 2024 · 0 comments

Comments

@blazerfanbc
Copy link

Describe the bug

Hey all-- I'm trying to use the --server flag in the terminal and it looks like it creates the Uvicorn server successfully, but whenever I try and send a command to it, I get a "404 not found" error. If I go to the 0.0.0.0:8000 in the browser I get a "page cannot be found" as well.

image

This is the code I am using to send the request to 0:0:0:0:8000 (React JS app):

let handleButtonClick = async () => {
        const response = await fetch('http://localhost:8000/', {
            method: 'POST',
            mode: 'no-cors',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify({ type: "websocket.receive", text: "open microsoft paint" }),
        });

        if (response.ok) {
            const eventSource = new EventSource(response.url);

            eventSource.onmessage = function (event) {
                setResponses((prevResponses) => [...prevResponses, event.data]);
            };

            eventSource.onerror = function () {
                console.error("EventSource failed.");
                eventSource.close();
            };
        } else {
            console.error("Failed to send message");
        }
    }

The server is definitely getting hit, because the terminal is logging the 404 not found error every time I send a request.

I noticed there isn't any documentation around using the --server flag, maybe it's not officially supported? Any help on this would be much appreciated.

Reproduce

  1. Open Terminal on Windows.
  2. Run, "interpreter --model gpt4o --auto_run --server"
  3. Wait for "Uvicorn running on http://0.0.0.0:8000" response.
  4. Send a POST request to the server.

Expected behavior

When I send a POST request to the server, I'd expect a 200 success code and OI to start running my request.

Screenshots

No response

Open Interpreter version

0.3.4

Python version

3.10.11

Operating System name and version

Windows 11

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant