modelvendor

package
v0.0.0-...-8c5968e Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ollama string = "ollama"
	OpenAI string = "openai"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VendorName string `json:"vendor_name" yaml:"vendor_name" mapstructure:"vendor_name"`
	ModelName  string `json:"model_name" yaml:"model_name" mapstructure:"model_name"`
}

type LLM

type LLM interface {
	Call(ctx context.Context, prompt string, options ...llms.CallOption) (string, error)
	CreateEmbedding(ctx context.Context, texts []string) ([][]float32, error)
}

func NewLLM

func NewLLM(config Config) (LLM, error)

NOTE(Hue): Returning an interface while not generally a good idea, but in this case, it's a good idea because we can have multiple implementations of the LLM interface.

Jump to

Keyboard shortcuts

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