gpt

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAIContextItem

type OpenAIContextItem struct {
	Message openai.ChatCompletionMessage
	Summary string
	Date    time.Time
}

func NewRequest

func NewRequest(ctx context.Context, apiKey string, messages []openai.ChatCompletionMessage) (*OpenAIContextItem, error)

NewRequest function creates APIContext instance.

func OpenContext

func OpenContext() ([]OpenAIContextItem, error)

OpenContext method reads openai message history to recover context from the file in .commit/context.csv.

func (*OpenAIContextItem) Persist

func (gptContext *OpenAIContextItem) Persist() error

Persist method saves openai message history to recover context.

Jump to

Keyboard shortcuts

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