chore: format

This commit is contained in:
Timothy Jaeryang Baek
2024-11-16 23:46:12 -08:00
parent c24bc60d35
commit c338f2cae1
64 changed files with 2668 additions and 1212 deletions
+13 -21
View File
@@ -32,15 +32,12 @@ export const getOpenAIConfig = async (token: string = '') => {
return res;
};
type OpenAIConfig = {
ENABLE_OPENAI_API: boolean;
OPENAI_API_BASE_URLS: string[];
OPENAI_API_KEYS: string[];
OPENAI_API_CONFIGS: object;
}
};
export const updateOpenAIConfig = async (token: string = '', config: OpenAIConfig) => {
let error = null;
@@ -109,7 +106,6 @@ export const getOpenAIUrls = async (token: string = '') => {
return res.OPENAI_API_BASE_URLS;
};
export const updateOpenAIUrls = async (token: string = '', urls: string[]) => {
let error = null;
@@ -249,22 +245,18 @@ export const verifyOpenAIConnection = async (
) => {
let error = null;
const res = await fetch(
`${OPENAI_API_BASE_URL}/verify`,
{
method: 'POST',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
url,
key
})
}
)
const res = await fetch(`${OPENAI_API_BASE_URL}/verify`, {
method: 'POST',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
url,
key
})
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();