chore: format
This commit is contained in:
1 parent
0d5ce23885
commit
c3e8cd03b2
51 files changed
+57
-60
No files matched your search
@@ -287,14 +287,15 @@ export const generateOpenAIChatCompletion = async (
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(body)
|
||||
}).then(async (res) => {
|
||||
if (!res.ok) throw await res.json();
|
||||
return res.json();
|
||||
})
|
||||
.catch((err) => {
|
||||
error = `OpenAI: ${err?.detail ?? 'Network Problem'}`;
|
||||
return null;
|
||||
});
|
||||
.then(async (res) => {
|
||||
if (!res.ok) throw await res.json();
|
||||
return res.json();
|
||||
})
|
||||
.catch((err) => {
|
||||
error = `OpenAI: ${err?.detail ?? 'Network Problem'}`;
|
||||
return null;
|
||||
});
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
|
||||
Reference in new issue
Block a user