chore: format

This commit is contained in:
Timothy Jaeryang Baek
2024-12-19 01:07:50 -08:00
parent 0d5ce23885
commit c3e8cd03b2
51 changed files with 57 additions and 60 deletions
-4
View File
@@ -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;
+8 -7
View File
@@ -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;