use different endpoint structure

This commit is contained in:
Joseph J Helfenbein
2025-01-26 06:55:03 -05:00
parent 4e4c30356a
commit 6eb4429523

View File

@@ -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' });
}
}