Update stuff.
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run

This commit is contained in:
yuanhau 2025-07-06 18:33:52 +08:00
parent c81767b903
commit ea58cf5208
6 changed files with 46 additions and 30 deletions

View file

@ -1,6 +1,7 @@
import { Groq } from "groq-sdk";
import sql from "~/server/components/postgres";
import { checkIfUserHasCustomGroqKey } from "~/server/components/customgroqsystem";
import getEnvFromDB from "~/server/components/getEnvFromDB";
export default defineEventHandler(async (event) => {
const host = getRequestHost(event);
@ -16,8 +17,9 @@ export default defineEventHandler(async (event) => {
apiKey: doesTheUserHasACustomGroqApiAndWhatIsIt.customApi,
});
} else {
const groq_api_key = await getEnvFromDB("groq_api_key");
groqClient = new Groq({
apiKey: process.env.NUXT_GROQ_API_KEY,
apiKey: groq_api_key,
});
}
const query = getQuery(event);