Overhaul extraction pipeline with new TradeItem model, conversation flow, and dedicated extraction endpoint. Add sidebar navigation with NavMenu component and landing page. Introduce few-shot prompting service and tests. Add prompt settings and email upload specs. Update OpenSpec tooling with improved export-spec and extract-feature commands. Archive completed changes and export full specs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.3 KiB
2.3 KiB
1. Shared Models
- 1.1 Create
ModelSettings.csin Shared/Models —double? Temperature,double? TopP,int? MaxTokens - 1.2 Add
string? SystemPromptandModelSettings? Settingsproperties toChatRequest.cs
2. API Backend
- 2.1 Update
ChatController.Post()— ifrequest.SystemPromptis non-empty, callchatHistory.AddSystemMessage(request.SystemPrompt)before adding user/assistant messages - 2.2 Update
ChatController.Post()— ifrequest.Settingsis non-null, apply non-null Temperature, TopP, MaxTokens toOpenAIPromptExecutionSettings
3. Client UI — Tabbed Layout
- 3.1 Wrap the existing Chat.razor content (chat-container div) inside
<MudTabs>with three<MudTabPanel>elements: "Chat", "System Prompt", "Model Settings" - 3.2 Add component fields:
_systemPrompt(string),_temperature(double?),_topP(double?),_maxTokens(int?)
4. System Prompt Tab
- 4.1 Add a
MudTextFieldwithLines="10",Variant="Variant.Outlined", bound to_systemPrompt, with placeholder text explaining what a system prompt does - 4.2 Include the
_systemPromptvalue in theChatRequestbuilt bySendMessage()
5. Model Settings Tab
- 5.1 Add
MudNumericField<double?>for Temperature (min 0.0, max 2.0, step 0.1) with label and helper text - 5.2 Add
MudNumericField<double?>for TopP (min 0.0, max 1.0, step 0.1) with label and helper text - 5.3 Add
MudNumericField<int?>for MaxTokens (min 1, max 4096) with label and helper text - 5.4 Include the model settings in the
ChatRequestbuilt bySendMessage()
6. Client Service
- 6.1 Verify
ChatApiClient.SendChatStreamingAsync()serializes the newChatRequestfields correctly (SystemPrompt, Settings) — no changes expected since it already serializes the full object
7. Styling
- 7.1 Adjust
Chat.razor.css— the chat-container height calc needs to account for the MudTabs header height (~48px). The tabs header sits inside the content area below the AppBar.
8. Verification
- 8.1 Build the solution (
dotnet build) and confirm no compilation errors - 8.2 Run existing tests (
dotnet test) and confirm they pass - 8.3 Update any tests that construct
ChatRequestif the new nullable fields cause issues — no updates needed, nullable fields don't break existing tests