Skip to content

Commit 30a19b1

Browse files
authored
Create artificial-general-intelligence.js
1 parent fa98239 commit 30a19b1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import express from 'express';
2+
import * as AGI from 'agi.js';
3+
4+
const router = express.Router();
5+
const agi = new AGI.AGI();
6+
7+
router.post('/cognitive-reasoning', async (req, res) => {
8+
const { knowledgeGraph } = req.body;
9+
const reasoningResult = await agi.reason(knowledgeGraph);
10+
res.json({ reasoningResult });
11+
});
12+
13+
router.post('/learning-from-experience', async (req, res) => {
14+
const { experienceData } = req.body;
15+
const learnedKnowledge = await agi.learn(experienceData);
16+
res.json({ learnedKnowledge });
17+
});
18+
19+
router.post('/natural-language-understanding', async (req, res) => {
20+
const { text } = req.body;
21+
const understandingResult = await agi.understand(text);
22+
res.json({ understandingResult });
23+
});
24+
25+
export default router;

0 commit comments

Comments
 (0)