Skip to content

Commit 8472fdc

Browse files
committed
Make gpt-4o the new default model
1 parent cacb9ae commit 8472fdc

File tree

1 file changed

+50
-35
lines changed

1 file changed

+50
-35
lines changed

composables/useAssistant.ts

Lines changed: 50 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,54 @@ import {
88
useStorage,
99
} from 'vellma/peripherals'
1010

11+
type ModelOption = {
12+
id: string,
13+
label: string,
14+
contextWindow: string,
15+
comingSoon?: boolean,
16+
disabled?: boolean,
17+
}
18+
19+
const defaultLanguageModels: ModelOption[] = [
20+
{
21+
id: 'gpt-4o',
22+
label: 'GPT-4o',
23+
contextWindow: '128k',
24+
},
25+
{
26+
id: 'gpt-4-turbo',
27+
label: 'GPT-4 Turbo',
28+
contextWindow: '128k',
29+
},
30+
{
31+
id: 'gpt-4-turbo-preview',
32+
label: 'GPT-4 Turbo (Preview)',
33+
contextWindow: '128k',
34+
},
35+
{
36+
id: 'gpt-4-vision-preview',
37+
label: 'GPT-4 Turbo Vision',
38+
contextWindow: '128k',
39+
comingSoon: true,
40+
disabled: true,
41+
},
42+
{
43+
id: 'gpt-4',
44+
label: 'GPT-4',
45+
contextWindow: '8k',
46+
},
47+
{
48+
id: 'gpt-4-32k',
49+
label: 'GPT-4 (32k)',
50+
contextWindow: '32k',
51+
},
52+
{
53+
id: 'gpt-3.5-turbo-0125',
54+
label: 'GPT-3.5 Turbo',
55+
contextWindow: '16k',
56+
},
57+
]
58+
1159
export const dexieStorage = (): StorageAdapter => {
1260
const { db } = useDatabase()
1361

@@ -50,7 +98,7 @@ export const dexieStorage = (): StorageAdapter => {
5098
}
5199
}
52100

53-
export const useAssistant = ({ chatId, languageModel = ref({ id: 'gpt-4-1106-preview', label: 'GPT-4 Turbo' }) }: { chatId: Ref<string>, languageModel?: Ref<{ id: string, label: string }> }) => {
101+
export const useAssistant = ({ chatId, languageModel = ref(defaultLanguageModels[0]) }: { chatId: Ref<string>, languageModel?: Ref<ModelOption> }) => {
54102
const storageAdapter = dexieStorage()
55103
const apiKey = useLocalStorage<string>('openAiApiKey', '', {
56104
initOnMounted: true,
@@ -63,40 +111,7 @@ export const useAssistant = ({ chatId, languageModel = ref({ id: 'gpt-4-1106-pre
63111
const chatModel = computed(() => chatInterface.value.model)
64112
const chatFactory = computed(() => chatInterface.value.factory)
65113

66-
const languageModels = ref([
67-
{
68-
id: 'gpt-4-turbo',
69-
label: 'GPT-4 Turbo',
70-
contextWindow: '128k',
71-
},
72-
{
73-
id: 'gpt-4-turbo-preview',
74-
label: 'GPT-4 Turbo (Preview)',
75-
contextWindow: '128k',
76-
},
77-
{
78-
id: 'gpt-4-vision-preview',
79-
label: 'GPT-4 Turbo Vision',
80-
contextWindow: '128k',
81-
comingSoon: true,
82-
disabled: true,
83-
},
84-
{
85-
id: 'gpt-4',
86-
label: 'GPT-4',
87-
contextWindow: '8k',
88-
},
89-
{
90-
id: 'gpt-4-32k',
91-
label: 'GPT-4 (32k)',
92-
contextWindow: '32k',
93-
},
94-
{
95-
id: 'gpt-3.5-turbo-0125',
96-
label: 'GPT-3.5 Turbo',
97-
contextWindow: '16k',
98-
},
99-
])
114+
const languageModels = ref(defaultLanguageModels)
100115

101116
return {
102117
apiKey,

0 commit comments

Comments
 (0)