Versions in this module Expand all Collapse all v0 v0.1.13 Feb 9, 2025 v0.1.13-pre.1 Feb 2, 2025 v0.1.13-pre.0 Sep 13, 2024 v0.1.12 Jun 21, 2024 v0.1.12-pre.1 Jun 21, 2024 v0.1.12-pre.0 Jun 21, 2024 v0.1.11 Jun 16, 2024 v0.1.11-pre.0 Jun 16, 2024 v0.1.11-alpha.0 Jun 15, 2024 v0.1.10 May 9, 2024 v0.1.10-pre.0 May 7, 2024 v0.1.9 Apr 18, 2024 v0.1.8 Mar 31, 2024 v0.1.7 Mar 19, 2024 v0.1.6 Mar 19, 2024 Changes in this version + func ExtractJSONFromBytes(input []byte) ([]byte, error) + type ChatRequest struct + Messages []*Message + Prompt *string + Stream *bool + type ChatResponse struct + Content string + GenerationSettings GenerationSettings + Model string + Prompt string + SlotID int + Stop bool + StoppedEOS bool + StoppedLimit bool + StoppedWord bool + StoppingWord string + Timings Timings + TokensCached int + TokensEvaluated int + TokensPredicted int + Truncated bool + 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, texts []string) (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 EmbeddingData struct + Embedding []float32 + type EmbeddingRequest struct + Content []string + type EmbeddingResponse struct + Results []EmbeddingData + type GenerateRequest struct + Context []int + 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 + PromptEvalCount int + PromptEvalDuration time.Duration + Response string + TotalDuration time.Duration + type GenerateResponseFunc func(GenerateResponse) error + type GenerationSettings struct + EmbeddingSize int + FrequencyPenalty float64 + Grammar string + HTTPClient *http.Client + IgnoreEOS bool + LlamafileServerURL *url.URL + LogitBias []interface{} + MinP float64 + Mirostat int + MirostatEta float64 + MirostatTau float64 + Model string + NCtx int + NKeep int + NPredict int + NProbs int + PenalizeNL bool + PenaltyPromptTokens []interface{} + PresencePenalty float64 + RepeatLastN int + RepeatPenalty float64 + Seed uint32 + Stop []string + Stream bool + Temperature float64 + TfsZ float64 + TopK int + TopP float64 + TypicalP float64 + UsePenaltyPromptTokens bool + type ImageData []byte + type Message struct + Content string + Images []ImageData + Role string + type StatusError struct + ErrorMessage string + Status string + StatusCode int + func (e StatusError) Error() string + type Timings struct + PredictedMS float64 + PredictedN int + PredictedPerSecond float64 + PredictedPerTokenMS float64 + PromptMS float64 + PromptN int + PromptPerSecond float64 + PromptPerTokenMS float64 v0.1.6-alpha.1 Mar 18, 2024