Class Cost.Builder (0.5.0)

public static final class Cost.Builder extends GeneratedMessage.Builder<Cost.Builder> implements CostOrBuilder

Cost for running a model deployment on a given instance type. Currently, only USD currency code is supported.

Protobuf type google.cloud.gkerecommender.v1.Cost

Implements

CostOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

build()

public Cost build()
Returns
Type Description
Cost

buildPartial()

public Cost buildPartial()
Returns
Type Description
Cost

clear()

public Cost.Builder clear()
Returns
Type Description
Cost.Builder
Overrides

clearCostPerMillionInputTokens()

public Cost.Builder clearCostPerMillionInputTokens()

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Cost.Builder

clearCostPerMillionOutputTokens()

public Cost.Builder clearCostPerMillionOutputTokens()

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Cost.Builder

clearOutputInputCostRatio()

public Cost.Builder clearOutputInputCostRatio()

Optional. The output-to-input cost ratio. This determines how the total GPU cost is split between input and output tokens. If not provided, 4.0 is used, assuming a 4:1 output:input cost ratio.

optional float output_input_cost_ratio = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Cost.Builder

This builder for chaining.

clearPricingModel()

public Cost.Builder clearPricingModel()

Optional. The pricing model used to calculate the cost. Can be one of: 3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot will be used.

string pricing_model = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Cost.Builder

This builder for chaining.

getCostPerMillionInputTokens()

public Amount getCostPerMillionInputTokens()

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Amount

The costPerMillionInputTokens.

getCostPerMillionInputTokensBuilder()

public Amount.Builder getCostPerMillionInputTokensBuilder()

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Amount.Builder

getCostPerMillionInputTokensOrBuilder()

public AmountOrBuilder getCostPerMillionInputTokensOrBuilder()

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AmountOrBuilder

getCostPerMillionOutputTokens()

public Amount getCostPerMillionOutputTokens()

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Amount

The costPerMillionOutputTokens.

getCostPerMillionOutputTokensBuilder()

public Amount.Builder getCostPerMillionOutputTokensBuilder()

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Amount.Builder

getCostPerMillionOutputTokensOrBuilder()

public AmountOrBuilder getCostPerMillionOutputTokensOrBuilder()

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AmountOrBuilder

getDefaultInstanceForType()

public Cost getDefaultInstanceForType()
Returns
Type Description
Cost

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getOutputInputCostRatio()

public float getOutputInputCostRatio()

Optional. The output-to-input cost ratio. This determines how the total GPU cost is split between input and output tokens. If not provided, 4.0 is used, assuming a 4:1 output:input cost ratio.

optional float output_input_cost_ratio = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
float

The outputInputCostRatio.

getPricingModel()

public String getPricingModel()

Optional. The pricing model used to calculate the cost. Can be one of: 3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot will be used.

string pricing_model = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The pricingModel.

getPricingModelBytes()

public ByteString getPricingModelBytes()

Optional. The pricing model used to calculate the cost. Can be one of: 3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot will be used.

string pricing_model = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for pricingModel.

hasCostPerMillionInputTokens()

public boolean hasCostPerMillionInputTokens()

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the costPerMillionInputTokens field is set.

hasCostPerMillionOutputTokens()

public boolean hasCostPerMillionOutputTokens()

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the costPerMillionOutputTokens field is set.

hasOutputInputCostRatio()

public boolean hasOutputInputCostRatio()

Optional. The output-to-input cost ratio. This determines how the total GPU cost is split between input and output tokens. If not provided, 4.0 is used, assuming a 4:1 output:input cost ratio.

optional float output_input_cost_ratio = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the outputInputCostRatio field is set.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeCostPerMillionInputTokens(Amount value)

public Cost.Builder mergeCostPerMillionInputTokens(Amount value)

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Amount
Returns
Type Description
Cost.Builder

mergeCostPerMillionOutputTokens(Amount value)

public Cost.Builder mergeCostPerMillionOutputTokens(Amount value)

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Amount
Returns
Type Description
Cost.Builder

mergeFrom(Cost other)

public Cost.Builder mergeFrom(Cost other)
Parameter
Name Description
other Cost
Returns
Type Description
Cost.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Cost.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Cost.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Cost.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Cost.Builder
Overrides

setCostPerMillionInputTokens(Amount value)

public Cost.Builder setCostPerMillionInputTokens(Amount value)

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Amount
Returns
Type Description
Cost.Builder

setCostPerMillionInputTokens(Amount.Builder builderForValue)

public Cost.Builder setCostPerMillionInputTokens(Amount.Builder builderForValue)

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue Amount.Builder
Returns
Type Description
Cost.Builder

setCostPerMillionOutputTokens(Amount value)

public Cost.Builder setCostPerMillionOutputTokens(Amount value)

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Amount
Returns
Type Description
Cost.Builder

setCostPerMillionOutputTokens(Amount.Builder builderForValue)

public Cost.Builder setCostPerMillionOutputTokens(Amount.Builder builderForValue)

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue Amount.Builder
Returns
Type Description
Cost.Builder

setOutputInputCostRatio(float value)

public Cost.Builder setOutputInputCostRatio(float value)

Optional. The output-to-input cost ratio. This determines how the total GPU cost is split between input and output tokens. If not provided, 4.0 is used, assuming a 4:1 output:input cost ratio.

optional float output_input_cost_ratio = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value float

The outputInputCostRatio to set.

Returns
Type Description
Cost.Builder

This builder for chaining.

setPricingModel(String value)

public Cost.Builder setPricingModel(String value)

Optional. The pricing model used to calculate the cost. Can be one of: 3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot will be used.

string pricing_model = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The pricingModel to set.

Returns
Type Description
Cost.Builder

This builder for chaining.

setPricingModelBytes(ByteString value)

public Cost.Builder setPricingModelBytes(ByteString value)

Optional. The pricing model used to calculate the cost. Can be one of: 3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot will be used.

string pricing_model = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for pricingModel to set.

Returns
Type Description
Cost.Builder

This builder for chaining.