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.0 KiB
2.0 KiB
Purpose
Define the shared data models and API contract for system prompt and model settings — ModelSettings class, ChatRequest extensions, and backend handling.
Requirements
Requirement: ModelSettings shared model
The Shared project SHALL define a ModelSettings class with nullable properties: Temperature (double?), TopP (double?), MaxTokens (int?). Null values indicate "use server default".
Scenario: All fields null
- WHEN a ModelSettings instance has all null fields
- THEN the backend uses Semantic Kernel default values for all parameters
Scenario: Partial override
- WHEN a ModelSettings instance has Temperature set but TopP and MaxTokens null
- THEN only Temperature is overridden; other parameters use defaults
Requirement: System prompt in chat request
The ChatRequest SHALL accept an optional SystemPrompt (string?) property. When present and non-empty, the backend SHALL insert it as the first system message in the ChatHistory before user/assistant messages.
Scenario: System prompt provided
- WHEN a ChatRequest includes a non-empty SystemPrompt
- THEN the ChatHistory starts with a system message containing that text, followed by the conversation messages
Scenario: System prompt absent
- WHEN a ChatRequest has a null or empty SystemPrompt
- THEN the ChatHistory contains only user and assistant messages (no system message)
Requirement: Model settings in chat request
The ChatRequest SHALL accept an optional Settings (ModelSettings?) property. When present, the backend SHALL apply non-null values to OpenAIPromptExecutionSettings before calling the Semantic Kernel.
Scenario: Temperature override
- WHEN a ChatRequest includes Settings with Temperature = 0.5
- THEN the OpenAIPromptExecutionSettings.Temperature is set to 0.5
Scenario: No settings provided
- WHEN a ChatRequest has null Settings
- THEN the backend uses default OpenAIPromptExecutionSettings (only FunctionChoiceBehavior.Auto is set)