Versions in this module Expand all Collapse all v0 v0.1.15 Oct 30, 2024 v0.1.14 Oct 30, 2024 Changes in this version + var ErrEmptyResponse = errors.New("empty response") + var ErrInvalidToken = errors.New("invalid token") + var ErrUnexpectedStatusCode = errors.New("unexpected status code") + type Client struct + Model string + Token string + func New(token, model, url string) (*Client, error) + func (c *Client) CreateEmbedding(ctx context.Context, model string, task string, r *EmbeddingRequest) ([][]float32, error) + func (c *Client) RunInference(ctx context.Context, request *InferenceRequest) (*InferenceResponse, error) + type EmbeddingRequest struct + Inputs []string + Options map[string]any + type InferenceRequest struct + MaxLength int + MinLength int + Model string + Prompt string + RepetitionPenalty float64 + Seed int + Task InferenceTask + Temperature float64 + TopK int + TopP float64 + type InferenceResponse struct + Text string + type InferenceTask string + const InferenceTaskText2TextGeneration + const InferenceTaskTextGeneration