Informazioni su I Castagnini

Chi siamo



La nostra casa è stata costruita dai nostri antenati alla fine del 1800, poi è passata per le mani di altri proprietari, nel 1997 l'abbiamo riunita e nel 2000 ho iniziato ad affittarla agli ospiti, con grande piacere oggi continuiamo a vivere l'esperienza di questo contatto sempre nuovo e interessante.

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); }