Initial commit

This commit is contained in:
ItzCrazyKns 2024-04-09 16:21:05 +05:30
commit d1c74c861e
No known key found for this signature in database
GPG key ID: 8162927C7CCE3065
57 changed files with 4568 additions and 0 deletions

22
src/routes/images.ts Normal file
View file

@ -0,0 +1,22 @@
import express from 'express';
import imageSearchChain from '../agents/imageSearchAgent';
const router = express.Router();
router.post('/', async (req, res) => {
try {
const { query, chat_history } = req.body;
const images = await imageSearchChain.invoke({
query,
chat_history,
});
res.status(200).json({ images });
} catch (err) {
res.status(500).json({ message: 'An error has occurred.' });
console.log(err.message);
}
});
export default router;