mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
7f9d6e4aba
Backend - New subject kinds: all / channel_identity / channel_type - Source scope fields on bot_acl_rules: source_channel, source_conversation_type, source_conversation_id, source_thread_id - Fix source_scope_check constraint: resolve source_channel server-side (channel_type → subject_channel_type; channel_identity → DB lookup) - Add GET /bots/:id/acl/channel-types/:type/conversations to list observed conversations by platform type - ListObservedConversations: include private/DM chats, normalise conversation_type; COALESCE(name, handle) for display name - enrichConversationAvatar: persist entry.Name → conversation_name (keeps Telegram group titles current on every message) - Unify Priority type to int32 across Go types to match DB INTEGER; remove all int/int32 casts in service layer - Fix duplicate nil guard in Evaluate; drop dead SourceScope.Channel field - Migration 0048_acl_redesign Frontend - Drag-and-drop rule priority reordering (SortableJS/useSortable); fix reorder: compute new order from oldIndex/newIndex directly, not from the array (which useSortable syncs after onEnd) - Conversation scope selector: searchable popover backed by observed conversations (by identity or platform type); collapsible manual-ID fallback - Display: name as primary label, stable channel·type·id always shown as subtitle for verification - bot-terminal: accessibility fix on close-tab button (keyboard events) - i18n: drag-to-reorder, conversation source, manual IDs (en/zh) Tests: update fakeChatACL to Evaluate interface; fix SourceScope literals. SDK/spec regenerated.
51 lines
2.3 KiB
Go
51 lines
2.3 KiB
Go
package settings
|
|
|
|
const (
|
|
DefaultMaxContextLoadTime = 24 * 60
|
|
DefaultLanguage = "auto"
|
|
DefaultReasoningEffort = "medium"
|
|
DefaultHeartbeatInterval = 30
|
|
)
|
|
|
|
type Settings struct {
|
|
ChatModelID string `json:"chat_model_id"`
|
|
SearchProviderID string `json:"search_provider_id"`
|
|
MemoryProviderID string `json:"memory_provider_id"`
|
|
TtsModelID string `json:"tts_model_id"`
|
|
BrowserContextID string `json:"browser_context_id"`
|
|
MaxContextLoadTime int `json:"max_context_load_time"`
|
|
MaxContextTokens int `json:"max_context_tokens"`
|
|
Language string `json:"language"`
|
|
AclDefaultEffect string `json:"acl_default_effect"`
|
|
ReasoningEnabled bool `json:"reasoning_enabled"`
|
|
ReasoningEffort string `json:"reasoning_effort"`
|
|
HeartbeatEnabled bool `json:"heartbeat_enabled"`
|
|
HeartbeatInterval int `json:"heartbeat_interval"`
|
|
HeartbeatModelID string `json:"heartbeat_model_id"`
|
|
TitleModelID string `json:"title_model_id"`
|
|
CompactionEnabled bool `json:"compaction_enabled"`
|
|
CompactionThreshold int `json:"compaction_threshold"`
|
|
CompactionModelID string `json:"compaction_model_id,omitempty"`
|
|
}
|
|
|
|
type UpsertRequest struct {
|
|
ChatModelID string `json:"chat_model_id,omitempty"`
|
|
SearchProviderID string `json:"search_provider_id,omitempty"`
|
|
MemoryProviderID string `json:"memory_provider_id,omitempty"`
|
|
TtsModelID string `json:"tts_model_id,omitempty"`
|
|
BrowserContextID string `json:"browser_context_id,omitempty"`
|
|
MaxContextLoadTime *int `json:"max_context_load_time,omitempty"`
|
|
MaxContextTokens *int `json:"max_context_tokens,omitempty"`
|
|
Language string `json:"language,omitempty"`
|
|
AclDefaultEffect string `json:"acl_default_effect,omitempty"`
|
|
ReasoningEnabled *bool `json:"reasoning_enabled,omitempty"`
|
|
ReasoningEffort *string `json:"reasoning_effort,omitempty"`
|
|
HeartbeatEnabled *bool `json:"heartbeat_enabled,omitempty"`
|
|
HeartbeatInterval *int `json:"heartbeat_interval,omitempty"`
|
|
HeartbeatModelID string `json:"heartbeat_model_id,omitempty"`
|
|
TitleModelID string `json:"title_model_id,omitempty"`
|
|
CompactionEnabled *bool `json:"compaction_enabled,omitempty"`
|
|
CompactionThreshold *int `json:"compaction_threshold,omitempty"`
|
|
CompactionModelID *string `json:"compaction_model_id,omitempty"`
|
|
}
|