mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2026-02-11 00:44:27 +08:00
loi he thong
This commit is contained in:
@@ -27,7 +27,7 @@ export async function handle(
|
||||
const response = await request(req);
|
||||
return response;
|
||||
} catch (e) {
|
||||
console.error("[Alibaba] ", e);
|
||||
// console.error("[Alibaba] ", e);
|
||||
return NextResponse.json(prettyObject(e));
|
||||
}
|
||||
}
|
||||
@@ -62,13 +62,13 @@ async function request(req: NextRequest) {
|
||||
|
||||
const fetchUrl = `${baseUrl}${path}`;
|
||||
|
||||
console.log("[Alibaba] fetchUrl", fetchUrl);
|
||||
// console.log("[Alibaba] fetchUrl", fetchUrl);
|
||||
|
||||
const fetchOptions: RequestInit = {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: req.headers.get("Authorization") ?? "",
|
||||
"X-DashScope-SSE": req.headers.get("X-DashScope-SSE") ?? "disable",
|
||||
"X-DashScope-SSE": req.headers.get("X-DashScope-SSE") ?? "enable",
|
||||
},
|
||||
method: req.method,
|
||||
body: req.body,
|
||||
@@ -78,7 +78,7 @@ async function request(req: NextRequest) {
|
||||
signal: controller.signal,
|
||||
};
|
||||
|
||||
console.log("[Proxy] Alibaba options: ", fetchOptions);
|
||||
// console.log("[Proxy] Alibaba options: ", fetchOptions);
|
||||
|
||||
// #1815 try to refuse some request to some models
|
||||
if (serverConfig.customModels && req.body) {
|
||||
@@ -100,7 +100,7 @@ async function request(req: NextRequest) {
|
||||
}
|
||||
|
||||
const current_model = jsonBody?.model;
|
||||
console.log("[Alibaba] custom models", current_model);
|
||||
// console.log("[Alibaba] custom models", current_model);
|
||||
|
||||
//kiem tra xem model co phai la qwen-vl hay khong (vision model)
|
||||
if (current_model && current_model.startsWith("qwen-vl")) {
|
||||
@@ -156,7 +156,7 @@ async function request(req: NextRequest) {
|
||||
// );
|
||||
// }
|
||||
} catch (e) {
|
||||
console.error(`[Alibaba] filter`, e);
|
||||
// console.error(`[Alibaba] filter`, e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -55,13 +55,13 @@ async function handle(
|
||||
duplex: "half",
|
||||
};
|
||||
|
||||
console.log("[Upstash Proxy]", targetUrl, fetchOptions);
|
||||
// console.log("[Upstash Proxy]", targetUrl, fetchOptions);
|
||||
const fetchResult = await fetch(targetUrl, fetchOptions);
|
||||
|
||||
console.log("[Any Proxy]", targetUrl, {
|
||||
status: fetchResult.status,
|
||||
statusText: fetchResult.statusText,
|
||||
});
|
||||
// console.log("[Any Proxy]", targetUrl, {
|
||||
// status: fetchResult.status,
|
||||
// statusText: fetchResult.statusText,
|
||||
// });
|
||||
|
||||
return fetchResult;
|
||||
}
|
||||
|
||||
@@ -515,6 +515,7 @@ export function ChatActions(props: {
|
||||
|
||||
function nextTheme() {
|
||||
//, Theme.Dark
|
||||
|
||||
const themes = [Theme.Auto, Theme.Light];
|
||||
const themeIndex = themes.indexOf(theme);
|
||||
const nextIndex = (themeIndex + 1) % themes.length;
|
||||
|
||||
@@ -90,11 +90,13 @@ export function useSwitchTheme() {
|
||||
document.body.classList.remove("light");
|
||||
document.body.classList.remove("dark");
|
||||
|
||||
if (config.theme === "dark") {
|
||||
document.body.classList.add("dark");
|
||||
} else if (config.theme === "light") {
|
||||
document.body.classList.add("light");
|
||||
}
|
||||
// if (config.theme === "dark") {
|
||||
// document.body.classList.add("dark");
|
||||
// } else if (config.theme === "light") {
|
||||
// document.body.classList.add("light");
|
||||
// }
|
||||
|
||||
document.body.classList.add("light");
|
||||
|
||||
const metaDescriptionDark = document.querySelector(
|
||||
'meta[name="theme-color"][media*="dark"]',
|
||||
|
||||
@@ -310,6 +310,7 @@ export function SideBar(props: { className?: string }) {
|
||||
}),
|
||||
]}
|
||||
onClose={() => setshowDiscoverySelector(false)}
|
||||
// dong bo du lieu voi cloud
|
||||
onSelection={async (s) => {
|
||||
console.log(s[0]);
|
||||
if (s[0] == "/sync") {
|
||||
|
||||
@@ -471,6 +471,9 @@ export const useChatStore = createPersistStore(
|
||||
});
|
||||
|
||||
const api: ClientApi = getClientApi(modelConfig.providerName);
|
||||
|
||||
console.log(api);
|
||||
|
||||
// make request
|
||||
api.llm.chat({
|
||||
messages: sendMessages,
|
||||
|
||||
@@ -97,7 +97,7 @@ export const useMaskStore = createPersistStore(
|
||||
);
|
||||
const config = useAppConfig.getState(); // Lấy config hiện tại
|
||||
|
||||
// console.log(config)
|
||||
// console.log(config)BUILTIN_MASKS
|
||||
|
||||
if (config.hideBuiltinMasks) return userMasks; // Nếu ẩn mask mặc định thì chỉ trả về mask người dùng
|
||||
|
||||
|
||||
Reference in New Issue
Block a user