classifier_worker

package
v0.0.0-...-acbae9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionNone          Action = "none"
	ActionOpenIncident  Action = "open_incident"
	ActionCloseIncident Action = "close_incident"

	PriorityHigh Priority = "HIGH"
	PriorityLow  Priority = "LOW"
)

Variables

This section is empty.

Functions

Types

type Action

type Action string

func (*Action) UnmarshalJSON

func (a *Action) UnmarshalJSON(b []byte) error

type ClassifierWorker

type ClassifierWorker struct {
	river.WorkerDefaults[background.ClassifierArgs]
	// contains filtered or unexported fields
}

func (*ClassifierWorker) Work

type Config

type Config struct {
	OpenAIAPIKey string `envconfig:"OPENAI_API_KEY" default:"fake-classifier-key"`
	OpenAIURL    string `envconfig:"OPENAI_URL" default:"http://localhost:11434/v1/"`
	OpenAIModel  string `envconfig:"OPENAI_MODEL"`

	// In case it is possible to deterministically classify an incident (the alert bot always uses
	// the same message format), we can use this to classify the incident without using the OpenAI API.
	IncidentClassificationBinary string `split_words:"true"`
}

type DevClassifierWorker

type DevClassifierWorker struct {
	river.WorkerDefaults[background.ClassifierArgs]
	// contains filtered or unexported fields
}

func (*DevClassifierWorker) Work

type IncidentAction

type IncidentAction struct {
	Action  Action `json:"action"`
	Alert   string `json:"alert"`
	Service string `json:"service"`

	// Only used for open_incident.
	Priority Priority `json:"priority,omitempty"`
}

type Priority

type Priority string

func (*Priority) UnmarshalJSON

func (p *Priority) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL