Adds output formatter for easy sharing on social media.

This commit is contained in:
Torantulino
2023-03-17 00:41:20 +00:00
parent 8e94b60273
commit dc8964a17c
3 changed files with 117 additions and 0 deletions

47
Output Renderer/script.js Normal file
View File

@@ -0,0 +1,47 @@
const jsonData = {
"command":
{
"name": "Commit to Long Term Memory",
"arguments":
{
"string": "1. AI-based Photo Editing Apps\n2. AI-Based Writing Tool\n3. Advertising Software\n4. AI Marketing Agency\n5. Recruitment Business App\n6. AI-powered Cybersecurity App\n7. Healthcare Startup\n8. Medical Equipment Business"
}
},
"Thoughts":
{
"text": "Storing the ranking of potential AI-based businesses in Long Term Memory",
"reasoning": "To remember the ranked list and use it to guide the decision-making process in choosing the most suitable business opportunity",
"current long-term plan": "- Research potential businesses\n- Choose a suitable business\n- Develop and manage the business autonomously",
"critisism": "None at the moment"
}
};
function displayJsonData() {
const jsonDisplay = document.getElementById('json-display');
let displayContent = '';
for (const key in jsonData) {
displayContent += `<h2>${key}</h2><ul>`;
const value = jsonData[key];
for (const subKey in value) {
let subValue = value[subKey];
if (typeof subValue === 'string') {
subValue = subValue.replace(/\n/g, '<br>');
}
if (subKey === "arguments") {
displayContent += `<li><strong>${subKey}:</strong><ul><li><div class="argument-box"><strong>string:</strong> ${value[subKey].string.replace(/\n/g, '<br>')}</div></li></ul></li>`;
} else {
displayContent += `<li><strong>${subKey}:</strong> ${subValue}</li>`;
}
}
displayContent += '</ul>';
}
jsonDisplay.innerHTML = displayContent;
}
displayJsonData();