-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add pages router test to nextjs/vercel-ai-sdk
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 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
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,14 @@ | ||
import { RAGChat } from "@upstash/rag-chat"; | ||
import { NextApiRequest, NextApiResponse } from "next"; | ||
|
||
// This is a test route to check if imports are working with pages router | ||
export default async function handler(_req: NextApiRequest, res: NextApiResponse) { | ||
const ragChat = new RAGChat({}); | ||
|
||
await ragChat.context.add({ | ||
type: "text", | ||
data: "This is context added from the pages router example", | ||
}); | ||
|
||
res.status(200).json({ message: "OK" }); | ||
} |