feat: support to adjust writing style (#290)

* feat: implment backend for adjust report style

* feat: add web part

* fix test cases

* fix: fix typing

---------

Co-authored-by: Henry Li <henry1943@163.com>
This commit is contained in:
DanielWalnut
2025-06-07 20:48:39 +08:00
committed by GitHub
parent cda3870add
commit 0e22c373af
14 changed files with 411 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ from typing import Any, Optional
from langchain_core.runnables import RunnableConfig
from src.rag.retriever import Resource
from src.config.report_style import ReportStyle
@dataclass(kw_only=True)
@@ -21,6 +22,7 @@ class Configuration:
max_step_num: int = 3 # Maximum number of steps in a plan
max_search_results: int = 3 # Maximum number of search results
mcp_settings: dict = None # MCP settings, including dynamic loaded tools
report_style: str = ReportStyle.ACADEMIC.value # Report style
@classmethod
def from_runnable_config(

View File

@@ -0,0 +1,8 @@
import enum
class ReportStyle(enum.Enum):
ACADEMIC = "academic"
POPULAR_SCIENCE = "popular_science"
NEWS = "news"
SOCIAL_MEDIA = "social_media"