Skip to content

Commit a43c5aa

Browse files
Fix events loading - handle API response structure
- API returns events in { items: [...] } format, not directly as array - Added proper handling to extract events from response.items - Added debug logging to track response structure
1 parent 8dc2fa8 commit a43c5aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

example/src/components/ConversationManager.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ export const ConversationManager: React.FC = () => {
138138
console.log('Loaded remote conversation:', remoteConversation);
139139

140140
// Get events
141-
const events = await remoteConversation.state.events.getEvents();
142-
console.log('Loaded events:', events);
141+
const eventsResponse = await remoteConversation.state.events.getEvents();
142+
console.log('Loaded events response:', eventsResponse);
143+
const events = eventsResponse?.items || eventsResponse || [];
144+
console.log('Processed events:', events);
143145

144146
// Get agent status
145147
const agentStatus = await remoteConversation.state.getAgentStatus();

0 commit comments

Comments
 (0)