refactor: move chat.rs to services/ rename search.rs -> code.rs

extract-routes
Meng Zhang 2023-11-11 14:35:19 -08:00
parent 4069fe735f
commit 8e58ff4003
7 changed files with 8 additions and 10 deletions

View File

@ -1,4 +1,3 @@
mod chat;
mod download;
mod serve;

View File

@ -9,7 +9,7 @@ use axum::{
use axum_streams::StreamBodyAs;
use tracing::instrument;
use crate::chat::{ChatCompletionRequest, ChatService};
use crate::services::chat::{ChatCompletionRequest, ChatService};
#[utoipa::path(
post,

View File

@ -32,7 +32,7 @@ use self::{
engine::{create_engine, EngineInfo},
health::HealthState,
};
use crate::{chat::ChatService, fatal};
use crate::{fatal, services::chat::ChatService};
#[derive(OpenApi)]
#[openapi(
@ -61,9 +61,9 @@ Install following IDE / Editor extensions to get started with [Tabby](https://gi
completions::Snippet,
completions::DebugOptions,
completions::DebugData,
crate::chat::ChatCompletionRequest,
crate::chat::Message,
crate::chat::ChatCompletionChunk,
crate::services::chat::ChatCompletionRequest,
crate::services::chat::Message,
crate::services::chat::ChatCompletionChunk,
health::HealthState,
health::Version,
SearchResponse,
@ -174,7 +174,7 @@ async fn load_model(args: &ServeArgs) {
}
async fn api_router(args: &ServeArgs, config: &Config) -> Router {
let code = Arc::new(crate::services::create_code_search());
let code = Arc::new(crate::services::code::create_code_search());
let completion_state = {
let (
engine,

View File

@ -1,3 +1,2 @@
mod search;
pub use search::*;
pub mod chat;
pub mod code;