From 57bacd9cbc87450fd8d7340a4cf2a492946d78a2 Mon Sep 17 00:00:00 2001 From: Morgan Date: Sun, 28 Apr 2024 17:05:25 +0900 Subject: [PATCH 1/2] Added gpt-4-turbo-2024-04-09 Fixed EventStreamContentType --- src/lib/providers/openai/models.svelte | 1 + src/lib/providers/openai/request.svelte | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/providers/openai/models.svelte b/src/lib/providers/openai/models.svelte index 837269e9..1575b7e8 100644 --- a/src/lib/providers/openai/models.svelte +++ b/src/lib/providers/openai/models.svelte @@ -97,6 +97,7 @@ export const chatModels : Record = { 'gpt-3.5-turbo-16k-0613': { ...gpt3516k }, 'gpt-4': { ...gpt4 }, 'gpt-4-turbo-preview': { ...gpt4128kpreview }, + 'gpt-4-turbo-2024-04-09': { ...gpt4128kpreview }, 'gpt-4-0314': { ...gpt4 }, 'gpt-4-0613': { ...gpt4 }, 'gpt-4-1106-preview': { ...gpt4128kpreview }, diff --git a/src/lib/providers/openai/request.svelte b/src/lib/providers/openai/request.svelte index 40c0d7e5..c35daa19 100644 --- a/src/lib/providers/openai/request.svelte +++ b/src/lib/providers/openai/request.svelte @@ -66,7 +66,7 @@ export const chatRequest = async ( throw err }, async onopen (response) { - if (response.ok && response.headers.get('content-type') === EventStreamContentType) { + if (response.ok && response.headers.get('content-type').startsWith(EventStreamContentType)) { // everything's good } else { // client-side errors are usually non-retriable: From 290a98fd877b1b5eb1fafba43b866d2dfbdee145 Mon Sep 17 00:00:00 2001 From: Morgan Date: Sun, 28 Apr 2024 17:15:04 +0900 Subject: [PATCH 2/2] linting...... --- src/lib/providers/openai/models.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/providers/openai/models.svelte b/src/lib/providers/openai/models.svelte index 1575b7e8..44338155 100644 --- a/src/lib/providers/openai/models.svelte +++ b/src/lib/providers/openai/models.svelte @@ -97,7 +97,7 @@ export const chatModels : Record = { 'gpt-3.5-turbo-16k-0613': { ...gpt3516k }, 'gpt-4': { ...gpt4 }, 'gpt-4-turbo-preview': { ...gpt4128kpreview }, - 'gpt-4-turbo-2024-04-09': { ...gpt4128kpreview }, + 'gpt-4-turbo-2024-04-09': { ...gpt4128kpreview }, 'gpt-4-0314': { ...gpt4 }, 'gpt-4-0613': { ...gpt4 }, 'gpt-4-1106-preview': { ...gpt4128kpreview },