mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-10 03:09:50 +08:00
feat(gateway): harden provider request execution
Preserve exact request payloads and model client surface and API operation explicitly. Add Anthropic compatibility profiles, bounded stream commitment, and scoped OAuth retry behavior across provider transports.
This commit is contained in:
@@ -44,6 +44,28 @@ impl ConversionMode {
|
||||
}
|
||||
}
|
||||
|
||||
/// Request/response adaptation applied after candidate selection.
|
||||
///
|
||||
/// This is independent from format conversion: a same-format request may be
|
||||
/// byte-transparent or may intentionally apply provider compatibility edits.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum AdaptationMode {
|
||||
NativeTransparent,
|
||||
SameFormatCompat,
|
||||
CrossFormat,
|
||||
}
|
||||
|
||||
impl AdaptationMode {
|
||||
pub const fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::NativeTransparent => "native_transparent",
|
||||
Self::SameFormatCompat => "same_format_compat",
|
||||
Self::CrossFormat => "cross_format",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub struct AiRequestGzipPolicy {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
|
||||
Reference in New Issue
Block a user