Documentation
¶
Index ¶
- func CopyModel(source, target string) (response string, err error)
- func JsonFormat(value string) (response []byte)
- func List() (response string, err error)
- func Preload(name string) (response string, err error)
- func Pull(name string) (response string, err error)
- func Remove(name string) (response string, err error)
- func Run(name string) (response string, err error)
- func Version() (response string, err error)
- type OllamaAPI
- func (instance *OllamaAPI) Chat(model string, oMessages llm_commons.AIRequestMessageList, ...) (response *ollama_commons.OllamaCLIResponse)
- func (instance *OllamaAPI) Delete(model string) (response *ollama_commons.OllamaCLIResponse)
- func (instance *OllamaAPI) DriverOptions() (response *llm_commons.LLMDriverOptions)
- func (instance *OllamaAPI) Generate(model string, prompt *llm_commons.AIRequestMessage, raw bool, ctx interface{}, ...) (response *ollama_commons.OllamaCLIResponse)
- func (instance *OllamaAPI) GetModel() (response string)
- func (instance *OllamaAPI) List() (response *ollama_commons.OllamaCLIResponse)
- func (instance *OllamaAPI) ListNames() (response *ollama_commons.OllamaCLIResponse)
- func (instance *OllamaAPI) Map() (response map[string]interface{})
- func (instance *OllamaAPI) Options() (response *ollama_commons.OllamaOptions)
- func (instance *OllamaAPI) Pull(model string, enableStream bool) (response *ollama_commons.OllamaCLIResponse)
- func (instance *OllamaAPI) Serve()
- func (instance *OllamaAPI) String() (response string)
- func (instance *OllamaAPI) Submit(request *llm_commons.LLMRequest) (response *llm_commons.LLMResponse, err error)
- func (instance *OllamaAPI) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonFormat ¶
Types ¶
type OllamaAPI ¶
type OllamaAPI struct {
// contains filtered or unexported fields
}
OllamaAPI is a struct that manages interactions with the Ollama API, handling configuration and API client setup.
func NewOllamaAPI ¶
func (*OllamaAPI) Chat ¶
func (instance *OllamaAPI) Chat(model string, oMessages llm_commons.AIRequestMessageList, options map[string]interface{}, keepAlive *api.Duration, format string, stream llm_commons.StreamHandler) (response *ollama_commons.OllamaCLIResponse)
func (*OllamaAPI) Delete ¶
func (instance *OllamaAPI) Delete(model string) (response *ollama_commons.OllamaCLIResponse)
Delete removes a specific model identified by the given `model` name from the Ollama API server and returns the result.
func (*OllamaAPI) DriverOptions ¶
func (instance *OllamaAPI) DriverOptions() (response *llm_commons.LLMDriverOptions)
func (*OllamaAPI) Generate ¶
func (instance *OllamaAPI) Generate(model string, prompt *llm_commons.AIRequestMessage, raw bool, ctx interface{}, template, system string, options map[string]interface{}, keepAlive *api.Duration, format string, stream llm_commons.StreamHandler) (response *ollama_commons.OllamaCLIResponse)
func (*OllamaAPI) List ¶
func (instance *OllamaAPI) List() (response *ollama_commons.OllamaCLIResponse)
func (*OllamaAPI) ListNames ¶
func (instance *OllamaAPI) ListNames() (response *ollama_commons.OllamaCLIResponse)
func (*OllamaAPI) Options ¶
func (instance *OllamaAPI) Options() (response *ollama_commons.OllamaOptions)
func (*OllamaAPI) Pull ¶
func (instance *OllamaAPI) Pull(model string, enableStream bool) (response *ollama_commons.OllamaCLIResponse)
Pull Download or Update a model
func (*OllamaAPI) Serve ¶
func (instance *OllamaAPI) Serve()
Serve start ollama server. WARN: USE ONLY IF THE SERVICE DOES NOT START AUTOMATICALLY!!!
func (*OllamaAPI) Submit ¶ added in v0.3.36
func (instance *OllamaAPI) Submit(request *llm_commons.LLMRequest) (response *llm_commons.LLMResponse, err error)
Click to show internal directories.
Click to hide internal directories.