ModeStrategy (research/mode_strategy.py)

DeepTutor · deeptutor/agents/research/mode_strategy.py · python · Apache-2.0
ai, tag:embed-classified

Defines research mode strategies and validation for LLM output.

# Source: https://github.com/HKUDS/DeepTutor | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Mode strategy abstraction for deep research.

Each research mode (notes, report, comparison, learning_path) is represented
as a ``ModeStrategy`` dataclass.  ``STRATEGIES`` acts as the single source of
truth that ``request_config._build_mode_policy`` delegates to.

``validate_output`` provides lightweight post-generation checks so callers can
surface warnings when the LLM drifted away from the mode contract.
"""

from __future__ import annotations

from dataclasses import dataclass, field
import re
from typing import Literal

ResearchMode = Literal["notes", "report", "comparison", "learni

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key