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

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
<title>JSON Display</title>
</head>
<body>
<div class="container my-5">
<h1 class="text-center mb-4">Entrepreneur-GPT Output</h1>
<div class="row">
<div class="col-md-6 offset-md-3">
<div id="json-display" class="json-display"></div>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>

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();

View File

@ -0,0 +1,46 @@
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
}
.container {
max-width: 1250px;
}
h1 {
color: #444;
margin-bottom: 30px;
}
.json-display {
padding: 20px;
border-radius: 5px;
background-color: #ffffff;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.json-display h2 {
margin-top: 0;
color: #333;
border-bottom: 1px solid #e0e0e0;
padding-bottom: 10px;
}
.json-display ul {
list-style-type: none;
padding: 0;
}
.json-display ul li {
padding: 5px 0;
}
strong {
color: #007bff;
}
.argument-box {
background: #007bff0a;
padding: 5px;
margin-top: 5px;
}