Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ollama ¶ added in v1.1.45
Ollama represents an Ollama instance.
func NewOllama ¶ added in v1.1.45
func NewOllama(url string, opts ...OllamaOption) *Ollama
NewOllama creates a new instance of Ollama with the given URL and options.
func (*Ollama) HandleChat ¶ added in v1.1.45
func (o *Ollama) HandleChat() http.HandlerFunc
HandleChat returns an HTTP handler function that handles chat requests.
type OllamaOption ¶ added in v1.1.45
type OllamaOption func(o *Ollama)
OllamaOption is a function that configures an Ollama instance.
func WithOllamaModel ¶ added in v1.1.45
func WithOllamaModel(model string) OllamaOption
WithOllamaModel sets the model for the Ollama instance.
type Request ¶ added in v1.1.45
type Request struct { Model string `json:"model"` Messages []Message `json:"messages"` Stream bool `json:"stream"` }
Request is a struct representing an Ollama request.
type Response ¶ added in v1.1.45
type Response struct { CreatedAt time.Time `json:"created_at"` Done bool `json:"done"` DoneReason string `json:"done_reason"` EvalCount int `json:"eval_count"` EvalDuration int64 `json:"eval_duration"` LoadDuration int `json:"load_duration"` Message *Message `json:"message"` Model string `json:"model"` PromptEvalCount int `json:"prompt_eval_count"` PromptEvalDuration int `json:"prompt_eval_duration"` TotalDuration int64 `json:"total_duration"` }
Response is a struct representing an Ollama response.
Click to show internal directories.
Click to hide internal directories.