feat: Add database table for model context length configuration (#477)

* feat: add database table for model context length configuration

- Add model_context table with provider/model/context_limit fields
- Implement UPSERT endpoint for model context configuration
- Add priority lookup: database > config.yaml > custom_providers > cache
- Add frontend click-to-edit UI in ChatInput with tooltip
- Add i18n support for context editing dialog (all 8 locales)
- Use context_limit field consistently across frontend and backend

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: use useMessage() composable instead of window.$message in ChatInput

- Remove incorrect NMessage import (not a component)
- Use useMessage() composable from naive-ui
- Replace window.$message?.xxx() with message.xxx()
- Fixes TypeScript build errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-05-06 15:05:44 +08:00
committed by GitHub
parent f338aeea18
commit 479e1feef6
14 changed files with 406 additions and 3 deletions
+10
View File
@@ -104,6 +104,16 @@ export default {
// 채팅
chat: {
contextRemaining: '남음',
contextClickToEdit: '클릭하여 컨텍스트 길이 편집',
contextEditTitle: '컨텍스트 길이 편집',
contextEditDesc: '현재 모델의 컨텍스트 길이 제한 설정 (토큰 수)',
contextEditPlaceholder: '컨텍스트 길이 입력',
contextEditHint: '일반적인 값: 200k (Claude), 128k (GPT-4), 32k (GPT-3.5)',
contextEditSave: '저장',
contextEditCancel: '취소',
contextEditInvalid: '유효한 컨텍스트 길이를 입력하세요',
contextEditSuccess: '컨텍스트 길이가 업데이트되었습니다',
contextEditFailed: '업데이트 실패',
emptyState: 'Hermes Agent와 대화를 시작하세요',
inputPlaceholder: '메시지를 입력하세요... (Enter로 전송, Shift+Enter로 줄바꿈)',
attachFiles: '파일 첨부',