Documentation
¶
Index ¶
- func ValidateJSON(output string, v *validator.Validator) error
- type Engine
- type HugotEngine
- func (e *HugotEngine) Close() error
- func (e *HugotEngine) CountTokens(text string, isEmbedding bool) (int, error)
- func (e *HugotEngine) ExtractEmbeddings(ctx context.Context, input []string) ([][]float32, error)
- func (e *HugotEngine) Generate(ctx context.Context, prompt string, maxTokens int) (string, error)
- func (e *HugotEngine) GenerateStream(ctx context.Context, prompt string, maxTokens int) (chan string, chan error, error)
- type MockEngine
- func (m *MockEngine) Close() error
- func (m *MockEngine) CountTokens(text string, isEmbedding bool) (int, error)
- func (m *MockEngine) ExtractEmbeddings(ctx context.Context, input []string) ([][]float32, error)
- func (m *MockEngine) Generate(ctx context.Context, prompt string, maxTokens int) (string, error)
- func (m *MockEngine) GenerateStream(ctx context.Context, prompt string, maxTokens int) (chan string, chan error, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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)
CountTokens(text string, isEmbedding bool) (int, 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) CountTokens ¶ added in v0.6.0
func (e *HugotEngine) CountTokens(text string, isEmbedding bool) (int, error)
func (*HugotEngine) ExtractEmbeddings ¶
func (*HugotEngine) GenerateStream ¶
type MockEngine ¶
MockEngine for testing purposes
func (*MockEngine) Close ¶
func (m *MockEngine) Close() error
func (*MockEngine) CountTokens ¶ added in v0.6.0
func (m *MockEngine) CountTokens(text string, isEmbedding bool) (int, error)
func (*MockEngine) ExtractEmbeddings ¶
func (*MockEngine) GenerateStream ¶
Click to show internal directories.
Click to hide internal directories.