About I Castagnini

Who We Are



Our house was built by our ancestors in the late 1800s, then passed through the hands of other owners, in 1997 we reunited it and in 2000 I began renting to guests, with great pleasure today we continue to live the experience of this ever new and interesting contact.

Domande Frequenti

I Castagnini
Ciao! Sono l'assistente virtuale de I Castagnini. Come posso aiutarti? 🌿
const IC_WORKER_URL = "https://castagnini-chatbot-proxy.marco-norchi.workers.dev/"; let icHistory = []; function icToggleChat() { const win = document.getElementById('ic-chat-window'); win.style.display = (win.style.display === 'flex') ? 'none' : 'flex'; } async function icSendMessage() { const input = document.getElementById('ic-chat-input'); const text = input.value.trim(); if (!text) return; icAddMessage('user', text); icHistory.push({ role: 'user', content: text }); input.value = ''; icAddMessage('bot', '...'); try { const response = await fetch(IC_WORKER_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ messages: icHistory }) }); const data = await response.json(); icRemoveLastBotMessage(); if (data.reply) { icAddMessage('bot', data.reply); icHistory.push({ role: 'assistant', content: data.reply }); } else { icAddMessage('bot', 'Mi dispiace, si è verificato un errore. Riprova tra poco.'); } } catch (err) { icRemoveLastBotMessage(); icAddMessage('bot', 'Mi dispiace, non riesco a rispondere in questo momento.'); } } function icAddMessage(role, text) { const container = document.getElementById('ic-chat-messages'); const div = document.createElement('div'); div.className = 'ic-msg ' + role; div.innerHTML = ''; div.querySelector('.bubble').textContent = text; container.appendChild(div); container.scrollTop = container.scrollHeight; } function icRemoveLastBotMessage() { const container = document.getElementById('ic-chat-messages'); container.removeChild(container.lastElementChild); } const IC_WORKER_URL = "https://castagnini-chatbot-proxy.marco-norchi.workers.dev/"; let icHistory = []; function icToggleChat() { const win = document.getElementById('ic-chat-window'); win.style.display = (win.style.display === 'flex') ? 'none' : 'flex'; } async function icSendMessage() { const input = document.getElementById('ic-chat-input'); const text = input.value.trim(); if (!text) return; icAddMessage('user', text); icHistory.push({ role: 'user', content: text }); input.value = ''; icAddMessage('bot', '...'); try { const response = await fetch(IC_WORKER_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ messages: icHistory }) }); const data = await response.json(); icRemoveLastBotMessage(); if (data.reply) { icAddMessage('bot', data.reply); icHistory.push({ role: 'assistant', content: data.reply }); } else { icAddMessage('bot', 'Mi dispiace, si è verificato un errore. Riprova tra poco.'); } } catch (err) { icRemoveLastBotMessage(); icAddMessage('bot', 'Mi dispiace, non riesco a rispondere in questo momento.'); } } function icAddMessage(role, text) { const container = document.getElementById('ic-chat-messages'); const div = document.createElement('div'); div.className = 'ic-msg ' + role; div.innerHTML = ''; div.querySelector('.bubble').textContent = text; container.appendChild(div); container.scrollTop = container.scrollHeight; } function icRemoveLastBotMessage() { const container = document.getElementById('ic-chat-messages'); container.removeChild(container.lastElementChild); }