gpt

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(client *openai.Client, completionModels []string, messagesCache *MessagesCache, ignoredChannelsCache *IgnoredChannelsCache) *bot.Command

Types

type IgnoredChannelsCache

type IgnoredChannelsCache map[string]struct{}

type MessagesCache

type MessagesCache struct {
	*lru.Cache[string, *MessagesCacheData]
}

func NewMessagesCache

func NewMessagesCache(size int) (*MessagesCache, error)

type MessagesCacheData

type MessagesCacheData struct {
	Messages      []openai.ChatCompletionMessage
	SystemMessage *openai.ChatCompletionMessage
	Model         string
	Temperature   *float32
	TokenCount    int
}

Jump to

Keyboard shortcuts

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