feat: add per-message model and reasoning effort override

Allow users to select a different model and reasoning effort level
directly from the chat input toolbar, overriding the bot defaults
on a per-message basis. The backend accepts optional model_id and
reasoning_effort parameters via both WebSocket and HTTP APIs, with
request-level values taking priority over bot/session settings.

- Backend: extend wsClientMessage and LocalChannelMessageRequest with
  model_id/reasoning_effort fields; add ReasoningEffort to ChatRequest;
  update resolver to prioritize request-level reasoning effort
- Frontend: add ModelOptions and ReasoningEffortSelect shared components;
  refactor model-select to reuse ModelOptions; add model/reasoning
  selectors to chat input toolbar; initialize from bot settings
- Regenerate swagger spec and TypeScript SDK
This commit is contained in:
Acbox
2026-03-29 19:45:55 +08:00
parent 86d83108d9
commit 33f39c20ff
19 changed files with 593 additions and 150 deletions
+6 -2
View File
@@ -234,8 +234,12 @@ func (r *Resolver) resolve(ctx context.Context, req conversation.ChatRequest) (r
inlineImages := extractNativeImageParts(mergedAttachments)
reasoningEffort := ""
if chatModel.HasCompatibility(models.CompatReasoning) && botSettings.ReasoningEnabled {
reasoningEffort = botSettings.ReasoningEffort
if chatModel.HasCompatibility(models.CompatReasoning) {
if re := strings.TrimSpace(req.ReasoningEffort); re != "" {
reasoningEffort = re
} else if botSettings.ReasoningEnabled {
reasoningEffort = botSettings.ReasoningEffort
}
}
var reasoningConfig *models.ReasoningConfig