mirror of
https://github.com/hpware/news-analyze.git
synced 2025-07-18 00:19:05 +00:00
Update stuff.
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run
This commit is contained in:
parent
c81767b903
commit
ea58cf5208
6 changed files with 46 additions and 30 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue