chatgpt

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderContentType = "Content-Type"
	ContentTypeForm   = "application/x-www-form-urlencoded"
)

Variables

This section is empty.

Functions

func NewHTTPHandler

func NewHTTPHandler(l *zap.Logger) http.Handler

func Start

func Start(l *zap.Logger, mux *http.ServeMux)

Types

type ChatCompletionChoice

type ChatCompletionChoice struct {
	Index        int                          `json:"index"`
	Message      openai.ChatCompletionMessage `json:"message"`
	FinishReason string                       `json:"finish_reason"`
}

type ChatCompletionResponse

type ChatCompletionResponse struct {
	ID                string                 `json:"id"`
	Object            string                 `json:"object"`
	Created           int64                  `json:"created"`
	Model             string                 `json:"model"`
	Choices           []ChatCompletionChoice `json:"choices"`
	Usage             openai.Usage           `json:"usage"`
	SystemFingerprint string                 `json:"system_fingerprint"`

	Error string `json:"error,omitempty"`
}

Workaround for a JSON conversion issue in the client library, and for passing errors back to the caller.

Jump to

Keyboard shortcuts

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