DeFactOfficial commited on
Commit
ca25c5d
1 Parent(s): 11ad00c

Update api.js

Browse files
Files changed (1) hide show
  1. api.js +17 -1
api.js CHANGED
@@ -12,7 +12,6 @@ const {generateHtml} = require('./llm.js')
12
  const app = express();
13
  app.use(express.json()); // To parse JSON payloads
14
  app.use(cors()); // Enable CORS for all routes
15
-
16
  require('dotenv').config()
17
 
18
 
@@ -244,6 +243,23 @@ app.get('/api/generate/html', async(req, res) => {
244
  console.log("HTML generation complete")
245
  })
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  // Client webpages and storage for generated content
248
  app.use('/', express.static("public"));
249
 
 
12
  const app = express();
13
  app.use(express.json()); // To parse JSON payloads
14
  app.use(cors()); // Enable CORS for all routes
 
15
  require('dotenv').config()
16
 
17
 
 
243
  console.log("HTML generation complete")
244
  })
245
 
246
+
247
+ /* Assistants and Skills - Use Dynamically In HuggingChat System Message */
248
+ const {image_assistant, create_image, community_image_models} = require('./skills.js')
249
+
250
+
251
+ app.get('/api/skills/image_assistant', (req, res) =>{
252
+ res.status('200').send(image_assistant)
253
+ })
254
+ app.get('/api/skills/create_image', (req, res) =>{
255
+ res.status('200').send(create_image['markdown'])
256
+ })
257
+
258
+ /* This one is cool, because you can control the type of models you show */
259
+ app.get('/api/skills/community_image_models', (req, res) =>{
260
+ res.status('200').send(JSON.stringify(community_image_models(req.query)))
261
+ })
262
+
263
  // Client webpages and storage for generated content
264
  app.use('/', express.static("public"));
265