Versions in this module Expand all Collapse all v0 v0.1.9 Feb 28, 2024 v0.1.8 Feb 27, 2024 v0.1.7 Feb 27, 2024 v0.1.6 Feb 27, 2024 Changes in this version + type ChatRequest struct + Format string + Messages []*Message + Model string + Options Options + Stream *bool + type ChatResponse struct + CreatedAt time.Time + Done bool + Message *Message + Model string + type ChatResponseFunc func(ChatResponse) error + type Client struct + func NewClient(ourl *url.URL, ohttp *http.Client) (*Client, error) + func (c *Client) CreateEmbedding(ctx context.Context, req *EmbeddingRequest) (*EmbeddingResponse, error) + func (c *Client) Generate(ctx context.Context, req *GenerateRequest, fn GenerateResponseFunc) error + func (c *Client) GenerateChat(ctx context.Context, req *ChatRequest, fn ChatResponseFunc) error + type EmbeddingRequest struct + Model string + Options Options + Prompt string + type EmbeddingResponse struct + Embedding []float32 + type GenerateRequest struct + Context []int + Model string + Options Options + Prompt string + Stream *bool + System string + Template string + type GenerateResponse struct + Context []int + CreatedAt time.Time + Done bool + EvalCount int + EvalDuration time.Duration + LoadDuration time.Duration + Model string + PromptEvalCount int + PromptEvalDuration time.Duration + Response string + TotalDuration time.Duration + func (r *GenerateResponse) Summary() + type GenerateResponseFunc func(GenerateResponse) error + type ImageData []byte + type Message struct + Content string + Images []ImageData + Role string + type Metrics struct + EvalCount int + EvalDuration time.Duration + LoadDuration time.Duration + PromptEvalCount int + PromptEvalDuration time.Duration + TotalDuration time.Duration + type Options struct + FrequencyPenalty float32 + Mirostat int + MirostatEta float32 + MirostatTau float32 + NumKeep int + NumPredict int + PenalizeNewline bool + PresencePenalty float32 + RepeatLastN int + RepeatPenalty float32 + Seed int + Stop []string + TFSZ float32 + Temperature float32 + TopK int + TopP float32 + TypicalP float32 + type Runner struct + EmbeddingOnly bool + F16KV bool + LogitsAll bool + LowVRAM bool + MainGPU int + NumBatch int + NumCtx int + NumGPU int + NumGQA int + NumThread int + RopeFrequencyBase float32 + RopeFrequencyScale float32 + UseMLock bool + UseMMap bool + UseNUMA bool + VocabOnly bool + type StatusError struct + ErrorMessage string + Status string + StatusCode int + func (e StatusError) Error() string