diff --git a/src/clients/chunker.rs b/src/clients/chunker.rs index 796ba0fa..b7911fcd 100644 --- a/src/clients/chunker.rs +++ b/src/clients/chunker.rs @@ -43,7 +43,7 @@ use crate::{ }; const DEFAULT_PORT: u16 = 8085; -const MODEL_ID_HEADER_NAME: &str = "mm-model-id"; +pub const MODEL_ID_HEADER_NAME: &str = "mm-model-id"; /// Default chunker that returns span for entire text pub const DEFAULT_CHUNKER_ID: &str = "whole_doc_chunker"; diff --git a/src/clients/detector.rs b/src/clients/detector.rs index 79084119..b0a95611 100644 --- a/src/clients/detector.rs +++ b/src/clients/detector.rs @@ -38,7 +38,7 @@ pub mod text_generation; pub use text_generation::*; const DEFAULT_PORT: u16 = 8080; -const DETECTOR_ID_HEADER_NAME: &str = "detector-id"; +pub const DETECTOR_ID_HEADER_NAME: &str = "detector-id"; #[derive(Debug, Clone, Deserialize)] pub struct DetectorError { diff --git a/src/config.rs b/src/config.rs index 14053db1..828e5219 100644 --- a/src/config.rs +++ b/src/config.rs @@ -67,6 +67,17 @@ pub struct ServiceConfig { pub tls: Option, } +impl ServiceConfig { + pub fn new(hostname: String, port: u16) -> Self { + Self { + hostname, + port: Some(port), + request_timeout: None, + tls: None, + } + } +} + /// TLS provider #[derive(Clone, Debug, Deserialize)] #[serde(untagged)] diff --git a/src/lib.rs b/src/lib.rs index f37c92e6..fc60b477 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,12 +18,12 @@ #![allow(clippy::iter_kv_map, clippy::enum_variant_names, async_fn_in_trait)] pub mod args; -mod clients; +pub mod clients; pub mod config; pub mod health; -mod models; +pub mod models; pub mod orchestrator; -mod pb; +pub mod pb; pub mod server; pub mod utils; #[allow(unused_imports)]