-
- {messages.map((message, index) => (
-
-
{message.content.text}
-
- ))}
-
-
-
- setInputMessage(e.target.value)}
- onKeyPress={(e) => e.key === 'Enter' && sendMessage()}
- disabled={isStreaming}
- placeholder="Type your message..."
- />
-
-
-
- )
-}
-```
-
-## Error Handling
-
-### API Error Response Format
-```typescript
-interface ApiError {
- error: {
- message: string
- type: 'validation_error' | 'not_found' | 'internal_error' | 'authentication_error'
- code?: string
- details?: any[]
- }
-}
-```
-
-### Error Handling Pattern
-```typescript
-async function apiRequest