mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-02 01:20:23 +08:00
* feat: add custom system message setting for AI personalization Allow users to enter custom instructions via a textarea in Settings that get appended to the AI's system prompt. Includes server-side validation (type check + 5000 char limit), localStorage persistence, and i18n support for all 4 locales. * fix: add accessibility htmlFor/id pairing on custom system message textarea
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
// Centralized localStorage keys for quota tracking and settings
|
|
// Chat data is now stored in IndexedDB via session-storage.ts
|
|
|
|
export const STORAGE_KEYS = {
|
|
// Quota tracking
|
|
requestCount: "next-ai-draw-io-request-count",
|
|
requestDate: "next-ai-draw-io-request-date",
|
|
tokenCount: "next-ai-draw-io-token-count",
|
|
tokenDate: "next-ai-draw-io-token-date",
|
|
tpmCount: "next-ai-draw-io-tpm-count",
|
|
tpmMinute: "next-ai-draw-io-tpm-minute",
|
|
|
|
// Settings
|
|
accessCode: "next-ai-draw-io-access-code",
|
|
accessCodeRequired: "next-ai-draw-io-access-code-required",
|
|
aiProvider: "next-ai-draw-io-ai-provider",
|
|
aiBaseUrl: "next-ai-draw-io-ai-base-url",
|
|
aiApiKey: "next-ai-draw-io-ai-api-key",
|
|
aiModel: "next-ai-draw-io-ai-model",
|
|
|
|
// Multi-model configuration
|
|
modelConfigs: "next-ai-draw-io-model-configs",
|
|
selectedModelId: "next-ai-draw-io-selected-model-id",
|
|
|
|
// Chat input preferences
|
|
sendShortcut: "next-ai-draw-io-send-shortcut",
|
|
|
|
// Diagram validation
|
|
vlmValidationEnabled: "next-ai-draw-io-vlm-validation-enabled",
|
|
|
|
// Custom system message
|
|
customSystemMessage: "next-ai-draw-io-custom-system-message",
|
|
} as const
|