diff --git a/crates/tabby-common/src/config.rs b/crates/tabby-common/src/config.rs index 673e1ed..21e23cc 100644 --- a/crates/tabby-common/src/config.rs +++ b/crates/tabby-common/src/config.rs @@ -12,14 +12,8 @@ use crate::path::{config_file, repositories_dir}; pub struct Config { #[serde(default)] pub repositories: Vec, - - #[serde(default)] - pub swagger: SwaggerConfig, } -#[derive(Serialize, Deserialize, Default)] -pub struct SwaggerConfig {} - impl Config { pub fn load() -> Result { let file = serdeconv::from_toml_file(crate::path::config_file().as_path()); diff --git a/crates/tabby-scheduler/tests/integration_test.rs b/crates/tabby-scheduler/tests/integration_test.rs index 7bb23b9..54fe60d 100644 --- a/crates/tabby-scheduler/tests/integration_test.rs +++ b/crates/tabby-scheduler/tests/integration_test.rs @@ -3,7 +3,7 @@ mod tests { use std::fs::create_dir_all; use tabby_common::{ - config::{Config, Repository, SwaggerConfig}, + config::{Config, Repository}, path::set_tabby_root, }; use temp_testdir::*; @@ -20,7 +20,6 @@ mod tests { repositories: vec![Repository { git_url: "https://github.com/TabbyML/interview-questions".to_owned(), }], - swagger: SwaggerConfig {}, }; config.save(); diff --git a/crates/tabby/src/serve/mod.rs b/crates/tabby/src/serve/mod.rs index f1c3320..70faad8 100644 --- a/crates/tabby/src/serve/mod.rs +++ b/crates/tabby/src/serve/mod.rs @@ -15,10 +15,7 @@ use std::{ use axum::{routing, Router, Server}; use axum_tracing_opentelemetry::opentelemetry_tracing_layer; use clap::Args; -use tabby_common::{ - config::{Config, SwaggerConfig}, - usage, -}; +use tabby_common::{config::Config, usage}; use tabby_download::Downloader; use tokio::time::sleep; use tower_http::{cors::CorsLayer, timeout::TimeoutLayer}; @@ -128,7 +125,7 @@ fn should_download_ggml_files(device: &Device) -> bool { *device == Device::Metal } -pub async fn main(config: &Config, args: &ServeArgs) { +pub async fn main(_config: &Config, args: &ServeArgs) { valid_args(args); if args.device != Device::ExperimentalHttp { @@ -143,7 +140,7 @@ pub async fn main(config: &Config, args: &ServeArgs) { info!("Starting server, this might takes a few minutes..."); let mut doc = ApiDoc::openapi(); - doc.override_doc(args, &config.swagger); + doc.override_doc(args); let app = Router::new() .route("/", routing::get(playground::handler)) @@ -286,11 +283,11 @@ async fn download_model(model: &str, device: &Device) { } trait OpenApiOverride { - fn override_doc(&mut self, args: &ServeArgs, config: &SwaggerConfig); + fn override_doc(&mut self, args: &ServeArgs); } impl OpenApiOverride for utoipa::openapi::OpenApi { - fn override_doc(&mut self, args: &ServeArgs, _config: &SwaggerConfig) { + fn override_doc(&mut self, args: &ServeArgs) { if args.chat_model.is_none() { self.paths.paths.remove("/v1beta/chat/completions");