Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRequest ¶ added in v0.0.91
type ChatResponse ¶ added in v0.0.91
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(apiURL string, optFns ...func(o *ClientOptions)) *Client
func (*Client) CreateEmbedding ¶ added in v0.0.96
func (c *Client) CreateEmbedding(ctx context.Context, req *EmbeddingRequest) (*EmbeddingResponse, error)
func (*Client) Generate ¶
func (c *Client) Generate(ctx context.Context, req *GenerateRequest) (*GenerateResponse, error)
func (*Client) GenerateChat ¶ added in v0.0.91
func (c *Client) GenerateChat(ctx context.Context, req *ChatRequest) (*ChatResponse, error)
type ClientOptions ¶
type ClientOptions struct { // The HTTP client to use for making API requests. HTTPClient HTTPClient }
type EmbeddingRequest ¶ added in v0.0.96
type EmbeddingResponse ¶ added in v0.0.96
type EmbeddingResponse struct {
Embedding []float32 `json:"embedding"`
}
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"error"`
}
type GenerateRequest ¶
type GenerateRequest struct { Model string `json:"model"` Prompt string `json:"prompt"` System string `json:"system"` Template string `json:"template"` Context []int `json:"context,omitempty"` Stream *bool `json:"stream,omitempty"` Raw bool `json:"raw,omitempty"` Format string `json:"format"` Images []ImageData `json:"images,omitempty"` Options Options `json:"options"` }
type GenerateResponse ¶
type HTTPClient ¶
HTTPClient is an interface for making HTTP requests.
type Metrics ¶
type Metrics struct { TotalDuration time.Duration `json:"total_duration,omitempty"` LoadDuration time.Duration `json:"load_duration,omitempty"` PromptEvalCount int `json:"prompt_eval_count,omitempty"` PromptEvalDuration time.Duration `json:"prompt_eval_duration,omitempty"` EvalCount int `json:"eval_count,omitempty"` EvalDuration time.Duration `json:"eval_duration,omitempty"` }
type Options ¶
type Options struct { Stop []string `json:"stop,omitempty"` Runner RepeatLastN int `json:"repeat_last_n,omitempty"` Seed int `json:"seed,omitempty"` TopK int `json:"top_k,omitempty"` NumKeep int `json:"num_keep,omitempty"` Mirostat int `json:"mirostat,omitempty"` NumPredict int `json:"num_predict,omitempty"` Temperature float32 `json:"temperature,omitempty"` TypicalP float32 `json:"typical_p,omitempty"` RepeatPenalty float32 `json:"repeat_penalty,omitempty"` PresencePenalty float32 `json:"presence_penalty,omitempty"` FrequencyPenalty float32 `json:"frequency_penalty,omitempty"` TFSZ float32 `json:"tfs_z,omitempty"` MirostatTau float32 `json:"mirostat_tau,omitempty"` MirostatEta float32 `json:"mirostat_eta,omitempty"` TopP float32 `json:"top_p,omitempty"` PenalizeNewline bool `json:"penalize_newline,omitempty"` }
type Runner ¶
type Runner struct { NumCtx int `json:"num_ctx,omitempty"` NumBatch int `json:"num_batch,omitempty"` NumGQA int `json:"num_gqa,omitempty"` NumGPU int `json:"num_gpu,omitempty"` MainGPU int `json:"main_gpu,omitempty"` NumThread int `json:"num_thread,omitempty"` RopeFrequencyBase float32 `json:"rope_frequency_base,omitempty"` RopeFrequencyScale float32 `json:"rope_frequency_scale,omitempty"` LogitsAll bool `json:"logits_all,omitempty"` VocabOnly bool `json:"vocab_only,omitempty"` UseMMap bool `json:"use_mmap,omitempty"` UseMLock bool `json:"use_mlock,omitempty"` EmbeddingOnly bool `json:"embedding_only,omitempty"` UseNUMA bool `json:"numa,omitempty"` F16KV bool `json:"f16_kv,omitempty"` LowVRAM bool `json:"low_vram,omitempty"` }
Click to show internal directories.
Click to hide internal directories.