Skip to content

Commit bf0c6f1

Browse files
Create chatbot.js
1 parent e1a83e5 commit bf0c6f1

File tree

1 file changed

+27
-0
lines changed
  • src/exploits/zero-click_exploits/pegasus/api

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const express = require('express');
2+
const bodyParser = require('body-parser');
3+
const { VeniceAI } = require('venice-ai-sdk'); // Assume this is the SDK for Venice.ai
4+
const app = express();
5+
const port = 3000;
6+
7+
app.use(bodyParser.json());
8+
9+
const veniceAI = new VeniceAI({
10+
apiKey: 'YOUR_VENICE_AI_API_KEY',
11+
model: 'uncensored-1.1',
12+
});
13+
14+
app.post('/api/chatbot', (req, res) => {
15+
const { command } = req.body;
16+
veniceAI.generateResponse(command)
17+
.then(response => {
18+
res.json({ response: response.text });
19+
})
20+
.catch(error => {
21+
res.status(500).json({ error: 'Failed to generate response' });
22+
});
23+
});
24+
25+
app.listen(port, () => {
26+
console.log(`ChatBot API listening at http://localhost:${port}`);
27+
});

0 commit comments

Comments
 (0)