Merge pull request #124 from sijinhui/dev

Dev
This commit is contained in:
sijinhui 2024-07-17 13:00:35 +08:00 committed by GitHub
commit ef013634ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 287 additions and 289 deletions

View File

@ -50,9 +50,9 @@ export async function requestOpenai(
"/api/openai/",
"",
);
let baseUrl = isAzure
? serverConfig.azureUrl
: serverConfig.baseUrl || OPENAI_BASE_URL;
let baseUrl =
(isAzure ? serverConfig.azureUrl : serverConfig.baseUrl) || OPENAI_BASE_URL;
if (!baseUrl.startsWith("http")) {
baseUrl = `https://${baseUrl}`;
@ -110,10 +110,9 @@ export async function requestOpenai(
}
}
// const fetchUrl = `${baseUrl}/${path}`;
const jsonBody = await req.json();
const fetchUrl = cloudflareAIGatewayUrl(`${baseUrl}/${path}`);
console.log("fetchUrl", fetchUrl);
const jsonBody = await req.json();
const fetchOptions: RequestInit = {
headers: {
"Content-Type": "application/json",

View File

@ -1195,8 +1195,7 @@ export function Settings() {
{/* <ListItem*/}
{/* title={Locale.Settings.Access.Baidu.Endpoint.Title}*/}
{/* subTitle={*/}
{/* Locale.Settings.Access.Anthropic.Endpoint.SubTitle +*/}
{/* Baidu.ExampleEndpoint*/}
{/* Locale.Settings.Access.Baidu.Endpoint.SubTitle*/}
{/* }*/}
{/* >*/}
{/* <input*/}