mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-07 04:47:44 +08:00
- Add new `deeptutor/book/` module with multi-agent pipeline (ideation, spine, page planner, source explorer, synthesizer) and rich block system (text, code, figure, quiz, flash cards, callout, deep dive, timeline, animation, concept graph, etc.) - Add `/api/routers/book.py` and `deeptutor_cli/book.py` entry points - Add web UI under `web/app/(workspace)/book/` with sidebar, chat panel, page reader, spine editor, progress timeline, and block renderers - Move `deeptutor/agents/co_writer` -> `deeptutor/co_writer` and `deeptutor/agents/guide` -> `deeptutor/guide` (then remove guide entirely now superseded by book) - Remove legacy guide UI, hooks, types, and API router - Update visualize agents/prompts, notebook service, prompt manager, session turn runtime, and shared services to support new flows - Refresh chat composer, sidebar, notebook selector, and locales Made-with: Cursor
27 lines
685 B
Python
27 lines
685 B
Python
"""User note block – passthrough; user-authored content has no LLM step."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from ..models import BlockType, SourceAnchor
|
|
from .base import BlockContext, BlockGenerator
|
|
|
|
|
|
class UserNoteGenerator(BlockGenerator):
|
|
block_type = BlockType.USER_NOTE
|
|
|
|
async def _generate(
|
|
self, ctx: BlockContext
|
|
) -> tuple[dict[str, Any], list[SourceAnchor], dict[str, Any]]:
|
|
params = ctx.block.params
|
|
body = str(params.get("body") or "").strip()
|
|
return (
|
|
{"format": "markdown", "body": body, "author": "user"},
|
|
[],
|
|
{},
|
|
)
|
|
|
|
|
|
__all__ = ["UserNoteGenerator"]
|