Documentation
¶
Index ¶
- Constants
- func ComputeRetryBackoff(attemptCount int) time.Duration
- func DefaultRepoWorkBranch(ticketIdentifier string) string
- func NormalizeRepoWorkBranchOverride(raw string) string
- func ResolveRepoWorkBranch(ticketIdentifier string, branchOverride string) string
- func RoundUSD(value float64) float64
- func ShouldPauseForBudget(costAmount float64, budgetUSD float64) bool
- type PauseReason
- type RawUsageDelta
- type RepoWorkBranchSource
- type ResolvedUsageCost
- type StatusChangeRunDisposition
- type StatusStage
- type UsageCostSource
- type UsageDelta
Constants ¶
View Source
const ( UsageCostSourceActual UsageCostSource = "actual" UsageCostSourceEstimated UsageCostSource = "estimated" CostRecordedEventType string = "ticket.cost_recorded" )
Variables ¶
This section is empty.
Functions ¶
func ComputeRetryBackoff ¶
func DefaultRepoWorkBranch ¶
func ResolveRepoWorkBranch ¶
func ShouldPauseForBudget ¶
Types ¶
type PauseReason ¶
type PauseReason string
const ( PauseReasonBudgetExhausted PauseReason = "budget_exhausted" PauseReasonRepeatedStalls PauseReason = "repeated_stalls" PauseReasonUserPaused PauseReason = "user_paused" )
func (PauseReason) String ¶
func (r PauseReason) String() string
type RawUsageDelta ¶
type RawUsageDelta struct {
InputTokens *int64
OutputTokens *int64
CachedInputTokens *int64
CacheCreationInputTokens *int64
CacheCreationInputTokens5m *int64
CacheCreationInputTokens1h *int64
PromptTokens *int64
CandidateTokens *int64
ToolTokens *int64
ReasoningTokens *int64
CacheStorageTokens *int64
CacheStorageHours *float64
ModelContextWindow *int64
CostUSD *float64
}
type RepoWorkBranchSource ¶
type RepoWorkBranchSource string
const ( RepoWorkBranchSourceGenerated RepoWorkBranchSource = "generated" RepoWorkBranchSourceOverride RepoWorkBranchSource = "override" )
func RepoWorkBranchSourceForOverride ¶
func RepoWorkBranchSourceForOverride(branchOverride string) RepoWorkBranchSource
type ResolvedUsageCost ¶
type ResolvedUsageCost struct {
AmountUSD float64
Source UsageCostSource
}
type StatusChangeRunDisposition ¶
type StatusChangeRunDisposition string
const ( StatusChangeRunDispositionRetain StatusChangeRunDisposition = "retain" StatusChangeRunDispositionDone StatusChangeRunDisposition = "release_done" StatusChangeRunDispositionCancel StatusChangeRunDisposition = "release_cancel" )
type StatusStage ¶
type StatusStage string
const ( DefaultStatusStage StatusStage = StatusStageUnstarted StatusStageBacklog StatusStage = "backlog" StatusStageUnstarted StatusStage = "unstarted" StatusStageStarted StatusStage = "started" StatusStageCompleted StatusStage = "completed" StatusStageCanceled StatusStage = "canceled" )
func DefaultTemplateStatusStage ¶
func DefaultTemplateStatusStage(name string) (StatusStage, bool)
func InferStatusStageFromName ¶
func InferStatusStageFromName(name string) (StatusStage, bool)
func ParseStatusStage ¶
func ParseStatusStage(raw string) (StatusStage, error)
func (StatusStage) AllowsWorkflowFinish ¶
func (s StatusStage) AllowsWorkflowFinish() bool
func (StatusStage) AllowsWorkflowPickup ¶
func (s StatusStage) AllowsWorkflowPickup() bool
func (StatusStage) IsTerminal ¶
func (s StatusStage) IsTerminal() bool
func (StatusStage) IsValid ¶
func (s StatusStage) IsValid() bool
func (StatusStage) String ¶
func (s StatusStage) String() string
type UsageCostSource ¶
type UsageCostSource string
func (UsageCostSource) String ¶
func (s UsageCostSource) String() string
type UsageDelta ¶
type UsageDelta struct {
InputTokens int64
OutputTokens int64
CachedInputTokens int64
CacheCreationInputTokens int64
CacheCreationInputTokens5m int64
CacheCreationInputTokens1h int64
PromptTokens int64
CandidateTokens int64
ToolTokens int64
ReasoningTokens int64
CacheStorageTokens int64
CacheStorageHours float64
ModelContextWindow int64
ExplicitCostUSD *float64
}
func ParseRawUsageDelta ¶
func ParseRawUsageDelta(raw RawUsageDelta) (UsageDelta, error)
func (UsageDelta) ResolveCost ¶
func (u UsageDelta) ResolveCost(pricingConfig pricing.ProviderModelPricingConfig) (ResolvedUsageCost, error)
func (UsageDelta) ResolveCostUSD ¶
func (u UsageDelta) ResolveCostUSD(pricingConfig pricing.ProviderModelPricingConfig) (float64, error)
func (UsageDelta) TotalTokens ¶
func (u UsageDelta) TotalTokens() int64
Click to show internal directories.
Click to hide internal directories.