appatalks / chatgpt-html

OpenAI & Google Generative Language Chat
MIT License
21 stars 12 forks source link

o1-preview o1-mini | BETA #63

Open appatalks opened 1 day ago

appatalks commented 1 day ago

New models o1-preview o1-mini made avail!

Just now gotta figure out they API calls.

Error 400: Invalid Request
{
  "error": {
    "message": "Unsupported value: 'messages[0].role' does not support 'system' with this model.",
    "type": "invalid_request_error",
    "param": "messages[0].role",
    "code": "unsupported_value"
  }
}
appatalks commented 1 day ago
| Model                  | Context window | Max output tokens | Training data  | 
|------------------------|----------------|-------------------|----------------| 
| o1-preview             | 128,000 tokens | 32,768 tokens     | Up to Oct 2023 | 
| o1-preview-2024-09-12  | 128,000 tokens | 32,768 tokens     | Up to Oct 2023 | 
| o1-mini                | 128,000 tokens | 65,536 tokens     | Up to Oct 2023 | 
| o1-mini-2024-09-12     | 128,000 tokens | 65,536 tokens     | Up to Oct 2023 | 
appatalks commented 1 day ago

"message": "Unsupported value: 'messages[0].role' does not support 'system' with this model.",

  model="o1-preview",
  messages=[
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
  ]

Well that's odd... API doc's don't show a structural difference between o1 and other models... (see further down below)

Quick Start Guide is different:

    model="o1-preview",
    messages=[
        {
            "role": "user", 
            "content": "Write a bash script that takes a matrix represented as a string with format '[1,2],[3,4],[5,6]' and prints the transpose in the same format."
        }
    ]

Other Gotcha's:

appatalks commented 1 day ago

Maybe I can introduce an if statement here while we are in beta to excluded system from the call, and having sModel === "o1-preview|o1-mini" or something like that.,

      const iMessages = [
        { role: 'system', content: 'You are Eva. You have access to previous chats and responses. You have access to real-time news, information and media. You will keep conversation to a minimum and answer to the best of your abilities. When you are asked to show an image, instead describe the image with [Image of <Description>].' },
        { role: 'user', content: selPers.value + " " + dateContents },
      ];

      // Store the initial messages in localStorage
      localStorage.setItem("messages", JSON.stringify(iMessages));
    }

Also need to update the max_tokens parameter to be max_completion_tokens