Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hallucinate ¶ added in v1.10.0
func Hallucinate[T valid.Interface](ctx context.Context, c *Client, opts HallucinateOpts) (*T, error)
Hallucinate prompts the model to hallucinate a "valid" JSON response to the given input.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewLocalClient ¶
func NewLocalClient() *Client
func (*Client) Chat ¶
func (c *Client) Chat(ctx context.Context, inp *CompleteRequest) (*CompleteResponse, error)
func (*Client) Embeddings ¶ added in v1.10.0
func (c *Client) Embeddings(ctx context.Context, er *EmbedRequest) (*EmbedResponse, error)
type CompleteRequest ¶
type CompleteResponse ¶
type CompleteResponse struct { Model string `json:"model"` CreatedAt time.Time `json:"created_at"` Message Message `json:"message"` Done bool `json:"done"` TotalDuration float64 `json:"total_duration"` LoadDuration float64 `json:"load_duration"` PromptEvalCount int64 `json:"prompt_eval_count"` PromptEvalDuration int64 `json:"prompt_eval_duration"` EvalCount int64 `json:"eval_count"` EvalDuration int64 `json:"eval_duration"` }
type EmbedRequest ¶ added in v1.10.0
type EmbedResponse ¶ added in v1.10.0
type EmbedResponse struct {
Embedding []float64 `json:"embedding"`
}
type HallucinateOpts ¶ added in v1.10.0
HallucinateOpts contains the options for the Hallucinate function.
Click to show internal directories.
Click to hide internal directories.