Skip to content

Commit

Permalink
Removed deprecated gpt-3.5 and miograted to 4o
Browse files Browse the repository at this point in the history
  • Loading branch information
tristandostaler authored Sep 3, 2024
1 parent 2c899f0 commit fe9941e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/TokenCount/TokenCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const TokenCount = React.memo(() => {
state.chats ? (state.chats[state.currentChatIndex] ? state.chats[state.currentChatIndex].messages : []) : [],
shallow
);
var defaultModel = 'gpt-3.5-turbo' as keyof typeof modelCost;
var defaultModel = 'gpt-4o-mini' as keyof typeof modelCost;
const model = useStore((state) =>
state.chats
? state.chats[state.currentChatIndex] ? state.chats[state.currentChatIndex].config ? state.chats[state.currentChatIndex].config.model
Expand Down
12 changes: 1 addition & 11 deletions src/constants/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ export const _defaultSystemMessage =
'{{SystemPrompt}}';

export const modelCost = {
'gpt-3.5-turbo-16k': {
prompt: { price: 0.003, unit: 1000 },
completion: { price: 0.004, unit: 1000 },
modelMaxToken: 16384,
},
'gpt-3.5-turbo': {
prompt: { price: 0.002, unit: 1000 },
completion: { price: 0.002, unit: 1000 },
modelMaxToken: 4096,
},
'gpt-4': {
prompt: { price: 0.03, unit: 1000 },
completion: { price: 0.06, unit: 1000 },
Expand All @@ -50,7 +40,7 @@ export const modelCost = {

export const modelOptions: ModelOptions[] = Object.keys(modelCost) as ModelOptions[];

export const defaultModel = 'gpt-3.5-turbo-16k';
export const defaultModel = 'gpt-4o-mini';

export const minResponseSize = 500;

Expand Down
2 changes: 1 addition & 1 deletion src/constants/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Anything mention between [square brackets] in the features section is for you on
# Features:
- The main menu is on the left, on mobile it is always hidden and can be opened by clicking on the 3 lines icon. On desktop it can be closed or stay open (if closed it can be reopened like on mobile). This main menu has all the chats, and folders where chats can be organized.
- The chat menu is accessible on the top of the page when a chat is opened. This chat menu can modify settings for the opened chat. [There is no icon, all settings are accessible directly from the top of the page.] In this menu, we can modify: the model to use (like gpt-3.5-turbo and gpt-4), the organization to use, the max tokens, the temperature, the top-p, the presence penalty and the frequency penalty.
- The chat menu is accessible on the top of the page when a chat is opened. This chat menu can modify settings for the opened chat. [There is no icon, all settings are accessible directly from the top of the page.] In this menu, we can modify: the model to use (like gpt-4o-mini and gpt-4), the organization to use, the max tokens, the temperature, the top-p, the presence penalty and the frequency penalty.
- Main menu settings: this setting is acessible in the bottom of the main menu. If it is not visible, we can open it by clicking on the arrow at the bottom of the main menu. Once the bottom panel opened, we can click on "Settings" to access the settings windows. In these settings we can: change the language, toggle between the light and dark mode, toggle the feature to auto generate the chat title, toggle the feature to submit a prompt with enter, enable text to speech, access the prompt library which will be detailed later, modify the default chat configs, start or stop syncing with AppWrite (prefered) or Google Drive.
- Prompt library: The prompt library contains a collection of prompts that you can use to start a conversation. There are private prompts and synced / public prompts. You can also create your own prompts and save them to the private library for future use by clicking on the + icon after the private prompts section. The synced prompts are synced every 5 minutes. You can add new sync by filling the section "Add public prompts sync" and entering a name and a URL to a CSV containing the prompts. Please note that the CSV needs to be in a specific format to work. To remove a sync, go to the end of the modal window to see the synced prompts sources and click the X on the right of the synced prompt source to remove. You can also import to and export your private prompts.
- In a chat, there is a button with the icon "/" on which you can click to access the name of the prompts, configured in the prompt library, in a modal window above the chat. When a prompt is selected, it will replace the content of the next chat message to be sent. You can also open this model window by typing "/" at the start of the next chat message to send. You can use the arrows on your keyboard to navigate, and press enter to select a prompt to use.
Expand Down
20 changes: 20 additions & 0 deletions src/store/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,26 @@ export const migrateV14 = (persistedState: LocalStorageInterfaceV13ToV14) => {
});
};

export const migrateV15 = (persistedState: LocalStorageInterfaceV14ToV15) => {

Check failure on line 159 in src/store/migrate.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'LocalStorageInterfaceV14ToV15'. Did you mean 'LocalStorageInterfaceV4ToV5'?
persistedState.chats.forEach((chat) => {

Check failure on line 160 in src/store/migrate.ts

View workflow job for this annotation

GitHub Actions / build

Parameter 'chat' implicitly has an 'any' type.
if(chat.config.model.toString() == "gpt-3.5-turbo" || chat.config.model.toString() == "gpt-3.5-turbo-16k") {
chat.config.model = 'gpt-4o-mini';
}
});
if(persistedState.defaultChatConfig.model.toString() == "gpt-3.5-turbo" || persistedState.defaultChatConfig.model.toString() == "gpt-3.5-turbo-16k") {
persistedState.defaultChatConfig.model = 'gpt-4o-mini';
}
persistedState.prompts.forEach((prompt) => {

Check failure on line 168 in src/store/migrate.ts

View workflow job for this annotation

GitHub Actions / build

Parameter 'prompt' implicitly has an 'any' type.
prompt.prompt = prompt.prompt.replaceAll("~ Model: gpt-3.5-turbo-16k ~", "~ Model: gpt-4o-mini ~");
prompt.prompt = prompt.prompt.replaceAll("~ Model: gpt-3.5-turbo ~", "~ Model: gpt-4o-mini ~");
});

persistedState.publicPrompts.forEach((prompt) => {

Check failure on line 173 in src/store/migrate.ts

View workflow job for this annotation

GitHub Actions / build

Parameter 'prompt' implicitly has an 'any' type.
prompt.source = prompt.source.replaceAll("~ Model: gpt-3.5-turbo-16k ~", "~ Model: gpt-4o-mini ~")
prompt.source = prompt.source.replaceAll("~ Model: gpt-3.5-turbo ~", "~ Model: gpt-4o-mini ~")
});
};

export const migrateState = (persistedState: any, version: number) => {
switch (version) {
case 0:
Expand Down
4 changes: 4 additions & 0 deletions src/types/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,8 @@ export interface LocalStorageInterfaceV12ToV13

export interface LocalStorageInterfaceV13ToV14
extends LocalStorageInterfaceV12ToV13 {
}

export interface LocalStorageInterfaceV14ToV15
extends LocalStorageInterfaceV13ToV14 {
}

0 comments on commit fe9941e

Please sign in to comment.