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