Files
freedak f7a720204a Update: 将子项目从 submodule 转为完整内容
- 移除 GovAI, nomifun-tauri, 算力盒子 的 submodule 引用
- 添加所有子项目的完整源代码
- 保留原始 .git 为 .git.bak 备份
2026-07-04 19:20:46 +08:00

54 lines
1.6 KiB
Go

package config
import "time"
// ==================== 分页与查询 ====================
const (
DefaultPage = 1
DefaultPageSize = 20
MaxPageSize = 100
)
// ==================== Token 与会话 ====================
const (
DefaultAccessTokenExpiry = 24 * time.Hour
DefaultRefreshTokenExpiry = 7 * 24 * time.Hour
TokenHeader = "Authorization"
TokenPrefix = "Bearer "
)
// ==================== 文件上传 ====================
const (
MaxFileSize = 10 * 1024 * 1024 // 10MB
AllowedFileExtensions = ".pdf,.doc,.docx,.txt,.md,.jpg,.jpeg,.png,.gif,.xlsx,.xls"
AllowedMimeTypes = "application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,text/plain,text/markdown,image/jpeg,image/png,image/gif,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)
// ==================== AI 模型 ====================
const (
DefaultEmbeddingDimensions = 1024
DefaultEmbeddingModel = "text-embedding-v3"
DefaultLLMTemperature = 0.7
DefaultLLMTopP = 0.95
DefaultLLMMaxTokens = 8192
)
// ==================== RateLimit ====================
const (
DefaultRateLimitMax = 100
DefaultRateLimitWindow = 1 * time.Minute
)
// ==================== Redis Key 前缀 ====================
const (
RedisKeyPrefixRateLimit = "rl:"
RedisKeyPrefixSession = "session:"
RedisKeyPrefixToken = "token:"
RedisKeyPrefixCache = "cache:"
)
// ==================== Chat ====================
const (
MaxConversationHistory = 50
MaxMessageLength = 4000
)