Skip to content
Open
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
28 changes: 25 additions & 3 deletions src/components/ConfigMenu/ConfigMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ export const ModelSelector = ({
_setModel: React.Dispatch<React.SetStateAction<ModelOptions>>;
}) => {
const [dropDown, setDropDown] = useState<boolean>(false);
const [advancedModels, setAdvancedModels] = useState<boolean>(false);

const filterModelOptions = () => {
if (advancedModels) {
return modelOptions;
} else {
return modelOptions.slice(0,modelOptions.indexOf('gpt-4-32k')+1);
}
};
const filteredModelOptions = filterModelOptions();

return (
<div className='mb-4'>
Expand All @@ -101,9 +111,9 @@ export const ModelSelector = ({
className='text-sm text-gray-700 dark:text-gray-200 p-0 m-0'
aria-labelledby='dropdownDefaultButton'
>
{modelOptions.map((m) => (
{filteredModelOptions.map((m,i) => (
<li
className='px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white cursor-pointer'
className={`px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white cursor-pointer${i === 0 ? " rounded-t-lg" : ""}${i > modelOptions.indexOf('gpt-4-32k') ? "text-gray-600 dark:text-gray-400" : ""}`}
onClick={() => {
_setModel(m);
setDropDown(false);
Expand All @@ -112,7 +122,19 @@ export const ModelSelector = ({
>
{m}
</li>
))}
))}
<li
className='px-4 py-0 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white cursor-pointer text-gray-600 dark:text-gray-300 flex justify-center items-center rounded-b-lg'
onClick={() => setAdvancedModels(!advancedModels)}
>
<span
className={`ml-2${
advancedModels
? "text-gray-700 dark:text-gray-300"
: "text-gray-500 dark:text-gray-500"
}`}
>{advancedModels ? '▲' : '▼'}</span>
</li>
</ul>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/constants/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export const modelOptions: ModelOptions[] = [
'gpt-3.5-turbo-16k',
'gpt-4',
'gpt-4-32k',
// 'gpt-3.5-turbo-0301',
// 'gpt-4-0314',
// 'gpt-4-32k-0314',
'gpt-3.5-turbo-0301',
'gpt-4-0314',
'gpt-4-32k-0314',
];

export const defaultModel = 'gpt-3.5-turbo';
Expand Down
5 changes: 1 addition & 4 deletions src/types/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ export interface Folder {
color?: string;
}

export type ModelOptions = 'gpt-4' | 'gpt-4-32k' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' ;
// | 'gpt-3.5-turbo-0301';
// | 'gpt-4-0314'
// | 'gpt-4-32k-0314'
export type ModelOptions = 'gpt-4' | 'gpt-4-32k' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0301'| 'gpt-4-0314' | 'gpt-4-32k-0314';

export type TotalTokenUsed = {
[model in ModelOptions]?: {
Expand Down