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
+14
View File
@@ -48,6 +48,8 @@ JOB_COMPLETION_CONCURRENCY=2
JOB_COMPLETION_MAX_QUEUE=16
JOB_PRO_COMPLETION_CONCURRENCY=1
JOB_PRO_COMPLETION_MAX_QUEUE=8
JOB_WEB_SEARCH_CONCURRENCY=1
JOB_WEB_SEARCH_MAX_QUEUE=4
JOB_COMPRESS_CONCURRENCY=1
JOB_COMPRESS_MAX_QUEUE=8
JOB_OCR_CONCURRENCY=1
@@ -89,16 +91,28 @@ RISK_ENFORCE_REDIS_FAIL_CLOSED=false
RISK_COMPLETION_MODEL=gpt-4.1-mini
RISK_PRO_MODEL=gpt-4.1
RISK_VISION_MODEL=gpt-4.1-mini
RISK_WEB_SEARCH_MODEL=gpt-4.1-mini
RISK_COMPLETION_MAX_INPUT_CHARS=24000
RISK_COMPLETION_MAX_OUTPUT_TOKENS=768
RISK_COMPLETION_TEMPERATURE=0.4
RISK_PRO_MAX_INPUT_CHARS=48000
RISK_PRO_MAX_OUTPUT_TOKENS=2048
RISK_PRO_TEMPERATURE=0.6
RISK_WEB_SEARCH_MAX_INPUT_CHARS=128000
RISK_WEB_SEARCH_MAX_OUTPUT_TOKENS=4096
RISK_WEB_SEARCH_TEMPERATURE=0.4
RISK_COMPRESS_MAX_INPUT_CHARS=128000
RISK_COMPRESS_MAX_OUTPUT_TOKENS=1536
RISK_OCR_MAX_INPUT_BYTES=10485760
# Web search providers
SEARXNG_BASE_URL=http://searxng:8080
SEARXNG_RESULT_LIMIT=10
FIRECRAWL_BASE_URL=http://firecrawl:3002
FIRECRAWL_API_KEY=change-me
WEB_SEARCH_QUERY_COUNT=4
WEB_SEARCH_SELECTED_URL_LIMIT=10
# Estimated pricing for budget control
RISK_COMPLETION_INPUT_COST_PER_1K=0.0004
RISK_COMPLETION_OUTPUT_COST_PER_1K=0.0016