mirror of
https://github.com/Sneed-Group/demo-sneed-agent
synced 2024-12-23 10:32:28 -06:00
Create index.html
This commit is contained in:
commit
d04d0448c1
1 changed files with 20 additions and 0 deletions
20
index.html
Normal file
20
index.html
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<head><title>Sneed Agent Demo.</title></head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
const hostname = "https://llm-api.nodemixaholic.com"
|
||||||
|
const q = prompt("Please enter q query.", "Hello!")
|
||||||
|
const www = prompt("Optionally, put in a URL for context.")
|
||||||
|
let url = `${hostname}/?q=${encodeURIComponent(`"${q}"`)}&www=${encodeURIComponent(`${www}`)}`
|
||||||
|
console.log(url)
|
||||||
|
|
||||||
|
// Fetch the results
|
||||||
|
fetch(String(url))
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(result => {
|
||||||
|
|
||||||
|
// Set the body content to the generated SPL text
|
||||||
|
document.body.innerText = `${result}`;
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching result:', error));
|
||||||
|
</script>
|
||||||
|
</body>
|
Loading…
Reference in a new issue