Documentation
¶
Overview ¶
package ui implements a chat interface for Ollama
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CORS = envconfig.Bool("OLLAMA_CORS")
View Source
var ErrNetworkOffline = errors.New("network is offline")
View Source
var OllamaDotCom = func() string { if url := os.Getenv("OLLAMA_DOT_COM_URL"); url != "" { return url } return "https://ollama.com" }()
OllamaDotCom returns the URL for ollama.com, allowing override via environment variable
Functions ¶
Types ¶
type Event ¶
type Event string
Event is a string that represents the type of event being sent to the client. It is used in the Server-Sent Events (SSE) protocol to identify the type of data being sent. The client (template) will use this type in the sse event listener to determine how to handle the incoming data. It will also be used in the sse-swap htmx event listener to determine how to handle the incoming data.
type Server ¶
type Server struct {
Logger *slog.Logger
Restart func()
Token string
Store *store.Store
ToolRegistry *tools.Registry
Tools bool // if true, the server will use single-turn tools to fulfill the user's request
WebSearch bool // if true, the server will use single-turn browser tool to fulfill the user's request
Agent bool // if true, the server will use multi-turn tools to fulfill the user's request
WorkingDir string // Working directory for all agent operations
// Dev is true if the server is running in development mode
Dev bool
// Updater for checking and downloading updates
Updater *updater.Updater
UpdateAvailableFunc func()
}
Click to show internal directories.
Click to hide internal directories.