-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c2e048
commit 6a6a73b
Showing
2 changed files
with
64 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,42 @@ | ||
console.log(`stand alone gemini chat being tested at \n${Date()}`) | ||
console.log(`stand alone gemini chat deployed at \n${Date()}`) | ||
|
||
const mod = (await import('./gem.mjs')) | ||
const gem = new mod.GEM(mod.validKey()) | ||
const post = gem.post | ||
post('hello') // testing | ||
|
||
|
||
//export{ | ||
// post | ||
//} | ||
|
||
//get post from instance of GEM | ||
//post = (new (await import('./gem.mjs')).GEM).post | ||
|
||
/* | ||
this.chat=async function(div,url='https://episphere.github.io/gemini/connectStudy.txt'){ // target div and context url | ||
console.log(`chatting ...`) | ||
let txt = await (await fetch(url)).text() | ||
if(typeof(div)=='string'){ | ||
div = document.getElementById(div) | ||
} | ||
if(!div){ | ||
div = document.createElement('div') | ||
document.body.appendChild(div) | ||
} | ||
// scafold | ||
div.innerHTML=`<div id="divQuestion"></div><hr><textarea id="txtPrompt">experimental bot, don't take seriously</textarea>` | ||
// operate on textarea | ||
let txtPrompt = div.querySelector('#txtPrompt') | ||
let that=this | ||
txtPrompt.onkeyup=async function(ev){ | ||
if(ev.key=='Enter'){ | ||
console.log(ev.target.value,that) | ||
let ans = await that.post(ev.target.value) | ||
console.log(ans) | ||
} | ||
} | ||
4 | ||
} | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters