feat: add web search block functionality and integrate with existing plugins

- Introduced a new web search block plugin to handle web search queries and results.
- Updated copilot, doc block, and pro block plugins to include web search context in AI completions.
- Implemented utility functions for parsing and building web search markdown.
- Enhanced API to support web search requests and responses.
- Added configuration for web search URL and timeout settings.
- Updated size limit checks to account for web search content.
This commit is contained in:
“ydy0615”
2026-06-09 19:18:14 +08:00
parent 5a26dfde2a
commit 17d211bf93
38 changed files with 56764 additions and 10 deletions
+10
View File
@@ -47,6 +47,16 @@ def resolve_llm_policy(job_type: str, request_payload: dict[str, Any], config: R
temperature=config.pro_temperature,
thinking=_normalize_thinking(request_payload.get("pro_thinking"), allow_high=True) or "medium",
)
if job_type == "web_search":
return LLMPolicy(
job_type=job_type,
model=config.web_search_model,
profile="completion",
max_input_chars=config.web_search_max_input_chars,
max_output_tokens=config.web_search_max_output_tokens,
temperature=config.web_search_temperature,
thinking="low",
)
if job_type == "compress":
return LLMPolicy(
job_type=job_type,