mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 18:00:11 +08:00
Capability infrastructure:
- New capabilities/_shared.emit_capability_result helper fills the
result envelope (label, summary, payload, render hints, UsageTracker
totals) consistently across modes.
- StatusI18n loads capability status copy from
capabilities/prompts/{en,zh}/<name>.yaml; legacy main.yaml strings
removed.
- New capabilities_settings router + service-config module power the
/settings/capabilities admin page (live capability list, defaults,
per-capability overrides).
Visualize + Animator merge:
- Visualize's AnalysisAgent now picks one of six render_types:
svg / chartjs / mermaid / html (text pipeline) or manim_video /
manim_image (Manim subprocess). The result envelope carries
render_type so the frontend delegates to the right viewer.
- math_animator capability is folded behind Visualize; the standalone
MathAnimatorConfigPanel.tsx is removed. The Animator sidebar entry
is gone, but Manim outputs and existing records remain unaffected.
Settings UI:
- /settings page split into appearance / capabilities / embedding /
llm / mcp / memory / search / status / tools tabs with a shared
layout and items index.
- New /settings/tools page lists chat-mountable tools and surfaces
availability (e.g. gh for github_query) via a new tools router.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
"""Capabilities settings endpoint.
|
|
|
|
Surfaces the per-capability tunables (temperature, max_tokens, stage
|
|
budgets, iteration limits) currently scattered across
|
|
``data/user/settings/agents.yaml`` and ``data/user/settings/main.yaml``.
|
|
|
|
Mirrors the pattern used by ``/api/v1/memory/settings``:
|
|
|
|
* ``GET /settings`` → returns the full schema with defaults merged in.
|
|
* ``PUT /settings`` → merges payload back into both YAML files and
|
|
returns the new state.
|
|
|
|
Validation lives in
|
|
:mod:`deeptutor.services.config.capabilities_settings` so the API stays
|
|
a thin transport layer.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from fastapi import APIRouter
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/settings")
|
|
async def get_capabilities_settings_endpoint() -> dict[str, Any]:
|
|
from deeptutor.services.config.capabilities_settings import capabilities_settings_dict
|
|
|
|
return capabilities_settings_dict()
|
|
|
|
|
|
@router.put("/settings")
|
|
async def put_capabilities_settings(payload: dict[str, Any]) -> dict[str, Any]:
|
|
from deeptutor.services.config.capabilities_settings import save_capabilities_settings
|
|
|
|
return save_capabilities_settings(payload)
|