jeepity

package
v0.0.0-...-088f13f Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotApproved    = errors.New("not approved")
	ErrContextTooLong = errors.New("context too long")
	ErrUserNotFound   = errors.New("user not found")
	ErrsPersistent    = []error{
		ErrContextTooLong,
	}
)
View Source
var ErrMessageVersion = fmt.Errorf("unsupported message version")

Functions

func Authenticate

func Authenticate(s store.Store) telebot.MiddlewareFunc

func ErrorHandler

func ErrorHandler() telebot.MiddlewareFunc

Types

type BotHandler

type BotHandler struct {
	// contains filtered or unexported fields
}

func NewBotHandler

func NewBotHandler(ctx context.Context, openAiClient *openai.Client, st store.Store, e Cryptor) *BotHandler

func (*BotHandler) ClearInputState

func (b *BotHandler) ClearInputState(c telebot.Context) error

func (*BotHandler) CommandHelp

func (b *BotHandler) CommandHelp(c telebot.Context) error

func (*BotHandler) CommandInvite

func (b *BotHandler) CommandInvite(c telebot.Context) error

func (*BotHandler) CommandReset

func (b *BotHandler) CommandReset(c telebot.Context) error

func (*BotHandler) CommandSystemPrompt

func (b *BotHandler) CommandSystemPrompt(c telebot.Context) error

func (*BotHandler) Configure

func (b *BotHandler) Configure(bot *telebot.Bot)

func (*BotHandler) SetDefaultSystemPrompt

func (b *BotHandler) SetDefaultSystemPrompt(c telebot.Context) error

func (*BotHandler) Text

func (b *BotHandler) Text(c telebot.Context) error

func (*BotHandler) TranscribeAudio

func (b *BotHandler) TranscribeAudio(c telebot.Context) error

func (*BotHandler) TranscribeDocument

func (b *BotHandler) TranscribeDocument(c telebot.Context) error

func (*BotHandler) TranscribeVideo

func (b *BotHandler) TranscribeVideo(c telebot.Context) error

func (*BotHandler) TranscribeVideoNote

func (b *BotHandler) TranscribeVideoNote(c telebot.Context) error

func (*BotHandler) TranscribeVoice

func (b *BotHandler) TranscribeVoice(c telebot.Context) error

func (*BotHandler) Unsupported

func (b *BotHandler) Unsupported(c telebot.Context) error

func (*BotHandler) Wait

func (b *BotHandler) Wait()

type Completion

type Completion struct {
	Model            string
	Response         string
	PromptTokens     int
	CompletionTokens int
	TotalTokens      int
}

type Cryptor

type Cryptor interface {
	EncryptMessage(user *store.User, message *store.Message) error
	DecryptMessage(user *store.User, message *store.Message) error
}

func NewAesEncryptor

func NewAesEncryptor(password string) Cryptor

type OggMp3Converter

type OggMp3Converter struct {
	// contains filtered or unexported fields
}

func NewOggMp3Converter

func NewOggMp3Converter(input, output string) *OggMp3Converter

func (*OggMp3Converter) Command

func (f *OggMp3Converter) Command(ctx context.Context) *exec.Cmd

Jump to

Keyboard shortcuts

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