extract Output trait: decouple AI core from Telegram

- Add src/output.rs with Output trait and 3 implementations:
  TelegramOutput (streaming via draft/edit), GiteaOutput (comments),
  BufferOutput (for worker/tests)
- Refactor run_openai_with_tools and execute_tool to use &mut dyn Output
- Remove run_claude_streaming, invoke_claude_streaming, run_openai_streaming
  (dead code — only OpenAI-compatible backend is used now)
- Remove BackendConfig::Claude code path from handler
- stream.rs: 790 → 150 lines
This commit is contained in:
Fam Zheng
2026-04-10 16:54:39 +00:00
parent dbd729ecb8
commit f646391f14
7 changed files with 344 additions and 702 deletions

View File

@@ -5,6 +5,7 @@ edition = "2021"
[dependencies]
anyhow = "1"
async-trait = "0.1"
axum = "0.8"
base64 = "0.22"
chrono = { version = "0.4", features = ["serde"] }