Quellcode durchsuchen

【格式】移除未使用的导入并格式化代码

- 移除了未使用的导入语句,包括 QuestionTool、FinishTool、RethinkTool 和 ToolRegistry
- 优化了代码格式,包括缩进和空格
PJ568 vor 1 Jahr
Ursprung
Commit
0c047d3fef
3 geänderte Dateien mit 8 neuen und 11 gelöschten Zeilen
  1. 1 1
      Cargo.lock
  2. 1 1
      Cargo.toml
  3. 6 9
      src/main.rs

+ 1 - 1
Cargo.lock

@@ -2449,7 +2449,7 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
 
 [[package]]
 name = "yaa"
-version = "2.13.3"
+version = "2.13.4"
 dependencies = [
  "actix-cors",
  "actix-web",

+ 1 - 1
Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = "yaa"
-version = "2.13.3"
+version = "2.13.4"
 edition = "2024"
 
 [dependencies]

+ 6 - 9
src/main.rs

@@ -3,13 +3,10 @@ mod cli;
 mod core;
 use actix_cors::Cors;
 use actix_web::{App, HttpServer, web};
-use agent::tools::question::QuestionTool;
-use agent::tools::finish::FinishTool;
-use agent::tools::rethink::RethinkTool;
 use agent::{api::OpenAIClient, process_session};
 use clap::Parser;
 use cli::commands::{Commands, handle_command};
-use core::{session::SessionData, tool::ToolRegistry};
+use core::session::SessionData;
 use tokio;
 
 use anyhow::{Context, Result};
@@ -191,17 +188,17 @@ async fn main() -> std::io::Result<()> {
         HttpServer::new(move || {
             // 配置 CORS 中间件
             let cors = Cors::default()
-                .allow_any_origin()  // 允许所有来源
-                .allowed_methods(vec!["GET", "POST", "PUT", "DELETE"])  // 允许的方法
+                .allow_any_origin() // 允许所有来源
+                .allowed_methods(vec!["GET", "POST", "PUT", "DELETE"]) // 允许的方法
                 .allowed_headers(vec![
                     actix_web::http::header::AUTHORIZATION,
                     actix_web::http::header::ACCEPT,
                     actix_web::http::header::CONTENT_TYPE,
-                ])  // 允许的请求头
-                .max_age(3600);  // 预检请求缓存时间
+                ]) // 允许的请求头
+                .max_age(3600); // 预检请求缓存时间
 
             App::new()
-                .wrap(cors)  // 应用 CORS 中间件
+                .wrap(cors) // 应用 CORS 中间件
                 .app_data(web::Data::new(session_data.clone()))
                 .service(web::resource("/").route(web::post().to(handle_request)))
         })