This repository has been archived by the owner on Jul 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,027 additions
and
1,977 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { NextResponse } from "next/server"; | ||
import { fetcher } from "@/tools/fetch"; | ||
import createClient from "@/supabase/server"; | ||
|
||
export const revalidate = 0; | ||
|
||
export async function POST(request: Request) { | ||
const body = await request.json(); | ||
|
||
const supabase = createClient(); | ||
|
||
const { | ||
data: { user: user }, | ||
error: userError, | ||
} = await supabase.auth.getUser(); | ||
|
||
if (userError) { | ||
return NextResponse.json({ error: userError }); | ||
} | ||
|
||
const ai = await fetcher(`https://ai-botway.hop.sh/api/new-bot`, { | ||
method: "POST", | ||
body: JSON.stringify({ | ||
prompt: body.prompt, | ||
}), | ||
}); | ||
|
||
return NextResponse.json({ message: "Success", answer: ai.data }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,6 @@ | |
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"prettier": "^3.0.0", | ||
"turbo": "^1.10.7" | ||
"turbo": "^1.10.12" | ||
} | ||
} |
Submodule botwaygo
updated
from fbcf4c to 786d6f
Oops, something went wrong.