feat: 知识库文件夹/模板、技能压缩设置与摘要窗口调优
- 知识库新增文件夹与模板支持(模型/仓储/服务/迁移),前端知识管理组件 - 岗位管理模型与接口完善 - 技能新增压缩设置页与相关存储/工具能力 - 系统设置扩展配置项 - 摘要中间件 keep 窗口改用 token 预算(16000),减少重复压缩 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e6662cf673
commit
5ebbb82d66
54 files changed
+2658
-100
No files matched your search
+5
-4
@@ -1,8 +1,8 @@
|
||||
"""ORM models for 岗位 (positions) and their per-resource tag bindings.
|
||||
|
||||
A **position** (岗位) is an admin-managed aggregation layer that decides which
|
||||
agents / skills / scheduled tasks / custom prompts / recommended questions a
|
||||
user is subscribed to. Each user has at most one position (the link lives on
|
||||
agents / skills / scheduled tasks / recommended questions a user is subscribed
|
||||
to. Each user has at most one position (the link lives on
|
||||
``users.position_id``, a 1:1 relation — see ``UserRow``).
|
||||
|
||||
Two tables here:
|
||||
@@ -26,8 +26,9 @@ from deerflow.persistence.base import Base
|
||||
from deerflow.persistence.types import BeijingDateTime
|
||||
|
||||
# Resource types a position can grant. The first three reuse the existing
|
||||
# typed-tag namespace (``deerflow.persistence.tags``); ``user_prompt`` and
|
||||
# ``recommended_question`` are added by the same change (see TAG_TYPES).
|
||||
# typed-tag namespace (``deerflow.persistence.tags``); ``recommended_question``
|
||||
# was added alongside (see TAG_TYPES). The removed ``user_prompt`` type is no
|
||||
# longer accepted — ``get_tag_bindings`` drops any stale rows of that type.
|
||||
POSITION_RESOURCE_TYPES: tuple[str, ...] = (
|
||||
"agent",
|
||||
"skill",
|
||||
|
||||
+6
-1
@@ -11,7 +11,7 @@ from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
|
||||
|
||||
from deerflow.persistence.positions.base import PositionStore
|
||||
from deerflow.persistence.positions.model import PositionRow, PositionTagBindingRow
|
||||
from deerflow.persistence.positions.model import POSITION_RESOURCE_TYPES, PositionRow, PositionTagBindingRow
|
||||
from deerflow.persistence.user.model import UserRow
|
||||
|
||||
|
||||
@@ -134,6 +134,11 @@ class PositionRepository(PositionStore):
|
||||
)
|
||||
out: dict[str, list[str]] = {}
|
||||
for r in rows:
|
||||
# Drop bindings for resource types no longer supported (e.g. the
|
||||
# removed ``user_prompt`` type) so stale rows can't poison the
|
||||
# editor or be echoed back into a 422 on save.
|
||||
if r.resource_type not in POSITION_RESOURCE_TYPES:
|
||||
continue
|
||||
out.setdefault(r.resource_type, []).append(r.tag_id)
|
||||
return out
|
||||
|
||||
|
||||
Reference in new issue
Block a user