Skip to content

Commit

Permalink
Update ai-api.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
arladmin authored May 20, 2024
1 parent 6e514f2 commit 604dff2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function directChatOpenAi({ messages, provider, abortController, onEnd, on
stream: true
}),
async onopen(response) {
if (response.ok && response.headers.get('content-type') === EventStreamContentType) {
if (response.ok && response.headers.get('content-type').includes(EventStreamContentType)) {
return; // everything's good
} else if (response.status >= 400 && response.status < 500 && response.status !== 429) {
// client-side errors are usually non-retriable:
Expand Down

0 comments on commit 604dff2

Please sign in to comment.