core

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateJSON

func ValidateJSON(output string, v *validator.Validator) error

Types

type Engine

type Engine interface {
	Generate(ctx context.Context, prompt string, maxTokens int) (string, error)
	GenerateStream(ctx context.Context, prompt string, maxTokens int) (chan string, chan error, error)
	ExtractEmbeddings(ctx context.Context, input []string) ([][]float32, error)
	Close() error
}

type HugotEngine

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

func NewHugotEngine

func NewHugotEngine(modelFolder string, speechModel string, embeddingModel string) (*HugotEngine, error)

func (*HugotEngine) Close

func (e *HugotEngine) Close() error

func (*HugotEngine) ExtractEmbeddings

func (e *HugotEngine) ExtractEmbeddings(ctx context.Context, input []string) ([][]float32, error)

func (*HugotEngine) Generate

func (e *HugotEngine) Generate(ctx context.Context, prompt string, maxTokens int) (string, error)

func (*HugotEngine) GenerateStream

func (e *HugotEngine) GenerateStream(ctx context.Context, prompt string, maxTokens int) (chan string, chan error, error)

type MockEngine

type MockEngine struct {
	Responses []string
	Err       error
}

MockEngine for testing purposes

func (*MockEngine) Close

func (m *MockEngine) Close() error

func (*MockEngine) ExtractEmbeddings

func (m *MockEngine) ExtractEmbeddings(ctx context.Context, input []string) ([][]float32, error)

func (*MockEngine) Generate

func (m *MockEngine) Generate(ctx context.Context, prompt string, maxTokens int) (string, error)

func (*MockEngine) GenerateStream

func (m *MockEngine) GenerateStream(ctx context.Context, prompt string, maxTokens int) (chan string, chan error, error)

Jump to

Keyboard shortcuts

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