Documentation ¶
Index ¶
- func DefineEmbedder(serverAddress string, model string) ai.Embedder
- func DefineModel(model ModelDefinition, caps *ai.ModelCapabilities) ai.Model
- func Embedder(serverAddress string) ai.Embedder
- func Init(ctx context.Context, cfg *Config) (err error)
- func IsDefinedEmbedder(serverAddress string) bool
- func IsDefinedModel(name string) bool
- func Model(name string) ai.Model
- type Config
- type EmbedOptions
- type ModelDefinition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefineEmbedder ¶ added in v0.1.2
DefineEmbedder defines an embedder with a given server address.
func DefineModel ¶ added in v0.0.2
func DefineModel(model ModelDefinition, caps *ai.ModelCapabilities) ai.Model
func Embedder ¶ added in v0.1.2
Embedder returns the ai.Embedder with the given server address. It returns nil if the embedder was not defined.
func Init ¶
Init initializes the plugin. Since Ollama models are locally hosted, the plugin doesn't initialize any default models. After downloading a model, call DefineModel to use it.
func IsDefinedEmbedder ¶ added in v0.1.2
IsDefinedEmbedder reports whether the embedder with the given server address is defined by this plugin.
func IsDefinedModel ¶ added in v0.1.0
IsDefinedModel reports whether a model is defined.
Types ¶
type Config ¶
type Config struct { // Server Address of oLLama. ServerAddress string }
Config provides configuration options for the Init function.
type EmbedOptions ¶ added in v0.1.2
type EmbedOptions struct {
Model string `json:"model"`
}
type ModelDefinition ¶
ModelDefinition represents a model with its name and type.
Click to show internal directories.
Click to hide internal directories.