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

Adding o1 model and updating endpoint usage #64

Merged
merged 4 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/js/gpt-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function trboSend() {

// payload parameters
var sModel = selModel.value;
var iMaxTokens = 4096; // Try to set the max_tokens value as close to your expected response size as possible.
var iMaxTokens = 4096; // Try to set the max_completion_tokens value as close to your expected response size as possible.
// if (sModel === "gpt-4o") {
// iMaxTokens = 4096;
// } else if (sModel === "gpt-3.5-turbo-16k") {
Expand All @@ -180,7 +180,7 @@ function trboSend() {
if (!localStorage.getItem("messages")) {
// If it does not exist, create an array with the initial messages
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: 'developer', 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 },
];

Expand Down Expand Up @@ -258,7 +258,7 @@ function trboSend() {
var data = {
model: sModel,
messages: kMessages,
max_tokens: iMaxTokens,
max_completion_tokens: iMaxTokens,
temperature: dTemperature,
frequency_penalty: eFrequency_penalty,
presence_penalty: cPresence_penalty,
Expand Down Expand Up @@ -302,7 +302,7 @@ function trboSend() {
var data = {
model: sModel,
messages: kMessages,
max_tokens: iMaxTokens,
max_completion_tokens: iMaxTokens,
temperature: dTemperature,
frequency_penalty: eFrequency_penalty,
presence_penalty: cPresence_penalty,
Expand Down
9 changes: 5 additions & 4 deletions core/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ function autoSelect() {
switch (selModel.value) {
case "gpt-4o-mini":
case "gpt-4o":
case "o1-mini": // limited beta
case "o1-preview": // limited beta
case "o1": // tier liminted
case "o1-mini":
case "o1-preview":
trboSend();
break;
case "gemini":
Expand Down Expand Up @@ -116,7 +117,7 @@ function updateButton() {
clearText();
autoSelect();
};
} else if (selModel.value == "gpt-4o-mini" || selModel.value == "o1-mini" || selModel.value == "gpt-4o" || selModel.value == "o1-preview") {
} else if (selModel.value == "gpt-4o-mini" || selModel.value == "o1" || selModel.value == "o1-mini" || selModel.value == "gpt-4o" || selModel.value == "o1-preview") {
btnSend.onclick = function() {
clearText();
trboSend();
Expand Down Expand Up @@ -148,7 +149,7 @@ function sendData() {
if (selModel.value == "auto") {
clearText();
autoSelect();
} else if (selModel.value == "gpt-4o-mini" || selModel.value == "o1-mini" || selModel.value == "gpt-4o" || selModel.value == "o1-preview") {
} else if (selModel.value == "gpt-4o-mini" || selModel.value == "o1" || selModel.value == "o1-mini" || selModel.value == "gpt-4o" || selModel.value == "o1-preview") {
clearText();
trboSend();
} else if (selModel.value == "gemini") {
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<option value="auto" title="Default">auto</option>
<option value="gpt-4o-mini" title="gpt-4o-mini">gpt-4o-mini</option>
<option value="gpt-4o" title="gpt-4o">gpt-4o</option>
<option value="o1" title="o1">o1</option>
<option value="o1-preview" title="o1-preview">o1-preview</option>
<option value="o1-mini" title="o1-mini">o1-mini</option>
<option value="dall-e-3" title="Image Generation">dall-e-3</option>
Expand Down
Loading