semantic

package
v0.0.0-...-332dcef Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey     string
	Model      string
	HTTPClient *http.Client
}

Config holds configuration for the labeler.

type PatternInput

type PatternInput struct {
	PatternUUIDString string
	Pattern           string
	Samples           []string
}

PatternInput represents a log pattern to be labeled.

Fields come from the Drain log parsing algorithm:

  • PatternUUIDString: a UUID string assigned to each Drain cluster (group of similar log lines)
  • Pattern: the Drain template string where variable tokens are replaced with <*> Example: "Starting <*> on port <*>"
  • Samples: representative raw log lines from this cluster, used as LLM context

type SemanticLabel

type SemanticLabel struct {
	PatternUUIDString string `json:"pattern_id"`
	SemanticID        string `json:"semantic_id"`
	Description       string `json:"description"`
}

SemanticLabel is the LLM-generated label for a pattern.

func Label

func Label(ctx context.Context, config Config, patterns []PatternInput) ([]SemanticLabel, error)

Label sends all patterns to the LLM in a single call and returns semantic labels.

Jump to

Keyboard shortcuts

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