chore: format
This commit is contained in:
@@ -107,8 +107,6 @@ export const chatAction = async (token: string, action_id: string, body: ChatAct
|
||||
return res;
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const stopTask = async (token: string, id: string) => {
|
||||
let error = null;
|
||||
|
||||
@@ -141,8 +139,6 @@ export const stopTask = async (token: string, id: string) => {
|
||||
return res;
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const getTaskConfig = async (token: string = '') => {
|
||||
let error = null;
|
||||
|
||||
|
||||
@@ -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