use different endpoint structure
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { HuggingFaceInference } from "@langchain/community/llms/hf";
|
||||
|
||||
export default async function handler(req, res) {
|
||||
if (req.method === 'POST') {
|
||||
export async function POST(req, res) {
|
||||
try {
|
||||
const { query } = req.body;
|
||||
|
||||
@@ -17,7 +16,4 @@ export default async function handler(req, res) {
|
||||
console.error(error);
|
||||
res.status(500).json({ error: 'Error generating response' });
|
||||
}
|
||||
} else {
|
||||
res.status(405).json({ error: 'Method Not Allowed' });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user