Files
DeepTutor/deeptutor/book/blocks/user_note.py
Bingxi Zhao (Frank) 2745e8bde9 feat(book): introduce book capability and restructure guide/co_writer modules
- 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
2026-04-20 00:33:33 +08:00

27 lines
685 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""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"]