Documentation
¶
Overview ¶
Package metadata provides functionality for aggregating and managing healing metadata throughout the request lifecycle. It tracks all autonomous actions taken by the Superbrain system and provides methods for recording and retrieving this information.
Index ¶
- type Aggregator
- func (a *Aggregator) GetActionCount() int
- func (a *Aggregator) GetFinalProvider() string
- func (a *Aggregator) GetMetadata() *types.HealingMetadata
- func (a *Aggregator) GetOriginalProvider() string
- func (a *Aggregator) HasActions() bool
- func (a *Aggregator) RecordAction(actionType, description string, success bool, details map[string]interface{})
- func (a *Aggregator) RecordDiagnosis(diagnosis *types.Diagnosis)
- func (a *Aggregator) SetContextOptimization(highDensityMap *types.HighDensityMap)
- func (a *Aggregator) SetFinalProvider(provider string)
- func (a *Aggregator) WasProviderChanged() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator manages the collection of healing actions and metadata for a request. It provides thread-safe methods for recording actions and building the final metadata.
func NewAggregator ¶
func NewAggregator(requestID, originalProvider string) *Aggregator
NewAggregator creates a new metadata aggregator for a request.
func (*Aggregator) GetActionCount ¶
func (a *Aggregator) GetActionCount() int
GetActionCount returns the number of healing actions recorded.
func (*Aggregator) GetFinalProvider ¶
func (a *Aggregator) GetFinalProvider() string
GetFinalProvider returns the final provider that fulfilled the request.
func (*Aggregator) GetMetadata ¶
func (a *Aggregator) GetMetadata() *types.HealingMetadata
GetMetadata builds and returns the complete healing metadata. This method is thread-safe and can be called at any time.
func (*Aggregator) GetOriginalProvider ¶
func (a *Aggregator) GetOriginalProvider() string
GetOriginalProvider returns the original provider for the request.
func (*Aggregator) HasActions ¶
func (a *Aggregator) HasActions() bool
HasActions returns true if any healing actions have been recorded.
func (*Aggregator) RecordAction ¶
func (a *Aggregator) RecordAction(actionType, description string, success bool, details map[string]interface{})
RecordAction adds a healing action to the aggregator. This method is thread-safe and can be called from multiple goroutines.
func (*Aggregator) RecordDiagnosis ¶
func (a *Aggregator) RecordDiagnosis(diagnosis *types.Diagnosis)
RecordDiagnosis adds a diagnosis to the history. This method is thread-safe and can be called from multiple goroutines.
func (*Aggregator) SetContextOptimization ¶
func (a *Aggregator) SetContextOptimization(highDensityMap *types.HighDensityMap)
SetContextOptimization records that context optimization was performed. The high-density map provides details about what content was excluded.
func (*Aggregator) SetFinalProvider ¶
func (a *Aggregator) SetFinalProvider(provider string)
SetFinalProvider updates the final provider that fulfilled the request. This is typically called after a successful fallback routing.
func (*Aggregator) WasProviderChanged ¶
func (a *Aggregator) WasProviderChanged() bool
WasProviderChanged returns true if the final provider differs from the original.