completion

package
v0.0.0-...-da38182 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = cli.Command{
	Name:   "completion",
	Action: cmdCompletion,
	Flags: []cli.Flag{
		flagModel,
		flagPrompt,
		flagN,
		flagStop,
		flagEcho,
		flagUser,
	},
}

Functions

This section is empty.

Types

type Choice

type Choice struct {
	Text         string `json:"text"`
	Index        int    `json:"index"`
	Logprobs     *int   `json:"logprobs"`
	FinishReason string `json:"finish_reason"`
}

type Request

type Request struct {
	Model           string         `json:"model"`
	Prompt          string         `json:"prompt"`
	Suffix          *string        `json:"suffix"`
	MaxTokens       int            `json:"max_tokens"`
	Temperature     int            `json:"temperature"`
	TopP            int            `json:"top_p"`
	N               int            `json:"n"`
	Stream          bool           `json:"stream"`
	Logprobs        *int           `json:"logprobs"`
	Echo            bool           `json:"echo"`
	Stop            string         `json:"stop,omitempty"`
	PresencePenalty float64        `json:"presence_penalty"`
	BestOf          int            `json:"best_of"`
	LogitBias       map[string]int `json:"logit_bias,omitempty"`
	User            string         `json:"user"`
}

type Response

type Response struct {
	ID      string   `json:"id"`
	Object  string   `json:"object"`
	Created int      `json:"created"`
	Model   string   `json:"model"`
	Choices []Choice `json:"choices"`
	Usage   struct {
		PromptTokens     int `json:"prompt_tokens"`
		CompletionTokens int `json:"completion_tokens"`
		TotalTokens      int `json:"total_tokens"`
	} `json:"usage"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL