mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 09:18:26 +00:00
For new users give 200 credits
This commit is contained in:
parent
b380f2657f
commit
24038a4789
@ -156,6 +156,11 @@ export async function findOrCreateGoogleUser({
|
||||
authIdentifier,
|
||||
email,
|
||||
authenticationMethod: "GOOGLE",
|
||||
UserUsage: {
|
||||
create: {
|
||||
availableCredits: 200,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -91,7 +91,6 @@ export const chat = task({
|
||||
let conversationStatus = "success";
|
||||
for await (const step of stream) {
|
||||
if (step.type === "STEP") {
|
||||
creditForChat += 1;
|
||||
const stepDetails = JSON.parse(step.message as string);
|
||||
|
||||
if (stepDetails.skillStatus === ActionStatusEnum.TOOL_REQUEST) {
|
||||
@ -123,7 +122,7 @@ export const chat = task({
|
||||
payload.conversationId,
|
||||
);
|
||||
|
||||
usageCredits && (await updateUserCredits(usageCredits, creditForChat));
|
||||
usageCredits && (await updateUserCredits(usageCredits, 1));
|
||||
|
||||
if (init?.tokenId) {
|
||||
await deletePersonalAccessToken(init.tokenId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user