// In an app: import { setupWeatherCard } from '@aparte/plugin-cards/weather';
const { setupWeatherCard } = window.apartePlugins.cards.weather;
setupWeatherCard({ tool: 'get_weather' });
const viewport = document.querySelector('aparte-chat-viewport');
viewport.appendMessage({ id: 'u1', role: 'user', content: 'Weather in Lille?', timestamp: Date.now() });
viewport.appendMessage({ id: 'a1', role: 'assistant', timestamp: Date.now(), segments: [{
id: 's1', type: 'tool_call', status: 'resolved',
toolCall: { id: 'c-s1', name: 'get_weather', input: { city: 'Lille' } },
structuredResult: {
location: 'Lille', condition: 'partly-cloudy', temperature: 11, feelsLike: 9, high: 14, low: 7,
humidity: 78, wind: { speed: 18, direction: 240 }, precipitation: 40,
hourly: [11, 12, 13, 14, 13, 12, 10, 9].map((temperature, i) => ({
time: new Date((Math.floor(Date.now() / 3600000) + i) * 3600000), temperature,
condition: i > 4 ? 'rain' : 'partly-cloudy', precipitation: i > 4 ? 60 : 10,
})),
},
}] });