pub struct ModelBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> ModelBuilder<S>
impl<S: State> ModelBuilder<S>
Sourcepub fn build(self) -> Modelwhere
S: IsComplete,
pub fn build(self) -> Modelwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn id(self, value: String) -> ModelBuilder<SetId<S>>where
S::Id: IsUnset,
pub fn id(self, value: String) -> ModelBuilder<SetId<S>>where
S::Id: IsUnset,
Required.
Sourcepub fn model_name(self, value: String) -> ModelBuilder<SetModelName<S>>where
S::ModelName: IsUnset,
pub fn model_name(self, value: String) -> ModelBuilder<SetModelName<S>>where
S::ModelName: IsUnset,
Required.
Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime<observation.startTime
Sourcepub fn match_pattern(self, value: String) -> ModelBuilder<SetMatchPattern<S>>where
S::MatchPattern: IsUnset,
pub fn match_pattern(self, value: String) -> ModelBuilder<SetMatchPattern<S>>where
S::MatchPattern: IsUnset,
Required.
Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use (?i)^modelname$
Sourcepub fn start_date(self, value: Option<String>) -> ModelBuilder<SetStartDate<S>>where
S::StartDate: IsUnset,
pub fn start_date(self, value: Option<String>) -> ModelBuilder<SetStartDate<S>>where
S::StartDate: IsUnset,
Sourcepub fn maybe_start_date(
self,
value: Option<Option<String>>,
) -> ModelBuilder<SetStartDate<S>>where
S::StartDate: IsUnset,
pub fn maybe_start_date(
self,
value: Option<Option<String>>,
) -> ModelBuilder<SetStartDate<S>>where
S::StartDate: IsUnset,
Sourcepub fn unit(self, value: ModelUsageUnit) -> ModelBuilder<SetUnit<S>>where
S::Unit: IsUnset,
pub fn unit(self, value: ModelUsageUnit) -> ModelBuilder<SetUnit<S>>where
S::Unit: IsUnset,
Sourcepub fn maybe_unit(
self,
value: Option<ModelUsageUnit>,
) -> ModelBuilder<SetUnit<S>>where
S::Unit: IsUnset,
pub fn maybe_unit(
self,
value: Option<ModelUsageUnit>,
) -> ModelBuilder<SetUnit<S>>where
S::Unit: IsUnset,
Sourcepub fn input_price(self, value: Option<f64>) -> ModelBuilder<SetInputPrice<S>>where
S::InputPrice: IsUnset,
pub fn input_price(self, value: Option<f64>) -> ModelBuilder<SetInputPrice<S>>where
S::InputPrice: IsUnset,
Sourcepub fn maybe_input_price(
self,
value: Option<Option<f64>>,
) -> ModelBuilder<SetInputPrice<S>>where
S::InputPrice: IsUnset,
pub fn maybe_input_price(
self,
value: Option<Option<f64>>,
) -> ModelBuilder<SetInputPrice<S>>where
S::InputPrice: IsUnset,
Sourcepub fn output_price(self, value: Option<f64>) -> ModelBuilder<SetOutputPrice<S>>where
S::OutputPrice: IsUnset,
pub fn output_price(self, value: Option<f64>) -> ModelBuilder<SetOutputPrice<S>>where
S::OutputPrice: IsUnset,
Sourcepub fn maybe_output_price(
self,
value: Option<Option<f64>>,
) -> ModelBuilder<SetOutputPrice<S>>where
S::OutputPrice: IsUnset,
pub fn maybe_output_price(
self,
value: Option<Option<f64>>,
) -> ModelBuilder<SetOutputPrice<S>>where
S::OutputPrice: IsUnset,
Sourcepub fn total_price(self, value: Option<f64>) -> ModelBuilder<SetTotalPrice<S>>where
S::TotalPrice: IsUnset,
pub fn total_price(self, value: Option<f64>) -> ModelBuilder<SetTotalPrice<S>>where
S::TotalPrice: IsUnset,
Sourcepub fn maybe_total_price(
self,
value: Option<Option<f64>>,
) -> ModelBuilder<SetTotalPrice<S>>where
S::TotalPrice: IsUnset,
pub fn maybe_total_price(
self,
value: Option<Option<f64>>,
) -> ModelBuilder<SetTotalPrice<S>>where
S::TotalPrice: IsUnset,
Sourcepub fn tokenizer_id(
self,
value: Option<String>,
) -> ModelBuilder<SetTokenizerId<S>>where
S::TokenizerId: IsUnset,
pub fn tokenizer_id(
self,
value: Option<String>,
) -> ModelBuilder<SetTokenizerId<S>>where
S::TokenizerId: IsUnset,
Sourcepub fn maybe_tokenizer_id(
self,
value: Option<Option<String>>,
) -> ModelBuilder<SetTokenizerId<S>>where
S::TokenizerId: IsUnset,
pub fn maybe_tokenizer_id(
self,
value: Option<Option<String>>,
) -> ModelBuilder<SetTokenizerId<S>>where
S::TokenizerId: IsUnset,
Sourcepub fn tokenizer_config(
self,
value: Option<Value>,
) -> ModelBuilder<SetTokenizerConfig<S>>where
S::TokenizerConfig: IsUnset,
pub fn tokenizer_config(
self,
value: Option<Value>,
) -> ModelBuilder<SetTokenizerConfig<S>>where
S::TokenizerConfig: IsUnset,
Sourcepub fn maybe_tokenizer_config(
self,
value: Option<Option<Value>>,
) -> ModelBuilder<SetTokenizerConfig<S>>where
S::TokenizerConfig: IsUnset,
pub fn maybe_tokenizer_config(
self,
value: Option<Option<Value>>,
) -> ModelBuilder<SetTokenizerConfig<S>>where
S::TokenizerConfig: IsUnset,
Sourcepub fn is_langfuse_managed(
self,
value: bool,
) -> ModelBuilder<SetIsLangfuseManaged<S>>where
S::IsLangfuseManaged: IsUnset,
pub fn is_langfuse_managed(
self,
value: bool,
) -> ModelBuilder<SetIsLangfuseManaged<S>>where
S::IsLangfuseManaged: IsUnset,
Required.
Sourcepub fn created_at(self, value: String) -> ModelBuilder<SetCreatedAt<S>>where
S::CreatedAt: IsUnset,
pub fn created_at(self, value: String) -> ModelBuilder<SetCreatedAt<S>>where
S::CreatedAt: IsUnset,
Required.
Timestamp when the model was created
Sourcepub fn prices(
self,
value: HashMap<String, ModelPrice>,
) -> ModelBuilder<SetPrices<S>>where
S::Prices: IsUnset,
pub fn prices(
self,
value: HashMap<String, ModelPrice>,
) -> ModelBuilder<SetPrices<S>>where
S::Prices: IsUnset,
Required.
Deprecated. Use ‘pricingTiers’ instead for models with usage-based pricing variations. This field shows prices by usage type from the default pricing tier. Maintained for backward compatibility. If the model uses tiered pricing, this field will be populated from the default tier’s prices.
Sourcepub fn pricing_tiers(
self,
value: Vec<PricingTier>,
) -> ModelBuilder<SetPricingTiers<S>>where
S::PricingTiers: IsUnset,
pub fn pricing_tiers(
self,
value: Vec<PricingTier>,
) -> ModelBuilder<SetPricingTiers<S>>where
S::PricingTiers: IsUnset,
Required.
Array of pricing tiers with conditional pricing based on usage thresholds. Pricing tiers enable accurate cost tracking for models that charge different rates based on usage patterns (e.g., different rates for high-volume usage, large context windows, or cached tokens). Each model must have exactly one default tier (isDefault=true, priority=0) that serves as a fallback. Additional conditional tiers can be defined with specific matching criteria. If this array is empty, the model uses legacy flat pricing from the inputPrice/outputPrice/totalPrice fields.