sidecar

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderOllama = "ollama"
	ProviderMLX    = "mlx"

	// PlaceholderRedacted is the literal substituted by aggressive (non-LLM) redaction.
	// MLX uses the same placeholder until the real cgo binding to mlx-c is wired up.
	PlaceholderRedacted = "[VALUE_REDACTED]"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewOllamaClient

func NewOllamaClient(cfg Config, logger *slog.Logger) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) FallbackCount

func (c *Client) FallbackCount() int64

func (*Client) Generate

func (c *Client) Generate(ctx context.Context, prompt string) (string, error)

func (*Client) Healthy

func (c *Client) Healthy(ctx context.Context) bool

func (*Client) Model

func (c *Client) Model() string

func (*Client) Provider

func (c *Client) Provider() string

func (*Client) Redact

func (c *Client) Redact(ctx context.Context, content string) string

type Config

type Config struct {
	Provider string `yaml:"provider"`
	Model    string `yaml:"model"`
	URL      string `yaml:"url"`
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) Enabled

func (c *Config) Enabled() bool

func (*Config) Validate

func (c *Config) Validate() error

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(cfg Config, logger *slog.Logger) (*Manager, error)

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) Enabled

func (m *Manager) Enabled() bool

func (*Manager) FallbackCount

func (m *Manager) FallbackCount() int64

func (*Manager) Healthy

func (m *Manager) Healthy(ctx context.Context) bool

func (*Manager) Model

func (m *Manager) Model() string

func (*Manager) Provider

func (m *Manager) Provider() string

func (*Manager) Redact

func (m *Manager) Redact(ctx context.Context, content string) string

type RedactClient

type RedactClient interface {
	Redact(ctx context.Context, content string) string
	FallbackCount() int64
	Provider() string
	Model() string
	Healthy(ctx context.Context) bool
	io.Closer
}

func NewClient

func NewClient(cfg Config, logger *slog.Logger) (RedactClient, error)

Jump to

Keyboard shortcuts

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