Install MudBlazor 9.2.0, replace Bootstrap layout with MudLayout/MudAppBar, create Chat.razor with message list, text input, auto-scroll, and hardcoded responses. Add ChatMessage shared model. Remove template pages (Counter, Weather), move health check to /health. Include OpenSpec change artifacts for the upcoming wire-responses-api work. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Why
The chat UI currently returns hardcoded responses. A local OpenAI-compatible proxy is running at localhost:8317 that exposes the Responses API (POST /v1/responses) backed by Anthropic Claude models. This change wires the chat to produce real AI responses via streaming, replacing the hardcoded stub.
What Changes
- Add a chat endpoint to the API backend that proxies requests to the local Responses API
- Stream tokens from the Responses API back to the WASM client as SSE
- Update ChatApiClient with a streaming chat method
- Replace the hardcoded response in Chat.razor with live streaming from the API
- Add a "thinking" indicator while the assistant is responding
- Disable input during streaming to prevent overlapping requests
Capabilities
New Capabilities
chat-streaming: Streaming AI responses from the Responses API proxy through the backend to the WASM client
Modified Capabilities
chat-ui: Replace hardcoded response with streaming AI response, add typing indicator, disable input during streaming
Impact
src/ChatAgent.Api/ChatAgent.Api.csproj: Add no new packages (uses built-in HttpClient)src/ChatAgent.Api/Controllers/ChatController.cs: New controller proxying to Responses APIsrc/ChatAgent.Api/Program.cs: Register HttpClient for the proxy, add configurationsrc/ChatAgent.Api/appsettings.json: New — configure Responses API base URL and modelsrc/ChatAgent.Client/Services/ChatApiClient.cs: Add streaming chat methodsrc/ChatAgent.Client/Pages/Chat.razor: Replace hardcoded response with streaming callsrc/ChatAgent.Shared/Models/: New request/response DTOs for the chat endpoint