feat 接入report

This commit is contained in:
zcr
2026-03-04 09:57:38 +08:00
parent 129510363a
commit 62b4505261
3 changed files with 6 additions and 5 deletions

View File

@@ -17,7 +17,9 @@ ENV PATH="/env_build/.venv/bin:$PATH"
WORKDIR /app WORKDIR /app
# 更新索引并安装替代包 # 更新索引并安装替代包
RUN apt-get update && apt-get install -y vim RUN apt-get update && apt-get install -y vim libxcb-shm0 libx11-xcb1 libx11-6 libxcb1 libxext6 libxrandr2 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxi6 libgtk-3-0t64 libpangocairo-1.0-0 libpango-1.0-0 libatk1.0-0t64 libcairo-gobject2 libcairo2 libgdk-pixbuf-2.0-0 libglib2.0-0t64 libxrender1 libasound2t64 libfreetype6 libfontconfig1 libdbus-1-3 libnss3 libgbm1 libatspi2.0-0 libcups2 libdrm2 libxkbcommon0
RUN playwright install
#CMD ["tail","-f","/dev/null"] #CMD ["tail","-f","/dev/null"]
# Run the application. # Run the application.

View File

@@ -31,6 +31,8 @@ async def chat_stream(request: ChatRequest):
* `checkpoint_id`: (可选) 历史快照 ID。 * `checkpoint_id`: (可选) 历史快照 ID。
* `config_params`: (可选) 对话配置参数 * `config_params`: (可选) 对话配置参数
* `require_suggestion`: (可选) 是否需要建议按钮 * `require_suggestion`: (可选) 是否需要建议按钮
* `use_report`: (可选) 是否需要使用report功能 true/false
#### 3. 响应流说明 (Data Format) #### 3. 响应流说明 (Data Format)
响应以 `data: ` 开头的 JSON 字符串流形式发送: 响应以 `data: ` 开头的 JSON 字符串流形式发送:

View File

@@ -3,7 +3,7 @@ import asyncio
from typing import List from typing import List
from urllib.parse import urlparse from urllib.parse import urlparse
from pathlib import Path from pathlib import Path
from crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode
from langchain_core.tools import tool from langchain_core.tools import tool
# ─────────────── 重要:計算路徑 ─────────────── # ─────────────── 重要:計算路徑 ───────────────
@@ -40,9 +40,6 @@ async def crawl4ai_batch(urls: List[str]) -> str:
# print(f"🕷️ 正在并行爬取 {len(urls)} 个 URL...") # print(f"🕷️ 正在并行爬取 {len(urls)} 个 URL...")
# print(f"儲存目錄: {SAVE_DIR}") # print(f"儲存目錄: {SAVE_DIR}")
# Crawl4AI 配置(保持原樣)
from crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode
browser_config = BrowserConfig( browser_config = BrowserConfig(
headless=True, headless=True,
verbose=False, verbose=False,