Skip to content

Commit

Permalink
Expose all modules publicly, make model header names pub, add Service…
Browse files Browse the repository at this point in the history
…Config::new (foundation-model-stack#267)

Signed-off-by: declark1 <[email protected]>
  • Loading branch information
declark1 authored Dec 24, 2024
1 parent d13676c commit a1271d3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/clients/chunker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/clients/detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 11 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ pub struct ServiceConfig {
pub tls: Option<Tls>,
}

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)]
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit a1271d3

Please sign in to comment.