Documentation
¶
Index ¶
- Variables
- func Apply[T any](options ...func(*T)) func(*T)
- func Chat(ctx context.Context, options ...chat.Option) (*chat.Response, error)
- func Embed(ctx context.Context, options ...embed.Option) (*embed.Response, error)
- func With(ctx context.Context, options ...Option) context.Context
- type Client
- type Error
- type Option
Constants ¶
This section is empty.
Variables ¶
var Default = defaultClient
Default is the default client for contexts without their own specialized client.
Functions ¶
func Apply ¶
func Apply[T any](options ...func(*T)) func(*T)
Apply constructs an option that applies the provided options.
func Chat ¶
Chat does a chat request with the provided context. If a toolkit is provided for the request, it will be used to handle any tool calls.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type Option ¶
type Option func(*Client)
func Host ¶
Host specifies the base URL of the Ollama server. This may be either a URL without a trailing "/" or a TCP/IP address, in which case, HTTP will be used. The default host is `http://localhost:11434` but if OLLAMA_HOST is present in the environment, it will be used instead.
func RequestHook ¶
RequestHook adds a request hook to the client; each request hook is applied to a request by the Do client method. This is useful for injecting authentication headers or logging. They are applied in First In First Out (FIFO) order.
func ResponseHook ¶
ResponseHook adds a response hook to the client; like request hooks, these hooks are applied to responses by the Do client method, but unlike RequestHooks, they are applied in Last In First Out (LIFO) order.
func TraceZerolog ¶
TraceZerolog adds a zerolog trace using the provided logger that traces requests and responses.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package chat details how to create a chat request for the Ollama API and how to process its response.
|
Package chat details how to create a chat request for the Ollama API and how to process its response. |
|
message
Package message provides options for altering a chat message for Ollama.
|
Package message provides options for altering a chat message for Ollama. |
|
protocol
Package protocol describes the structure of chat requests and responses for the Ollama API.
|
Package protocol describes the structure of chat requests and responses for the Ollama API. |
|
tool
Package tool can be used to define a tool usable by tool capable Ollama models.
|
Package tool can be used to define a tool usable by tool capable Ollama models. |
|
toolkit
Package toolkit wraps a set of tools into a unified interface that can be easily used to process tool calls.
|
Package toolkit wraps a set of tools into a unified interface that can be easily used to process tool calls. |
|
example
|
|
|
orderbot
command
|
|
|
tick
command
|