Spaces:
Running
Running
Commit
·
396a357
1
Parent(s):
881e01f
Update index.html
Browse files- index.html +26 -36
index.html
CHANGED
|
@@ -14,40 +14,30 @@
|
|
| 14 |
Also don't forget to check the
|
| 15 |
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
| 16 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
</div>
|
| 18 |
-
<
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
headers: {
|
| 35 |
-
Authorization: "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
| 36 |
-
"Content-Type": "application/json",
|
| 37 |
-
},
|
| 38 |
-
body: JSON.stringify({
|
| 39 |
-
prompt: prompt,
|
| 40 |
-
max_tokens: 100,
|
| 41 |
-
stop: "\n\n",
|
| 42 |
-
}),
|
| 43 |
-
})
|
| 44 |
-
.then((response) => response.json())
|
| 45 |
-
.then((data) => {
|
| 46 |
-
code.innerHTML = "<pre><code>" + data.choices[0].text + "</code></pre>";
|
| 47 |
-
})
|
| 48 |
-
.catch((error) => {
|
| 49 |
-
code.innerHTML = "<p>Error: " + error.message + "</p>";
|
| 50 |
-
});
|
| 51 |
-
}
|
| 52 |
-
</script>
|
| 53 |
-
</div>
|
|
|
|
| 14 |
Also don't forget to check the
|
| 15 |
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
| 16 |
</p>
|
| 17 |
+
<div class="prompt-toolbox">
|
| 18 |
+
<h2>Prompt Toolbox Reverse Prompt Engineering Code Tool</h2>
|
| 19 |
+
<p>Use this tool to generate code based on a desired prompt. Simply enter your prompt in the input field below and click "Generate Code".</p>
|
| 20 |
+
<form>
|
| 21 |
+
<label for="prompt">Enter your prompt:</label>
|
| 22 |
+
<input type="text" id="prompt" name="prompt" />
|
| 23 |
+
<button type="button" onclick="generateCode()">Generate Code</button>
|
| 24 |
+
</form>
|
| 25 |
+
<div id="code"></div>
|
| 26 |
+
</div>
|
| 27 |
</div>
|
| 28 |
+
<script>
|
| 29 |
+
function generateCode() {
|
| 30 |
+
const promptInput = document.getElementById("prompt");
|
| 31 |
+
const codeOutput = document.getElementById("code");
|
| 32 |
+
|
| 33 |
+
if (promptInput && codeOutput) {
|
| 34 |
+
const prompt = promptInput.value;
|
| 35 |
+
// Replace the line below with the actual code generation logic
|
| 36 |
+
const generatedCode = "Generated code will be displayed here.";
|
| 37 |
+
|
| 38 |
+
codeOutput.innerText = generatedCode;
|
| 39 |
+
}
|
| 40 |
+
}
|
| 41 |
+
</script>
|
| 42 |
+
</body>
|
| 43 |
+
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|