Documentation
¶
Overview ¶
Package ollama implements the llm.Provider contract against the Ollama /api/chat endpoint. Stdlib-only.
Ollama uses NDJSON streaming (one JSON object per line) rather than SSE. Tool support requires a model that advertises function calling and Ollama 0.4+. Tool calls don't carry server-assigned IDs, so we mint synthetic ones for the engine; on the wire to Ollama, tool_result messages are sent without IDs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures a Provider.
func WithBaseURL ¶
WithBaseURL points the client at a non-default Ollama host.
func WithHTTPClient ¶
WithHTTPClient swaps the underlying http.Client.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is an Ollama /api/chat client.
func New ¶
New constructs a Provider. OLLAMA_HOST overrides the default origin (http://localhost:11434).