diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte
index f68f29ff..17558c2b 100644
--- a/src/lib/components/chat/SettingsModal.svelte
+++ b/src/lib/components/chat/SettingsModal.svelte
@@ -334,7 +334,7 @@
- Adds optional support for 'gpt-3.5-turbo'.
+ Adds optional support for 'gpt-*' models available.
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 0acb33ba..cd87cba3 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -365,7 +365,7 @@
if (settings.OPENAI_API_KEY) {
// Validate OPENAI_API_KEY
- const openaiModels = await fetch(`https://api.openai.com/v1/models`, {
+ const openaiModelRes = await fetch(`https://api.openai.com/v1/models`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@@ -381,14 +381,16 @@
toast.error(`OpenAI: ${error.error.message}`);
return null;
});
-
- console.log(openaiModels);
+ const openaiModels = openaiModelRes.data;
if (openaiModels) {
models = [
...(res?.models ?? []),
{ name: 'hr' },
- { name: 'gpt-3.5-turbo', label: '(OpenAI)' }
+
+ ...openaiModels
+ .map((model) => ({ name: model.id, label: 'OpenAI' }))
+ .filter((model) => model.name.includes('gpt'))
];
} else {
models = res?.models ?? [];
@@ -401,7 +403,7 @@
};
const sendPrompt = async (userPrompt) => {
- if (selectedModel === 'gpt-3.5-turbo') {
+ if (selectedModel.includes('gpt-')) {
await sendPromptOpenAI(userPrompt);
} else {
await sendPromptOllama(userPrompt);
@@ -532,7 +534,7 @@
Authorization: `Bearer ${settings.OPENAI_API_KEY}`
},
body: JSON.stringify({
- model: 'gpt-3.5-turbo',
+ model: selectedModel,
stream: true,
messages: messages.map((message) => ({ ...message, done: undefined }))
})