mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user