Merge branch #smgc/notdiamond2api' into 'hstz/noapi'
Browse files
app.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
const express = require('express');
|
2 |
const fetch = require('node-fetch');
|
3 |
const crypto = require('crypto');
|
|
|
4 |
|
5 |
const app = express();
|
6 |
const port = 8000;
|
@@ -284,6 +285,8 @@ app.get('/ai/v1/models', async (req, res) => {
|
|
284 |
}
|
285 |
});
|
286 |
|
|
|
|
|
287 |
app.post('/ai/v1/chat/completions', async (req, res) => {
|
288 |
const startTime = new Date();
|
289 |
const clientIP = req.ip || req.connection.remoteAddress;
|
|
|
1 |
const express = require('express');
|
2 |
const fetch = require('node-fetch');
|
3 |
const crypto = require('crypto');
|
4 |
+
const bodyParser = require('body-parser');
|
5 |
|
6 |
const app = express();
|
7 |
const port = 8000;
|
|
|
285 |
}
|
286 |
});
|
287 |
|
288 |
+
app.use(bodyParser.json({ limit: '50mb' }));
|
289 |
+
|
290 |
app.post('/ai/v1/chat/completions', async (req, res) => {
|
291 |
const startTime = new Date();
|
292 |
const clientIP = req.ip || req.connection.remoteAddress;
|