Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CarbonFootprintEstimator ¶
type CarbonFootprintEstimator struct {
// contains filtered or unexported fields
}
func NewCarbonFootprintEstimator ¶
func NewCarbonFootprintEstimator(tpd, mem, carbonIntensity int) *CarbonFootprintEstimator
func (*CarbonFootprintEstimator) EstimateModelInvocationCarbonFootprint ¶
func (m *CarbonFootprintEstimator) EstimateModelInvocationCarbonFootprint(metadata *InvocationLogMetadata) *InvocationLogMetadata
type CostDetail ¶
type CostEstimator ¶
type CostEstimator struct {
// contains filtered or unexported fields
}
func NewCostEstimator ¶
func NewCostEstimator(modelsPriceDetails []byte) (*CostEstimator, error)
func (*CostEstimator) EstimateModelInvocationCost ¶
func (m *CostEstimator) EstimateModelInvocationCost(metadata *InvocationLogMetadata) *InvocationLogMetadata
type IdentityTag ¶
type IdentityTagsBuilder ¶
type IdentityTagsBuilder struct {
// contains filtered or unexported fields
}
func NewIdentityTagsBuilder ¶
func NewIdentityTagsBuilder(iamClient *iam.IAM) *IdentityTagsBuilder
func (*IdentityTagsBuilder) GetIdentityTags ¶
func (i *IdentityTagsBuilder) GetIdentityTags(identity string) (tags []*iam.Tag, err error)
type InvocationLog ¶
type InvocationLog struct { SchemaType string `json:"schemaType"` SchemaVersion string `json:"schemaVersion"` Timestamp time.Time `json:"timestamp"` AccountID string `json:"accountId"` Identity struct { Arn string `json:"arn"` } `json:"identity"` Region string `json:"region"` RequestID string `json:"requestId"` Operation string `json:"operation"` ModelID string `json:"modelId"` Input struct { InputContentType string `json:"inputContentType"` InputTokenCount int `json:"inputTokenCount"` } `json:"input"` Output struct { OutputContentType string `json:"outputContentType"` OutputTokenCount int `json:"outputTokenCount"` OutputBodyJSON any `json:"outputBodyJson"` } `json:"output"` }
type InvocationLogMetadata ¶
type InvocationLogMetadata struct { Timestamp time.Time `json:"timestamp"` AccountID string `json:"accountId"` Identity struct { Arn string `json:"arn"` } `json:"identity"` IdentityTags []IdentityTag `json:"identityTags"` Region string `json:"region"` RequestID string `json:"requestId"` Operation string `json:"operation"` ModelID string `json:"modelId"` ModelName string `json:"modelName"` ModelProvider string `json:"modelProvider"` InputContentType string `json:"inputContentType"` OutputContentType string `json:"outputContentType"` InputTokenCount int `json:"inputTokenCount"` OutputTokenCount int `json:"outputTokenCount"` InputTokenCostUSD float64 `json:"inputTokenCostUSD"` OutputTokenCostUSD float64 `json:"outputTokenCostUSD"` InvocationLatency int `json:"invocationLatency,omitempty"` FirstByteLatency int `json:"firstByteLatency,omitempty"` EnergyConsumptionkWh float64 `json:"energyConsumptionkWh,omitempty"` CarbonEmissiongCO2e float64 `json:"carbonEmissiongCO2e,omitempty"` }
type InvocationLogOutputBodyJSON ¶
type InvocationLogOutputBodyJSON struct { OutputText string `json:"outputText"` Index int `json:"index"` TotalOutputTextTokenCount any `json:"totalOutputTextTokenCount"` CompletionReason any `json:"completionReason"` InputTextTokenCount int `json:"inputTextTokenCount"` AmazonBedrockInvocationMetrics AmazonBedrockInvocationMetrics `json:"amazon-bedrock-invocationMetrics,omitempty"` }
type MetadataGenerator ¶
type MetadataGenerator struct {
// contains filtered or unexported fields
}
func NewMetadataGenerator ¶
func NewMetadataGenerator(modelCost *CostEstimator, carbonFootprint *CarbonFootprintEstimator, identity *IdentityTagsBuilder) *MetadataGenerator
func (*MetadataGenerator) GenerateModelInvocationLogMetadata ¶
func (m *MetadataGenerator) GenerateModelInvocationLogMetadata(modelInvocationLog *InvocationLog) (modelInvocationLogMetadata *InvocationLogMetadata, err error)
Click to show internal directories.
Click to hide internal directories.