[model-gateway] include smg version command in py binding (#14274)

This commit is contained in:
Simo Lin
2025-12-01 21:21:02 -08:00
committed by GitHub
parent e6420100ee
commit 73df525382
2 changed files with 24 additions and 0 deletions
+14
View File
@@ -704,6 +704,18 @@ impl Router {
}
}
/// Get formatted version information string with full build details
#[pyfunction]
fn get_version_string() -> String {
version::get_version_string()
}
/// Get short version information string
#[pyfunction]
fn get_short_version_string() -> String {
version::get_short_version_string()
}
#[pymodule]
fn sglang_router_rs(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<PolicyType>()?;
@@ -712,5 +724,7 @@ fn sglang_router_rs(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<PyOracleConfig>()?;
m.add_class::<PyPostgresConfig>()?;
m.add_class::<Router>()?;
m.add_function(wrap_pyfunction!(get_version_string, m)?)?;
m.add_function(wrap_pyfunction!(get_short_version_string, m)?)?;
Ok(())
}