User af9faf26c9 feat(s2s): add S2S text dialog via /ws/realtime-text + event 501 ChatTextQuery
Dual-channel S2S architecture with full isolation between voice and text links:

Backend (Java):
- VolcRealtimeProtocol: add createChatTextQueryMessage (event 501)
- VoiceSessionState: add textMode / playAudioReply / disableGreeting fields
- VoiceWebSocketConfig: register second path /ws/realtime-text (same handler)
- VoiceWebSocketHandler: detect text mode from URL path
- VoiceGatewayService:
  * afterConnectionEstablished: overload with textMode flag
  * handleStart: parse playAudioReply / disableGreeting from client
  * buildStartSessionPayload: inject input_mod=text for text mode
  * handleDirectText: text mode sends event 501 directly, skip processReply
  * handleBinaryMessage: reject client audio in text mode
  * handleUpstreamBinary: drop S2S audio if text mode + no playback
  * startAudioKeepalive: skip entirely in text mode (no audio channel)
  * sendGreeting: skip greeting if disableGreeting=true

Frontend (test2 + delivery):
- nativeVoiceService: connect accepts clientMode/playAudioReply/disableGreeting
  * resolveWebSocketUrl accepts wsPath param
  * Text mode: no microphone capture, no playback context (unless playAudioReply)
  * New sendText() method for event 501 payload
  * handleAudioMessage drops audio in text mode without playback
  * Export NativeVoiceService class for multi-instance usage
- ChatPanel (test2): new useS2S / playAudioReply props
  * useS2S=true: creates NativeVoiceService instance, connects to /ws/realtime-text
  * subtitle events drive streaming UI, assistant_pending drives loading state
  * handleSend routes to WebSocket in S2S mode, HTTP/SSE in Coze mode
  * Voice link code path zero-changed

Verification: mvn test VoiceGatewaySmokeTest 20/20 pass, voice link regression-free
2026-04-17 09:33:56 +08:00
2026-03-12 12:47:56 +08:00
2026-03-12 12:47:56 +08:00
2026-03-12 12:47:56 +08:00
2026-03-12 12:47:56 +08:00
2026-03-12 12:47:56 +08:00
2026-03-12 12:47:56 +08:00
2026-03-12 12:47:56 +08:00
2026-03-12 12:47:56 +08:00
2026-03-12 12:47:56 +08:00
2026-03-12 12:47:56 +08:00

AI 知识库文档智能分块工具

将多种格式文档解析为文本,通过 DeepSeek API 进行语义级智能分块,输出为 Markdown 文件。

支持格式

PDF、Word (.docx)、Excel (.xlsx/.xls)、CSV、HTML、TXT/MD、图片 (PNG/JPG/BMP/GIF/WEBP)

安装

cd ai-knowledge-splitter
pip install -r requirements.txt

使用

python main.py <输入文件> -k <DeepSeek API Key> [-o 输出路径] [-d 分隔符]

示例:

# 基本用法(输出为同名 .md 文件)
python main.py report.pdf -k sk-xxxxxxxx

# 指定输出路径
python main.py data.docx -k sk-xxxxxxxx -o output/result.md

# 自定义分隔符
python main.py notes.txt -k sk-xxxxxxxx -d "==="

参数说明

参数 必需 说明
input_file 输入文件路径
-k, --api-key DeepSeek API Key
-o, --output 输出文件路径(默认:同名 .md
-d, --delimiter 分块分隔符(默认:---

运行测试

cd ai-knowledge-splitter
pytest tests/ -v
Description
No description provided
Readme 41 MiB
Languages
Python 100%