import { HfInference } from '@huggingface/inference'
document.getElementById('window-container').addEventListener('click', async function () {
const hf = new HfInference(process.env.HF_TOKEN)
const response = await hf.textGeneration({
inputs: 'tell me a christmas joke?',
max_length: 20,
temperature: 0.7,
role: "assistant",
model: "HuggingFaceH4/zephyr-7b-beta",
})
console.log(response)
document.getElementById("joke-display").innerHTML = response.generated_text
document.querySelector('.left-door').style = "animation: left-open 0.3s forwards"
document.querySelector('.right-door').style = "animation: right-open 0.3s forwards"
document.querySelector('.joke-display').style = "animation: display-joke 0.3s forwards"
})