Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
refactor(relay): 将Provider Key管理路由移至model_config模块 fix(saas): 修复demo_keys与provider_keys的匹配逻辑 perf(runtime): 将流式响应超时从60秒延长至180秒以适配思考型模型 docs: 新增模块化审计和上线前功能测试方案文档 chore: 添加tauri-plugin-mcp依赖及相关配置
21 lines
678 B
Rust
21 lines
678 B
Rust
//! 中转服务模块
|
|
|
|
pub mod types;
|
|
pub mod service;
|
|
pub mod handlers;
|
|
pub mod key_pool;
|
|
|
|
use axum::routing::{get, post};
|
|
use crate::state::AppState;
|
|
|
|
/// 中转服务路由 (需要认证 + quota 中间件)
|
|
pub fn routes() -> axum::Router<AppState> {
|
|
axum::Router::new()
|
|
// Relay 核心端点
|
|
.route("/api/v1/relay/chat/completions", post(handlers::chat_completions))
|
|
.route("/api/v1/relay/tasks", get(handlers::list_tasks))
|
|
.route("/api/v1/relay/tasks/:id", get(handlers::get_task))
|
|
.route("/api/v1/relay/tasks/:id/retry", post(handlers::retry_task))
|
|
.route("/api/v1/relay/models", get(handlers::list_available_models))
|
|
}
|