Skip to main content

ManagedModel

Struct ManagedModel 

Source
pub struct ManagedModel {
Show 22 fields pub thinking_levels: Option<Vec<String>>, pub id: String, pub name: String, pub provider: String, pub model_id: String, pub max_tokens: i64, pub is_enabled: bool, pub price_per_m_tok: Option<f64>, pub is_default: Option<bool>, pub context_window: Option<i64>, pub capabilities: ModelCapabilities, pub min_plan_tier: Option<i64>, pub chat_runtime_supported: Option<bool>, pub default_tool_ids: Option<Vec<String>>, pub locked: Option<bool>, pub free_tier: Option<bool>, pub free_pool_eligible: Option<bool>, pub supported_formats: Option<Vec<String>>, pub preferred_format: Option<String>, pub bucket_info: Option<BucketInfo>, pub input_modalities: Option<Vec<InputModality>>, pub input_modalities_snake: Option<Vec<Value>>,
}
Expand description

托管模型。

Fields§

§thinking_levels: Option<Vec<String>>

Gateway-declared thinking levels. Missing means unknown; an empty list means no selectable levels. Unknown strings are retained for forward compatibility.

§id: String§name: String§provider: String§model_id: String§max_tokens: i64§is_enabled: bool§price_per_m_tok: Option<f64>

@deprecated 公开 /managed-models 端点不返回此字段。

§is_default: Option<bool>

@deprecated 公开 /managed-models 端点不返回此字段。

§context_window: Option<i64>§capabilities: ModelCapabilities§min_plan_tier: Option<i64>

P1 商品化档位门控:0=FREE..4=ULTRA。

§chat_runtime_supported: Option<bool>

该模型能否在 C 端对话(ADK 托管运行时)使用;false 时选择器应过滤。

§default_tool_ids: Option<Vec<String>>

模型默认绑定的工具 ID 列表。

§locked: Option<bool>

该模型对当前用户档位是否被限制策略锁定。true=展示但置灰+升级引导。

§free_tier: Option<bool>

是否属于“免费会员可用“分区(PLAN:FREE 档 allowedModels 内,仅分类,与当前用户档位无关)。

语义不变,但不再是展示分区依据:订阅双池之后「哪些模型先扣精选免费池」由 ManagedModel::free_pool_eligible 表达,两套集合可以不一致。新代码不要再用本字段分区或打 “精选“角标;字段保留只为老客户端零破坏(方案 D-14)。

§free_pool_eligible: Option<bool>

[订阅双池 P5 / D-14] 该模型此刻是否有资格先扣精选免费池 F(池类 FREE,或仍在限免期内的 PROMO_FREE);与 QuotaSummaryFreePool::eligible_models 同源。用于模型选择器的“精选“角标。

缺席(None)= 老网关(还没有双池),不是 Some(false):只在 == Some(true) 时画角标, 绝不在 != Some(false) 时画。限免到期会让同一模型随时间从 true 翻成 false,不要缓存跨过限免截止日。

§supported_formats: Option<Vec<String>>

上游 gateway 为此模型启用的请求格式列表:“anthropic” | “openai”。 空值表示上游未声明,SDK 回落 provider 硬编码分支(向后兼容)。

§preferred_format: Option<String>

上游建议客户端优先使用的格式:“anthropic” | “openai”;空值等价 supported_formats[0]。

§bucket_info: Option<BucketInfo>

当前用户在此模型上的桶余额聚合(V0.18 V30)。仅非 admin 用户上游才返回。

§input_modalities: Option<Vec<InputModality>>

模型可接收的用户输入模态(v1.2+)。 兼容上游字段名 input_modalities(snake_case)—— list_models 写缓存前会做归一化。 缺失语义:上游未下发时为 None,调用方必须保守按 text-only / unknown 处理。

§input_modalities_snake: Option<Vec<Value>>

上游 snake_case 别名 input_modalities。归一化前的原始字段,归一化后 SDK 用户只读 input_modalities(camel 字段 inputModalities)。对齐 TS normalizeInputModalities。

Trait Implementations§

Source§

impl Clone for ManagedModel

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ManagedModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ManagedModel

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ManagedModel

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ManagedModel

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more