integration

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModule

func NewModule() common.Module

Types

type Chat

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

func (*Chat) Initialize

func (chat *Chat) Initialize(bird common.ExternalChatManager)

func (*Chat) RecieveMessage

func (chat *Chat) RecieveMessage(user common.User, message string)

type Config

type Config struct {
	OpenAIKey             string           `yaml:"open_ai_key" env:"OPENAI_KEY"`
	EnableCommand         Feature          `yaml:"enable_command"`
	EnableChat            Feature          `yaml:"enable_chat"`
	EnableImageGeneration Feature          `yaml:"enable_image_generation"`
	Prompts               []chatgpt.Prompt `yaml:"prompts"`
	ChatGPTModel          string           `yaml:"chatgpt_model"`
	DalleModel            string           `yaml:"dalle_model"`
	ResponseChance        float64          `yaml:"response_chance"`
	HistoryLength         int              `yaml:"history_length"`
}

type Feature

type Feature string

Feature is a boolean string used to toggle functionality

func (Feature) IsEnabled

func (value Feature) IsEnabled() bool

IsEnabled returns true when a feature is set to be true

func (Feature) IsEnabledByDefault

func (value Feature) IsEnabledByDefault() bool

IsEnabled returns true when a feature is set to be true or if the feature flag is not set at all

type Module

type Module struct {
	ChatGPT *chatgpt.ChatGPT
	DALLE   *dalle.DALLE
	Config  *Config
	// contains filtered or unexported fields
}

func (*Module) Initialize

func (m *Module) Initialize(birdbot common.ModuleManager) error

func (*Module) NewChat

func (m *Module) NewChat() *Chat

Jump to

Keyboard shortcuts

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