Documentation
¶
Index ¶
- func NewProvider() (provider provider.Provider)
- type Provider
- func (p *Provider) Available(logger *log.Logger) (err error)
- func (p *Provider) ID() (id string)
- func (p *Provider) Load(modelIdentifier string) error
- func (p *Provider) Models() (models []model.Model, err error)
- func (p *Provider) Pull(logger *log.Logger, modelIdentifier string) error
- func (p *Provider) Query(ctx context.Context, model model.Model, promptText string) (response string, err error)
- func (p *Provider) SetBinaryPath(binaryPath string)
- func (p *Provider) SetURL(url string)
- func (p *Provider) Start(logger *log.Logger) (shutdown func() (err error), err error)
- func (p *Provider) Unload(modelIdentifier string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
NewProvider returns an "Ollama" provider.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider holds an "Ollama" provider.
func (*Provider) Available ¶
Available checks if the provider ready to be used and returns a potential error explaining why not. This might include checking for an installation or making sure an API access token is valid.
func (*Provider) Models ¶
Models returns which models are available to be queried via this provider.
func (*Provider) Query ¶
func (p *Provider) Query(ctx context.Context, model model.Model, promptText string) (response string, err error)
Query queries the provider with the given model name.
func (*Provider) SetBinaryPath ¶
SetBinaryPath sets the binary file path of the Ollama binary.
Click to show internal directories.
Click to hide internal directories.