wip: AI chat streaming endpoint + useChat integration (protocol mismatch)

- Server: POST /api/ai/stream using streamText with tools (lookup_patient, lookup_appointments, lookup_doctor)
- Frontend: AiChatPanel rewritten with @ai-sdk/react useChat hook
- Tool result cards: PatientCard, AppointmentCard, DoctorCard
- Streaming works server-side but useChat v1 doesn't parse AI SDK v6 toTextStreamResponse format
- Context panel layout needs redesign — context section fills entire panel, chat pushed below fold
- TODO: Fix streaming protocol, redesign panel layout with collapsible context

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 10:27:24 +05:30
parent 48ed300094
commit 0477064b3e
4 changed files with 286 additions and 148 deletions

View File

@@ -153,7 +153,7 @@ export const TeamDashboardPage = () => {
)}>
{aiOpen && (
<div className="flex h-full flex-col p-4">
<AiChatPanel role="admin" />
<AiChatPanel />
</div>
)}
</div>