Live data from Hacker News

Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

github.com

11–20 of 36 posts

Re: Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

#11

What does it take to make a basic ChatGPT-like frontend, with code highlighting, run in sandbox, drop-files, and 'acting' in prompts? Clone away and enjoy. First time poster

Thanks, it is good :) You don’t need the serverside though; you can just call openai apis straight from the client. Makes things easier!

If you call the openai API's straight from the FrontEnd, you are likely leaking your api keys to visitors who can then use your api keys (and api key limits) for their own purposes.

Re: Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

#12
post #8

But I need an GPT-4 api key for that, right? The normal API keys don't work?

The keys for GPT3 (`GPT-3.5-turbo` is the actual model ID) is the same as for GPT-4. You define the model when you make the request to the API.

Re: Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

#13
post #11

Earlier quoted context omitted.

Thanks, it is good :) You don’t need the serverside though; you can just call openai apis straight from the client. Makes things easier!

If you call the openai API's straight from the FrontEnd, you are likely leaking your api keys to visitors who can then use your api keys (and api key limits) for their own purposes.

Nah, you ask them to enter their own; if you use yours, then yes, only use backend. In this case, the author is not using his, you have to bring your own, so frontend is fine.

Re: Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

#15
post #8

But I need an GPT-4 api key for that, right? The normal API keys don't work?

The keys for GPT3 (`GPT-3.5-turbo` is the actual model ID) is the same as for GPT-4. You define the model when you make the request to the API.

Does this work if you only have GPT-4 access via a ChatGPT subscription (ChatGPT Plus)?

Re: Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

#16
post #15

Earlier quoted context omitted.

The keys for GPT3 (`GPT-3.5-turbo` is the actual model ID) is the same as for GPT-4. You define the model when you make the request to the API.

Does this work if you only have GPT-4 access via a ChatGPT subscription (ChatGPT Plus)?

It doesn't. Even if you have ChatGPT Plus, the key you have only supports 3.5 unless you are explicitly given the gpt-4 key.

Re: Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

#17
post #16
post #15

Earlier quoted context omitted.

Does this work if you only have GPT-4 access via a ChatGPT subscription (ChatGPT Plus)?

It doesn't. Even if you have ChatGPT Plus, the key you have only supports 3.5 unless you are explicitly given the gpt-4 key.

There seems to be already a PR for adding 3.5 support. The community and speed of change in this field is mind blowing!

Re: Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

#18
post #8

But I need an GPT-4 api key for that, right? The normal API keys don't work?

Seems to fall back to GPT 3 if you haven't got access to GPT 4 API yet

hmm... doesn't seem to be the case, when I provided my gpt-3 turbo key the error message indicates the gpt-4 model doesn't exist.

Re: Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

#19
post #16
post #15

Earlier quoted context omitted.

Does this work if you only have GPT-4 access via a ChatGPT subscription (ChatGPT Plus)?

It doesn't. Even if you have ChatGPT Plus, the key you have only supports 3.5 unless you are explicitly given the gpt-4 key.

It's true that you need explicit access to the GPT-4 to use the API, but again, it's not a different key. I'm using the same API key for accessing `gpt-3.5-turbo` as I use for `gpt-4`.

Re: Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4

#20
post #6

What does it take to make a basic ChatGPT-like frontend, with code highlighting, run in sandbox, drop-files, and 'acting' in prompts? Clone away and enjoy. First time poster

What do you mean by “acting”? That it pretends to be a Scientist? Or that it can perform actions (like sending an email or searching the web)? If the latter, do you have more info/docs about it? Didn’t see it on the roadmap.

You can kind of program something around the API to make it able to perform actions. That's the way I'm guessing Microsoft did it with Bing. Here is an example:

System prompt:

    - You are a text-based AI delegates to other AIs.
    - You only respond in JSON with two keys `delegate_to` and `parameters`.
    - `delegate_to` defines what other AI you should delegate to.
    - `parameters` are parameters to send to that AI.
    - Here is the list of possible delegates
    - delegate_to: email_ai, parameters: $to $subject $body, used for sending emails
    - delegate_to: calendar_ai, parameters: $time, $date, $title, used for creating events in a calendar
    - delegate_to: search_ai, parameters: $search-term
    - Be creative and helpful.
    - Your goal is to take user input and successfully delegate the task you receive from the user to the correct AI.
    - Your initial message to the user should welcome them and ask them what you can do for them.
    
Example conversation:

    > {"message": "Welcome! I'm your AI assistant. What can I do for you today?"}
    
    > User: Send email to john@example.com asking if he wants to have dinner tonight
    
    {
      "delegate_to": "email_ai",
      "parameters": {
        "to": "john@example.com",
        "subject": "Dinner Invitation",
        "body": "Hi John, would you like to have dinner together tonight? Let me know your thoughts. Best regards."
      }
    }
Then you'd make your program read the JSON messages it generates and perform the correct action.
Post reply on HN