Unverified Commit 57bdbdf1 authored by Ryan Olson's avatar Ryan Olson Committed by GitHub
Browse files

feat: upgrade rust to v1.93.0 (#6802)


Signed-off-by: default avatarRyan Olson <rolson@nvidia.com>
parent 56212b49
...@@ -2735,20 +2735,20 @@ dependencies = [ ...@@ -2735,20 +2735,20 @@ dependencies = [
"cfg-if 1.0.4", "cfg-if 1.0.4",
"js-sys", "js-sys",
"libc", "libc",
"r-efi", "r-efi 5.3.0",
"wasip2", "wasip2",
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.4.1" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555"
dependencies = [ dependencies = [
"cfg-if 1.0.4", "cfg-if 1.0.4",
"libc", "libc",
"r-efi", "r-efi 6.0.0",
"wasip2", "wasip2",
"wasip3", "wasip3",
] ]
...@@ -3479,9 +3479,9 @@ dependencies = [ ...@@ -3479,9 +3479,9 @@ dependencies = [
[[package]] [[package]]
name = "ipnet" name = "ipnet"
version = "2.11.0" version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2"
[[package]] [[package]]
name = "iri-string" name = "iri-string"
...@@ -5980,6 +5980,12 @@ version = "5.3.0" ...@@ -5980,6 +5980,12 @@ version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "r-efi"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.8.5" version = "0.8.5"
...@@ -7473,7 +7479,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -7473,7 +7479,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"getrandom 0.4.1", "getrandom 0.4.2",
"once_cell", "once_cell",
"rustix 1.1.4", "rustix 1.1.4",
"windows-sys 0.61.2", "windows-sys 0.61.2",
...@@ -8546,7 +8552,7 @@ version = "1.21.0" ...@@ -8546,7 +8552,7 @@ version = "1.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb"
dependencies = [ dependencies = [
"getrandom 0.4.1", "getrandom 0.4.2",
"js-sys", "js-sys",
"serde_core", "serde_core",
"wasm-bindgen", "wasm-bindgen",
......
...@@ -994,7 +994,7 @@ pub unsafe extern "C" fn free_routing_result(result: *mut CRoutingResult) { ...@@ -994,7 +994,7 @@ pub unsafe extern "C" fn free_routing_result(result: *mut CRoutingResult) {
// Free token IDs // Free token IDs
if !res.token_ids.is_null() && res.token_count > 0 { if !res.token_ids.is_null() && res.token_count > 0 {
drop(unsafe { drop(unsafe {
Box::from_raw(std::slice::from_raw_parts_mut( Box::from_raw(std::ptr::slice_from_raw_parts_mut(
res.token_ids, res.token_ids,
res.token_count, res.token_count,
)) ))
......
...@@ -2287,20 +2287,20 @@ dependencies = [ ...@@ -2287,20 +2287,20 @@ dependencies = [
"cfg-if 1.0.4", "cfg-if 1.0.4",
"js-sys", "js-sys",
"libc", "libc",
"r-efi", "r-efi 5.3.0",
"wasip2", "wasip2",
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.4.1" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555"
dependencies = [ dependencies = [
"cfg-if 1.0.4", "cfg-if 1.0.4",
"libc", "libc",
"r-efi", "r-efi 6.0.0",
"wasip2", "wasip2",
"wasip3", "wasip3",
] ]
...@@ -2898,9 +2898,9 @@ dependencies = [ ...@@ -2898,9 +2898,9 @@ dependencies = [
[[package]] [[package]]
name = "ipnet" name = "ipnet"
version = "2.11.0" version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2"
[[package]] [[package]]
name = "iri-string" name = "iri-string"
...@@ -5199,6 +5199,12 @@ version = "5.3.0" ...@@ -5199,6 +5199,12 @@ version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "r-efi"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.8.5" version = "0.8.5"
...@@ -6375,7 +6381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -6375,7 +6381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"getrandom 0.4.1", "getrandom 0.4.2",
"once_cell", "once_cell",
"rustix 1.1.4", "rustix 1.1.4",
"windows-sys 0.61.2", "windows-sys 0.61.2",
...@@ -7311,7 +7317,7 @@ version = "1.21.0" ...@@ -7311,7 +7317,7 @@ version = "1.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb"
dependencies = [ dependencies = [
"getrandom 0.4.1", "getrandom 0.4.2",
"js-sys", "js-sys",
"serde_core", "serde_core",
"wasm-bindgen", "wasm-bindgen",
......
...@@ -2347,20 +2347,20 @@ dependencies = [ ...@@ -2347,20 +2347,20 @@ dependencies = [
"cfg-if 1.0.4", "cfg-if 1.0.4",
"js-sys", "js-sys",
"libc", "libc",
"r-efi", "r-efi 5.3.0",
"wasip2", "wasip2",
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.4.1" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555"
dependencies = [ dependencies = [
"cfg-if 1.0.4", "cfg-if 1.0.4",
"libc", "libc",
"r-efi", "r-efi 6.0.0",
"wasip2", "wasip2",
"wasip3", "wasip3",
] ]
...@@ -2958,9 +2958,9 @@ dependencies = [ ...@@ -2958,9 +2958,9 @@ dependencies = [
[[package]] [[package]]
name = "ipnet" name = "ipnet"
version = "2.11.0" version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2"
[[package]] [[package]]
name = "iri-string" name = "iri-string"
...@@ -5257,6 +5257,12 @@ version = "5.3.0" ...@@ -5257,6 +5257,12 @@ version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "r-efi"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.8.5" version = "0.8.5"
...@@ -6433,7 +6439,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -6433,7 +6439,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"getrandom 0.4.1", "getrandom 0.4.2",
"once_cell", "once_cell",
"rustix 1.1.4", "rustix 1.1.4",
"windows-sys 0.61.2", "windows-sys 0.61.2",
...@@ -7369,7 +7375,7 @@ version = "1.21.0" ...@@ -7369,7 +7375,7 @@ version = "1.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb"
dependencies = [ dependencies = [
"getrandom 0.4.1", "getrandom 0.4.2",
"js-sys", "js-sys",
"serde_core", "serde_core",
"wasm-bindgen", "wasm-bindgen",
......
...@@ -25,11 +25,12 @@ use super::BlockManager; ...@@ -25,11 +25,12 @@ use super::BlockManager;
/// Capacity settings for the TinyLFU frequency tracker used by /// Capacity settings for the TinyLFU frequency tracker used by
/// [`BlockRegistry`] and the multi-level LRU backend. /// [`BlockRegistry`] and the multi-level LRU backend.
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum FrequencyTrackingCapacity { pub enum FrequencyTrackingCapacity {
/// Small capacity: 2^18 (262,144) entries /// Small capacity: 2^18 (262,144) entries
Small, Small,
/// Medium capacity: 2^21 (2,097,152) entries - default /// Medium capacity: 2^21 (2,097,152) entries - default
#[default]
Medium, Medium,
/// Large capacity: 2^24 (16,777,216) entries /// Large capacity: 2^24 (16,777,216) entries
Large, Large,
...@@ -51,12 +52,6 @@ impl FrequencyTrackingCapacity { ...@@ -51,12 +52,6 @@ impl FrequencyTrackingCapacity {
} }
} }
impl Default for FrequencyTrackingCapacity {
fn default() -> Self {
Self::Medium
}
}
/// Configuration for the inactive pool backend. /// Configuration for the inactive pool backend.
pub enum InactiveBackendConfig { pub enum InactiveBackendConfig {
/// HashMap with configurable reuse policy /// HashMap with configurable reuse policy
......
...@@ -36,7 +36,7 @@ pub enum BlockDim { ...@@ -36,7 +36,7 @@ pub enum BlockDim {
/// ///
/// - `UniversalTP`: `[nh, nl, no, nt, hd]` - heads outermost for TP resharding /// - `UniversalTP`: `[nh, nl, no, nt, hd]` - heads outermost for TP resharding
/// - `OperationalNHD`: `[nl, no, nt, nh, hd]` - inner is `[nt, nh, hd]` /// - `OperationalNHD`: `[nl, no, nt, nh, hd]` - inner is `[nt, nh, hd]`
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
pub enum KvBlockLayout { pub enum KvBlockLayout {
/// Universal format: `[nh, nl, no, nt, hd]` /// Universal format: `[nh, nl, no, nt, hd]`
/// ///
...@@ -71,16 +71,10 @@ pub enum KvBlockLayout { ...@@ -71,16 +71,10 @@ pub enum KvBlockLayout {
/// ///
/// Operations involving Unknown layouts may fail or require explicit /// Operations involving Unknown layouts may fail or require explicit
/// configuration. /// configuration.
#[default]
Unknown, Unknown,
} }
impl Default for KvBlockLayout {
fn default() -> Self {
// Unknown until runtime detection determines the actual format
Self::Unknown
}
}
impl KvBlockLayout { impl KvBlockLayout {
/// Get the dimension ordering as an array. /// Get the dimension ordering as an array.
/// ///
......
...@@ -17,18 +17,13 @@ use serde::{Deserialize, Serialize}; ...@@ -17,18 +17,13 @@ use serde::{Deserialize, Serialize};
/// This enum describes how the blocks are organized and formatted in memory. /// This enum describes how the blocks are organized and formatted in memory.
/// Currently only `Operational` is supported, but future variants may include /// Currently only `Operational` is supported, but future variants may include
/// different compression schemes or memory layouts. /// different compression schemes or memory layouts.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
pub enum BlockFormat { pub enum BlockFormat {
/// Standard operational format - blocks are stored in their normal, uncompressed form. /// Standard operational format - blocks are stored in their normal, uncompressed form.
#[default]
Operational, Operational,
} }
impl Default for BlockFormat {
fn default() -> Self {
Self::Operational
}
}
/// Details specific to fully contiguous layouts. /// Details specific to fully contiguous layouts.
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FullyContiguousDetails { pub struct FullyContiguousDetails {
......
...@@ -17,18 +17,13 @@ use serde::{Deserialize, Serialize}; ...@@ -17,18 +17,13 @@ use serde::{Deserialize, Serialize};
/// This enum describes how the blocks are organized and formatted in memory. /// This enum describes how the blocks are organized and formatted in memory.
/// Currently only `Operational` is supported, but future variants may include /// Currently only `Operational` is supported, but future variants may include
/// different compression schemes or memory layouts. /// different compression schemes or memory layouts.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
pub enum BlockFormat { pub enum BlockFormat {
/// Standard operational format - blocks are stored in their normal, uncompressed form. /// Standard operational format - blocks are stored in their normal, uncompressed form.
#[default]
Operational, Operational,
} }
impl Default for BlockFormat {
fn default() -> Self {
Self::Operational
}
}
/// Details specific to fully contiguous layouts. /// Details specific to fully contiguous layouts.
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FullyContiguousDetails { pub struct FullyContiguousDetails {
......
...@@ -252,12 +252,8 @@ async fn evaluate( ...@@ -252,12 +252,8 @@ async fn evaluate(
} }
} }
entry.finish_reason = chat_comp.finish_reason; entry.finish_reason = chat_comp.finish_reason;
if chat_comp.finish_reason.is_some() { if let Some(finish_reason) = chat_comp.finish_reason.as_ref() {
tracing::trace!( tracing::trace!(request_id, "finish reason: {:?}", finish_reason);
request_id,
"finish reason: {:?}",
chat_comp.finish_reason.unwrap()
);
break; break;
} }
} }
......
...@@ -459,8 +459,8 @@ impl GrpcInferenceService for KserveService { ...@@ -459,8 +459,8 @@ impl GrpcInferenceService for KserveService {
let mut reply = ModelStreamInferResponse::try_from(data).map_err(|e| { let mut reply = ModelStreamInferResponse::try_from(data).map_err(|e| {
Status::invalid_argument(format!("Failed to parse response: {}", e)) Status::invalid_argument(format!("Failed to parse response: {}", e))
})?; })?;
if reply.infer_response.is_some() { if let Some(infer_response) = reply.infer_response.as_mut() {
reply.infer_response.as_mut().unwrap().id = request_id.clone(); infer_response.id = request_id.clone();
} }
yield reply; yield reply;
}, },
...@@ -514,8 +514,8 @@ impl GrpcInferenceService for KserveService { ...@@ -514,8 +514,8 @@ impl GrpcInferenceService for KserveService {
let mut reply = ModelStreamInferResponse::try_from(data).map_err(|e| { let mut reply = ModelStreamInferResponse::try_from(data).map_err(|e| {
Status::invalid_argument(format!("Failed to parse response: {}", e)) Status::invalid_argument(format!("Failed to parse response: {}", e))
})?; })?;
if reply.infer_response.is_some() { if let Some(infer_response) = reply.infer_response.as_mut() {
reply.infer_response.as_mut().unwrap().id = request_id.clone(); infer_response.id = request_id.clone();
} }
yield reply; yield reply;
}, },
...@@ -538,8 +538,8 @@ impl GrpcInferenceService for KserveService { ...@@ -538,8 +538,8 @@ impl GrpcInferenceService for KserveService {
let mut response: ModelStreamInferResponse = completion_response.try_into().map_err(|e| { let mut response: ModelStreamInferResponse = completion_response.try_into().map_err(|e| {
Status::invalid_argument(format!("Failed to parse response: {}", e)) Status::invalid_argument(format!("Failed to parse response: {}", e))
})?; })?;
if response.infer_response.is_some() { if let Some(infer_response) = response.infer_response.as_mut() {
response.infer_response.as_mut().unwrap().id = request_id.clone(); infer_response.id = request_id.clone();
} }
yield response; yield response;
} }
......
...@@ -657,7 +657,7 @@ impl OpenAIPreprocessor { ...@@ -657,7 +657,7 @@ impl OpenAIPreprocessor {
request_id = inner.context.id(), request_id = inner.context.id(),
"Cancellation issued last message; closing stream" "Cancellation issued last message; closing stream"
); );
inner.finished = true; // Mark as finished // inner.finished = true; // Mark as finished
return None; return None;
} }
......
...@@ -133,9 +133,9 @@ impl DeltaAggregator { ...@@ -133,9 +133,9 @@ impl DeltaAggregator {
} }
}; };
if aggregator.error.is_none() && delta.data.is_some() { if aggregator.error.is_none()
// Extract the data payload from the delta. && let Some(delta) = delta.data
let delta = delta.data.unwrap(); {
aggregator.id = delta.id; aggregator.id = delta.id;
aggregator.model = delta.model; aggregator.model = delta.model;
aggregator.created = delta.created; aggregator.created = delta.created;
......
...@@ -70,11 +70,12 @@ impl DeltaAggregator { ...@@ -70,11 +70,12 @@ impl DeltaAggregator {
} }
}; };
if aggregator.error.is_none() && delta.data.is_some() { if aggregator.error.is_none()
&& let Some(delta) = delta.data
{
// TODO(#14) - Aggregate Annotation // TODO(#14) - Aggregate Annotation
// these are cheap to move so we do it every time since we are consuming the delta // these are cheap to move so we do it every time since we are consuming the delta
let delta = delta.data.unwrap();
aggregator.id = delta.inner.id; aggregator.id = delta.inner.id;
aggregator.model = delta.inner.model; aggregator.model = delta.inner.model;
aggregator.created = delta.inner.created; aggregator.created = delta.inner.created;
......
...@@ -73,7 +73,7 @@ fn test_model_discovery_scoping_scenarios() { ...@@ -73,7 +73,7 @@ fn test_model_discovery_scoping_scenarios() {
// Scenario 1: Frontend configured for specific namespace should only see models from that namespace // Scenario 1: Frontend configured for specific namespace should only see models from that namespace
let frontend_namespace = "vllm-agg"; let frontend_namespace = "vllm-agg";
let available_models = vec![ let available_models = [
create_test_endpoint("vllm-agg", "backend", "generate"), create_test_endpoint("vllm-agg", "backend", "generate"),
create_test_endpoint("vllm-agg", "backend", "generate"), create_test_endpoint("vllm-agg", "backend", "generate"),
create_test_endpoint("sglang-prod", "backend", "generate"), create_test_endpoint("sglang-prod", "backend", "generate"),
...@@ -120,7 +120,7 @@ fn test_model_discovery_scoping_scenarios() { ...@@ -120,7 +120,7 @@ fn test_model_discovery_scoping_scenarios() {
fn test_namespace_boundary_conditions() { fn test_namespace_boundary_conditions() {
// Test edge cases and boundary conditions for namespace handling // Test edge cases and boundary conditions for namespace handling
let test_models = vec![ let test_models = [
create_test_endpoint("", "backend", "generate"), // Empty namespace create_test_endpoint("", "backend", "generate"), // Empty namespace
create_test_endpoint("dynamo", "backend", "generate"), // Global namespace create_test_endpoint("dynamo", "backend", "generate"), // Global namespace
create_test_endpoint("ns-with-special-chars_123", "backend", "generate"), create_test_endpoint("ns-with-special-chars_123", "backend", "generate"),
......
...@@ -15,21 +15,16 @@ pub use deepseek_v3_parser::{detect_tool_call_start_deepseek_v3, parse_tool_call ...@@ -15,21 +15,16 @@ pub use deepseek_v3_parser::{detect_tool_call_start_deepseek_v3, parse_tool_call
pub use super::config::JsonParserConfig; pub use super::config::JsonParserConfig;
pub use super::response::ToolCallResponse; pub use super::response::ToolCallResponse;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] #[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Default)]
pub enum JsonParserType { pub enum JsonParserType {
// Basic is generic json parser which can handle most of the cases // Basic is generic json parser which can handle most of the cases
#[default]
Basic, Basic,
// Model Specific JSON Parsers // Model Specific JSON Parsers
DeepseekV3, DeepseekV3,
DeepseekV31, DeepseekV31,
} }
impl Default for JsonParserType {
fn default() -> Self {
Self::Basic
}
}
pub fn try_tool_call_parse_json( pub fn try_tool_call_parse_json(
message: &str, message: &str,
config: &JsonParserConfig, config: &JsonParserConfig,
......
...@@ -1212,20 +1212,20 @@ dependencies = [ ...@@ -1212,20 +1212,20 @@ dependencies = [
"cfg-if 1.0.4", "cfg-if 1.0.4",
"js-sys", "js-sys",
"libc", "libc",
"r-efi", "r-efi 5.3.0",
"wasip2", "wasip2",
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.4.1" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555"
dependencies = [ dependencies = [
"cfg-if 1.0.4", "cfg-if 1.0.4",
"libc", "libc",
"r-efi", "r-efi 6.0.0",
"wasip2", "wasip2",
"wasip3", "wasip3",
] ]
...@@ -1646,9 +1646,9 @@ dependencies = [ ...@@ -1646,9 +1646,9 @@ dependencies = [
[[package]] [[package]]
name = "ipnet" name = "ipnet"
version = "2.11.0" version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2"
[[package]] [[package]]
name = "iri-string" name = "iri-string"
...@@ -2726,6 +2726,12 @@ version = "5.3.0" ...@@ -2726,6 +2726,12 @@ version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "r-efi"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.8.5" version = "0.8.5"
...@@ -3495,7 +3501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -3495,7 +3501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"getrandom 0.4.1", "getrandom 0.4.2",
"once_cell", "once_cell",
"rustix", "rustix",
"windows-sys 0.61.2", "windows-sys 0.61.2",
...@@ -4049,7 +4055,7 @@ version = "1.21.0" ...@@ -4049,7 +4055,7 @@ version = "1.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb"
dependencies = [ dependencies = [
"getrandom 0.4.1", "getrandom 0.4.2",
"js-sys", "js-sys",
"serde_core", "serde_core",
"wasm-bindgen", "wasm-bindgen",
......
[toolchain] [toolchain]
channel = "1.90.0" channel = "1.93.1"
...@@ -619,22 +619,17 @@ impl DistributedConfig { ...@@ -619,22 +619,17 @@ impl DistributedConfig {
/// - `Nats`: Use NATS for request distribution (legacy) /// - `Nats`: Use NATS for request distribution (legacy)
/// - `Http`: Use HTTP/2 for request distribution /// - `Http`: Use HTTP/2 for request distribution
/// - `Tcp`: Use raw TCP for request distribution with msgpack support (default) /// - `Tcp`: Use raw TCP for request distribution with msgpack support (default)
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum RequestPlaneMode { pub enum RequestPlaneMode {
/// Use NATS for request plane /// Use NATS for request plane
Nats, Nats,
/// Use HTTP/2 for request plane /// Use HTTP/2 for request plane
Http, Http,
/// Use raw TCP for request plane with msgpack support /// Use raw TCP for request plane with msgpack support
#[default]
Tcp, Tcp,
} }
impl Default for RequestPlaneMode {
fn default() -> Self {
Self::Tcp
}
}
impl fmt::Display for RequestPlaneMode { impl fmt::Display for RequestPlaneMode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
......
...@@ -163,8 +163,12 @@ impl StreamSender { ...@@ -163,8 +163,12 @@ impl StreamSender {
#[allow(clippy::needless_update)] #[allow(clippy::needless_update)]
pub async fn send_prologue(&mut self, error: Option<String>) -> Result<(), String> { pub async fn send_prologue(&mut self, error: Option<String>) -> Result<(), String> {
if let Some(prologue) = self.prologue.take() { // leaving the original logic in place for now
let prologue = ResponseStreamPrologue { error, ..prologue }; // error overrides the dissolved prologue, but the only field on `ResponseStreamPrologue` is `error`
// so the second argument can never be used, and the value of error passed by the caller would always be used
if let Some(_prologue) = self.prologue.take() {
// let prologue = ResponseStreamPrologue { error, ..prologue };
let prologue = ResponseStreamPrologue { error };
let header_bytes: Bytes = match serde_json::to_vec(&prologue) { let header_bytes: Bytes = match serde_json::to_vec(&prologue) {
Ok(b) => b.into(), Ok(b) => b.into(),
Err(err) => { Err(err) => {
......
[toolchain] [toolchain]
channel = "1.90.0" channel = "1.93.1"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment