Updates output renderer to take in hardcoded JSON.

This commit is contained in:
Torantulino
2023-03-28 23:04:58 +01:00
parent 40856a6ed2
commit 609e4bb7ee

View File

@@ -1,17 +1,11 @@
const jsonData = { const fs = require('fs');
"command": {
"name": "Google Search", fs.readFile('data.json', 'utf8', (err, data) => {
"arguments": { if (err) throw err;
"search": "simple and profitable online business ideas" const jsonData = JSON.parse(data);
} displayJsonData(jsonData);
}, });
"thoughts": {
"text": "I will search for simple and profitable online business ideas to begin my entrepreneurship journey.",
"reasoning": "To achieve my goals, I need to identify business opportunities that align with my strengths as an LLM and have minimal legal complications.",
"current long-term plan": "- Search for business ideas\n- Evaluate and select ideas\n- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics",
"critisism": "I must ensure that the chosen business idea is both simple and legal, while also considering scalability and profitability."
}
};
function displayJsonData() { function displayJsonData() {
const jsonDisplay = document.getElementById('json-display'); const jsonDisplay = document.getElementById('json-display');
@@ -28,12 +22,12 @@ const jsonData = {
subValue = subValue.replace(/\n/g, '<br>'); subValue = subValue.replace(/\n/g, '<br>');
} }
if (subKey === "arguments") { if (subKey === "args") {
displayContent += `<li><strong>${subKey}:</strong><ul>`; // displayContent += `<li><strong>${subKey}:</strong><ul>`;
for (const argumentKey in value[subKey]) { for (const argumentKey in value[subKey]) {
const argumentValue = value[subKey][argumentKey]; const argumentValue = value[subKey][argumentKey];
displayContent += `<li><div class="argument-box"><strong>${argumentKey}:</strong> ${argumentValue.replace(/\n/g, '<br>')}</div></li>`; displayContent += `<li><div class=""><strong>${argumentKey}:</strong> ${argumentValue.replace(/\n/g, '<br>')}</div></li>`;
} }
displayContent += '</ul></li>'; displayContent += '</ul></li>';
@@ -58,4 +52,4 @@ const jsonData = {
`; `;
} }
displayJsonData();