Versions in this module Expand all Collapse all v0 v0.1.1 Mar 2, 2024 v0.1.0 Feb 29, 2024 Changes in this version + var ErrEmptyResponse = errors.New("empty response") + type Client struct + Model string + func New(token string, model string, opts ...Option) (*Client, error) + func (c *Client) CreateCompletion(ctx context.Context, r *CompletionRequest) (*Completion, error) + type Completion struct + Text string + type CompletionRequest struct + MaxTokens int + Model string + Prompt string + StopWords []string + Stream bool + StreamingFunc func(ctx context.Context, chunk []byte) error + Temperature float64 + TopP float64 + type CompletionResponsePayload struct + Completion string + LogID string + Model string + Stop string + StopReason string + type Doer interface + Do func(req *http.Request) (*http.Response, error) + type Option func(*Client) error + func WithHTTPClient(client Doer) Option