mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-10 11:19:50 +08:00
refactor: 大规模模块拆分与代码精简,新增 ai-pipeline/data-contracts 独立 crate
- 新增 aether-ai-pipeline 和 aether-data-contracts crate,将 pipeline 逻辑与数据契约从 gateway 中解耦 - 重构 admin handlers:拆分单体模块为 auth/billing/endpoint/features/model/observability/provider/system 等独立子模块 - 合并 chat/cli 重复代码路径:精简 conversion、finalize、planner 中的 sync/chat/cli 分支 - 重构 scheduler/executor/data 层,引入 facade 模式降低模块间耦合 - 移除冗余的 intent 模块,将 plan_fallback/policy/stream_path/sync_path 迁移至 executor - 前端适配:调整 admin API 调用和 provider 模型测试对话框
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
use aether_data::repository::video_tasks::VideoTaskLookupKey;
|
||||
use aether_usage_runtime::{
|
||||
build_locally_actionable_report_context_from_request_candidate,
|
||||
build_locally_actionable_report_context_from_video_task,
|
||||
};
|
||||
use aether_data_contracts::repository::video_tasks::VideoTaskLookupKey;
|
||||
use aether_usage_runtime::build_locally_actionable_report_context_from_video_task;
|
||||
use serde_json::Value;
|
||||
|
||||
use crate::request_candidate_runtime::resolve_locally_actionable_request_candidate_report_context;
|
||||
use crate::video_tasks::{resolve_video_task_report_lookup, VideoTaskReportLookup};
|
||||
use crate::AppState;
|
||||
|
||||
@@ -20,7 +18,7 @@ pub(crate) async fn resolve_locally_actionable_report_context(
|
||||
}
|
||||
|
||||
if let Some(resolved) =
|
||||
resolve_locally_actionable_report_context_from_request_candidates(state, &context).await
|
||||
resolve_locally_actionable_request_candidate_report_context(state, &context).await
|
||||
{
|
||||
return Some(resolved);
|
||||
}
|
||||
@@ -30,7 +28,7 @@ pub(crate) async fn resolve_locally_actionable_report_context(
|
||||
.unwrap_or(context);
|
||||
|
||||
if let Some(resolved) =
|
||||
resolve_locally_actionable_report_context_from_request_candidates(state, &context).await
|
||||
resolve_locally_actionable_request_candidate_report_context(state, &context).await
|
||||
{
|
||||
return Some(resolved);
|
||||
}
|
||||
@@ -38,26 +36,6 @@ pub(crate) async fn resolve_locally_actionable_report_context(
|
||||
report_context_is_locally_actionable(Some(&context)).then_some(context)
|
||||
}
|
||||
|
||||
async fn resolve_locally_actionable_report_context_from_request_candidates(
|
||||
state: &AppState,
|
||||
context: &Value,
|
||||
) -> Option<Value> {
|
||||
let request_id = context
|
||||
.get("request_id")
|
||||
.and_then(Value::as_str)
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())?;
|
||||
let existing_candidates = state
|
||||
.read_request_candidates_by_request_id(request_id)
|
||||
.await
|
||||
.ok()?;
|
||||
if existing_candidates.len() != 1 {
|
||||
return None;
|
||||
}
|
||||
|
||||
build_locally_actionable_report_context_from_request_candidate(context, &existing_candidates[0])
|
||||
}
|
||||
|
||||
async fn resolve_locally_actionable_report_context_from_video_task(
|
||||
state: &AppState,
|
||||
context: &Value,
|
||||
|
||||
Reference in New Issue
Block a user