chatgpt

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPHandler

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

func Start

func Start(l *zap.Logger, muxes *muxes.Muxes)

Start initializes all the HTTP handlers of the ChatGPT integration. This includes connection UIs and initialization webhooks.

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