mirror of
https://github.com/hpware/news-analyze.git
synced 2025-07-17 16:09:06 +00:00
Delete funding.yml as the Lawsnotes thingy & Update README & Wipedev
Some checks failed
Build and Push Beta Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Beta Image / build-and-push (push) Has been cancelled
scripts to give windows ppl a script to use & add MORE docker-compose files :D also updated deploy.md & gitignore, but the groq api thing is still broken tho.
This commit is contained in:
parent
fe9cb6e588
commit
0c904fd5bd
15 changed files with 276 additions and 248 deletions
|
@ -2,10 +2,6 @@ import { Groq } from "groq-sdk";
|
|||
import sql from "~/server/components/postgres";
|
||||
import { checkIfUserHasCustomGroqKey } from "~/server/components/customgroqsystem";
|
||||
|
||||
const groq = new Groq({
|
||||
apiKey: process.env.GROQ_API_KEY,
|
||||
});
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const host = getRequestHost(event);
|
||||
const protocol = getRequestProtocol(event);
|
||||
|
@ -14,13 +10,12 @@ export default defineEventHandler(async (event) => {
|
|||
console.log("Token: ", userToken);
|
||||
const doesTheUserHasACustomGroqApiAndWhatIsIt =
|
||||
await checkIfUserHasCustomGroqKey(userToken);
|
||||
let groqClient = groq;
|
||||
let groqClient;
|
||||
if (doesTheUserHasACustomGroqApiAndWhatIsIt.status === true) {
|
||||
groqClient = new Groq({
|
||||
apiKey: doesTheUserHasACustomGroqApiAndWhatIsIt.customApi,
|
||||
});
|
||||
} else {
|
||||
console.log(process.env.GROQ_API_KEY); // DEBUGGING ONLY!!! THIS ONLY CONTAINS THE .ENV KEYS NOT THE USER ONES
|
||||
groqClient = new Groq({
|
||||
apiKey: process.env.GROQ_API_KEY,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue