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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>LuminAI API Client</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: 'Roboto', sans-serif;
|
| 10 |
+
background-color: #f4faff;
|
| 11 |
+
color: #333;
|
| 12 |
+
margin: 0;
|
| 13 |
+
padding: 0;
|
| 14 |
+
line-height: 1.6;
|
| 15 |
+
}
|
| 16 |
+
.container {
|
| 17 |
+
max-width: 1000px;
|
| 18 |
+
margin: 40px auto;
|
| 19 |
+
padding: 0 20px;
|
| 20 |
+
}
|
| 21 |
+
header {
|
| 22 |
+
background: #1e90ff;
|
| 23 |
+
color: #fff;
|
| 24 |
+
padding: 30px 0;
|
| 25 |
+
text-align: center;
|
| 26 |
+
border-bottom: 3px solid #005f9e;
|
| 27 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
| 28 |
+
}
|
| 29 |
+
header h1 {
|
| 30 |
+
margin: 0;
|
| 31 |
+
font-size: 2.5em;
|
| 32 |
+
font-weight: 400;
|
| 33 |
+
}
|
| 34 |
+
.main {
|
| 35 |
+
margin-top: 20px;
|
| 36 |
+
}
|
| 37 |
+
h2, h3 {
|
| 38 |
+
color: #1e90ff;
|
| 39 |
+
font-weight: 400;
|
| 40 |
+
}
|
| 41 |
+
.code-block {
|
| 42 |
+
background: #e0f7ff;
|
| 43 |
+
padding: 15px;
|
| 44 |
+
border-left: 5px solid #1e90ff;
|
| 45 |
+
margin: 20px 0;
|
| 46 |
+
position: relative;
|
| 47 |
+
border-radius: 5px;
|
| 48 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
| 49 |
+
}
|
| 50 |
+
.code-block pre {
|
| 51 |
+
margin: 0;
|
| 52 |
+
overflow-x: auto;
|
| 53 |
+
font-size: 0.9em;
|
| 54 |
+
}
|
| 55 |
+
.copy-btn {
|
| 56 |
+
position: absolute;
|
| 57 |
+
top: 10px;
|
| 58 |
+
right: 10px;
|
| 59 |
+
background: none;
|
| 60 |
+
border: none;
|
| 61 |
+
cursor: pointer;
|
| 62 |
+
outline: none;
|
| 63 |
+
}
|
| 64 |
+
.copy-btn img {
|
| 65 |
+
width: 24px;
|
| 66 |
+
height: 24px;
|
| 67 |
+
}
|
| 68 |
+
.stats-container {
|
| 69 |
+
display: grid;
|
| 70 |
+
grid-template-columns: 1fr 1fr;
|
| 71 |
+
gap: 20px;
|
| 72 |
+
margin-top: 40px;
|
| 73 |
+
}
|
| 74 |
+
.stat-box {
|
| 75 |
+
background: #fff;
|
| 76 |
+
padding: 20px;
|
| 77 |
+
border-radius: 10px;
|
| 78 |
+
text-align: center;
|
| 79 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
| 80 |
+
transition: transform 0.3s, box-shadow 0.3s;
|
| 81 |
+
}
|
| 82 |
+
.stat-box:hover {
|
| 83 |
+
transform: translateY(-10px);
|
| 84 |
+
box-shadow: 0 12px 24px rgba(0,0,0,0.1);
|
| 85 |
+
}
|
| 86 |
+
.stat-box h3 {
|
| 87 |
+
margin: 0;
|
| 88 |
+
font-size: 1.2em;
|
| 89 |
+
color: #1e90ff;
|
| 90 |
+
font-weight: 400;
|
| 91 |
+
}
|
| 92 |
+
.stat-box p {
|
| 93 |
+
margin: 10px 0 0;
|
| 94 |
+
font-size: 2.5em;
|
| 95 |
+
font-weight: bold;
|
| 96 |
+
color: #333;
|
| 97 |
+
}
|
| 98 |
+
.stat-box.full-width {
|
| 99 |
+
grid-column: span 2;
|
| 100 |
+
}
|
| 101 |
+
footer {
|
| 102 |
+
background: #1e90ff;
|
| 103 |
+
color: #fff;
|
| 104 |
+
text-align: center;
|
| 105 |
+
padding: 20px 0;
|
| 106 |
+
position: relative;
|
| 107 |
+
bottom: 0;
|
| 108 |
+
width: 100%;
|
| 109 |
+
margin-top: 40px;
|
| 110 |
+
box-shadow: 0 -4px 8px rgba(0,0,0,0.1);
|
| 111 |
+
}
|
| 112 |
+
footer p {
|
| 113 |
+
margin: 0;
|
| 114 |
+
font-size: 0.9em;
|
| 115 |
+
}
|
| 116 |
+
</style>
|
| 117 |
+
</head>
|
| 118 |
+
<body>
|
| 119 |
+
<header>
|
| 120 |
+
<h1>LuminAI API Client</h1>
|
| 121 |
+
</header>
|
| 122 |
+
<div class="container">
|
| 123 |
+
<div class="main">
|
| 124 |
+
<h2>Introduction</h2>
|
| 125 |
+
<p>This document provides a simple JavaScript client for interacting with the LuminAI API. The client allows you to send requests with various parameters and receive results from the API.</p>
|
| 126 |
+
<h2>Installation</h2>
|
| 127 |
+
<p>First, make sure you have Node.js installed. Then, install the necessary dependencies:</p>
|
| 128 |
+
<div class="code-block">
|
| 129 |
+
<pre><code>npm install axios</code></pre>
|
| 130 |
+
</div>
|
| 131 |
+
<h2>Usage</h2>
|
| 132 |
+
<p>Create a file named <code>lumin.js</code> with the following content:</p>
|
| 133 |
+
<div class="code-block">
|
| 134 |
+
<pre><code>const axios = require('axios');
|
| 135 |
+
async function lumin(q, username = null, logic = null, webSearchMode = false) {
|
| 136 |
+
try {
|
| 137 |
+
const payload = { content: q };
|
| 138 |
+
if (username !== null) payload.user = username;
|
| 139 |
+
if (logic !== null) payload.prompt = logic;
|
| 140 |
+
payload.webSearchMode = webSearchMode;
|
| 141 |
+
const response = await axios.post("https://luminai.siputzx.my.id/", payload);
|
| 142 |
+
return response.data.result;
|
| 143 |
+
} catch (error) {
|
| 144 |
+
console.error('Error fetching:', error);
|
| 145 |
+
throw error;
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
module.exports = { lumin };</code></pre>
|
| 149 |
+
</div>
|
| 150 |
+
<h2>Example Usage</h2>
|
| 151 |
+
<p>Below are some examples of how to use the <code>lumin</code> function.</p>
|
| 152 |
+
<h3>Basic Usage</h3>
|
| 153 |
+
<p>Send a query to the LuminAI API:</p>
|
| 154 |
+
<div class="code-block">
|
| 155 |
+
<pre><code>const { lumin } = require('./lumin');
|
| 156 |
+
lumin("query")
|
| 157 |
+
.then(result => console.log(result))
|
| 158 |
+
.catch(error => console.error(error));</code></pre>
|
| 159 |
+
</div>
|
| 160 |
+
<h3>Usage with Query and Username</h3>
|
| 161 |
+
<p>Send a query along with a username:</p>
|
| 162 |
+
<div class="code-block">
|
| 163 |
+
<pre><code>const { lumin } = require('./lumin');
|
| 164 |
+
lumin("query", "username")
|
| 165 |
+
.then(result => console.log(result))
|
| 166 |
+
.catch(error => console.error(error));</code></pre>
|
| 167 |
+
</div>
|
| 168 |
+
<h3>Usage with Query, Username, and Logic</h3>
|
| 169 |
+
<p>Send a query with a username and additional logic:</p>
|
| 170 |
+
<div class="code-block">
|
| 171 |
+
<pre><code>const { lumin } = require('./lumin');
|
| 172 |
+
lumin("query", "username", "logic")
|
| 173 |
+
.then(result => console.log(result))
|
| 174 |
+
.catch(error => console.error(error));</code></pre>
|
| 175 |
+
</div>
|
| 176 |
+
<h3>Usage with Query, Username, Logic, and Web Search Mode</h3>
|
| 177 |
+
<p>Send a query with a username, additional logic, and enable web search mode:</p>
|
| 178 |
+
<div class="code-block">
|
| 179 |
+
<pre><code>const { lumin } = require('./lumin');
|
| 180 |
+
lumin("query", "username", "logic", true)
|
| 181 |
+
.then(result => console.log(result))
|
| 182 |
+
.catch(error => console.error(error));</code></pre>
|
| 183 |
+
</div>
|
| 184 |
+
<h2>Closing</h2>
|
| 185 |
+
<p>Thank you to everyone who has used LuminAI. We hope this API will continue to provide positive impacts to its users.</p>
|
| 186 |
+
<h2>Special Thanks</h2>
|
| 187 |
+
<p>This API leverages the Blackbox.ai platform. We extend our deepest gratitude to the Blackbox.ai team for their incredible work.</p>
|
| 188 |
+
<div class="stats-container">
|
| 189 |
+
<div class="stat-box">
|
| 190 |
+
<h3>Rps</h3>
|
| 191 |
+
<p id="rps">0</p>
|
| 192 |
+
</div>
|
| 193 |
+
<div class="stat-box">
|
| 194 |
+
<h3>Total Requests</h3>
|
| 195 |
+
<p id="total-requests">0</p>
|
| 196 |
+
</div>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
</div>
|
| 200 |
+
<footer>
|
| 201 |
+
<p>LuminAI API Client © 2024</p>
|
| 202 |
+
</footer>
|
| 203 |
+
<script>
|
| 204 |
+
async function fetchStats() {
|
| 205 |
+
const response = await fetch('/api/stats');
|
| 206 |
+
const data = await response.json();
|
| 207 |
+
document.getElementById('rps').textContent = data.rps;
|
| 208 |
+
document.getElementById('total-requests').textContent = data.totalRequests;
|
| 209 |
+
}
|
| 210 |
+
fetchStats();
|
| 211 |
+
</script>
|
| 212 |
+
</body>
|
| 213 |
+
</html>
|