feat: add env

This commit is contained in:
Hk-Gosuto
2024-06-06 21:39:48 +08:00
parent 991dd0490f
commit c289305b05
7 changed files with 35 additions and 37 deletions

View File

@@ -216,7 +216,9 @@ export function getHeaders(ignoreHeaders?: boolean) {
const accessStore = useAccessStore.getState();
let headers: Record<string, string> = {};
const modelConfig = useChatStore.getState().currentSession().mask.modelConfig;
const isGoogle = modelConfig.model.startsWith("gemini");
const isGoogle =
modelConfig.model.startsWith("gemini") &&
!!!process.env.NEXT_PUBLIC_USE_OPENAI_ENDPOINT_FOR_ALL_MODELS;
if (!ignoreHeaders && !isGoogle) {
headers = {
"Content-Type": "application/json",