morning-start/prism/provider/meta does not have a README file

    FieldConstraint

    pub struct FieldConstraint {
    min_val : Double?
    max_val : Double?
    required : Bool
    allowed_values : Array[String]?
    }

    FieldConstraint — 单字段约束

    required 只描述「字段必须出现」,与取值上下界相互独立。 默认构造器(any / range / min / max)都产出可选字段, 需要必填时用 required(true) 或 *_required 变体显式声明。

    FieldConstraint::allowed

    fn FieldConstraint::allowed(self : FieldConstraint) -> Array[String]?

    FieldConstraint::any

    无约束(可选、无上下界、无枚举限制)

    FieldConstraint::any_optional

    fn FieldConstraint::any_optional() -> FieldConstraint

    FieldConstraint::any_required

    fn FieldConstraint::any_required() -> FieldConstraint

    FieldConstraint::is_required

    fn FieldConstraint::is_required(self : FieldConstraint) -> Bool

    FieldConstraint::max

    fn FieldConstraint::max(max_val : Double) -> FieldConstraint

    上界 max(含),可选字段

    FieldConstraint::max_bound

    fn FieldConstraint::max_bound(self : FieldConstraint) -> Double?

    FieldConstraint::min

    fn FieldConstraint::min(min_val : Double) -> FieldConstraint

    下界 min(含),可选字段

    FieldConstraint::min_bound

    fn FieldConstraint::min_bound(self : FieldConstraint) -> Double?

    FieldConstraint::min_required

    fn FieldConstraint::min_required(min_val : Double) -> FieldConstraint

    下界 min(含),必填字段

    FieldConstraint::new

    fn FieldConstraint::new(min_val : Double?, max_val : Double?, required : Bool, allowed_values : Array[String]?) -> FieldConstraint

    FieldConstraint::one_of

    fn FieldConstraint::one_of(allowed_values : Array[String]) -> FieldConstraint

    枚举白名单约束

    FieldConstraint::range

    fn FieldConstraint::range(min_val : Double, max_val : Double) -> FieldConstraint

    闭区间 [min, max],可选字段

    FieldConstraint::range_required

    fn FieldConstraint::range_required(min_val : Double, max_val : Double) -> FieldConstraint

    闭区间 [min, max],必填字段

    FieldConstraint::required

    fn FieldConstraint::required(required : Bool) -> FieldConstraint

    仅声明是否必填

    ProviderMeta

    pub struct ProviderMeta {
    name : String
    aliases : Array[String]
    model_pattern : String
    capability :
    ProviderCapability

    schema : ProviderSchema
    }

    ProviderMeta — provider 身份 + 能力 + schema 的唯一来源

    ProviderMeta::aliases

    fn ProviderMeta::aliases(self : ProviderMeta) -> Array[String]

    ProviderMeta::model_pattern

    fn ProviderMeta::model_pattern(self : ProviderMeta) -> String

    ProviderMeta::name

    fn ProviderMeta::name(self : ProviderMeta) -> String

    ProviderMeta::new

    fn ProviderMeta::new(name : String, aliases : Array[String], model_pattern : String, capability :
    ProviderCapability
    , schema : ProviderSchema) -> ProviderMeta

    ProviderMeta::schema

    ProviderSchema

    pub struct ProviderSchema {
    provider_name : String
    temperature : FieldConstraint
    top_p : FieldConstraint
    top_k : FieldConstraint
    max_output_tokens : FieldConstraint
    resp_min_choices : Int
    supports_tools : Bool
    supports_system_instruction : Bool
    supported_reasoning_efforts : Array[String]?
    extra_checks : Array[() -> Array[String]]?
    }

    ProviderSchema — 单个 Provider 的请求/响应字段约束集合

    ProviderSchema::max_output_tokens

    fn ProviderSchema::max_output_tokens(self : ProviderSchema) -> FieldConstraint

    ProviderSchema::new

    fn ProviderSchema::new(provider_name : String, temperature : FieldConstraint, top_p : FieldConstraint, top_k : FieldConstraint, max_output_tokens : FieldConstraint, resp_min_choices : Int, supports_tools : Bool, supports_system_instruction : Bool, supported_reasoning_efforts : Array[String]?, extra_checks : Array[() -> Array[String]]?) -> ProviderSchema

    ProviderSchema::provider_name

    fn ProviderSchema::provider_name(self : ProviderSchema) -> String

    ProviderSchema::resp_min_choices

    fn ProviderSchema::resp_min_choices(self : ProviderSchema) -> Int

    ProviderSchema::supported_reasoning_efforts

    fn ProviderSchema::supported_reasoning_efforts(self : ProviderSchema) -> Array[String]?

    ProviderSchema::supports_system_instruction

    fn ProviderSchema::supports_system_instruction(self : ProviderSchema) -> Bool

    ProviderSchema::supports_tools

    fn ProviderSchema::supports_tools(self : ProviderSchema) -> Bool

    ProviderSchema::temperature

    fn ProviderSchema::temperature(self : ProviderSchema) -> FieldConstraint

    ProviderSchema::top_k

    ProviderSchema::top_p

    ProviderSchema::validate_request

    校验请求是否符合 Provider 的字段约束 返回校验错误列表,空列表表示校验通过

    ProviderSchema::validate_response

    校验响应是否符合 Provider 的字段约束 返回校验错误列表,空列表表示校验通过

    Source Files