diff --git a/src/error.rs b/src/error.rs index 2526d3d..2dd3389 100644 --- a/src/error.rs +++ b/src/error.rs @@ -14,7 +14,6 @@ pub enum Error { RequestError, SerializationError, DeserializationError, - MissingChoiceError, StreamError, } diff --git a/src/main.rs b/src/main.rs index 159be39..87fc49e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,10 +2,9 @@ use std::net::SocketAddr; use axum::Server; -pub use self::error::{Error, Result}; - mod env; mod error; +mod prelude; mod signal; mod web; diff --git a/src/prelude.rs b/src/prelude.rs new file mode 100644 index 0000000..af4fb59 --- /dev/null +++ b/src/prelude.rs @@ -0,0 +1 @@ +pub use crate::error::{Error, Result}; diff --git a/src/web/generate.rs b/src/web/generate.rs index 7b6eaed..f7bd6dd 100644 --- a/src/web/generate.rs +++ b/src/web/generate.rs @@ -6,10 +6,7 @@ use futures::{StreamExt, TryStreamExt}; use reqwest::{header, Client}; use serde::{Deserialize, Serialize}; -use crate::{ - env, - error::{Error, Result}, -}; +use crate::{env, prelude::*}; #[derive(Debug, Serialize)] struct ChatCompletionsBody { diff --git a/src/web/health.rs b/src/web/health.rs index f90e4fa..bcafc91 100644 --- a/src/web/health.rs +++ b/src/web/health.rs @@ -3,10 +3,7 @@ use std::time::SystemTime; use axum::{response::IntoResponse, Json}; use serde::Serialize; -use crate::{ - env, - error::{Error, Result}, -}; +use crate::{env, prelude::*}; #[derive(Debug, Serialize)] struct HealthBody {