interfaces

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ChatMessageRoleSystem    = openai.ChatMessageRoleSystem
	ChatMessageRoleUser      = openai.ChatMessageRoleUser
	ChatMessageRoleAssistant = openai.ChatMessageRoleAssistant
)
View Source
const (
	SkillTypeDefault   SkillType = iota
	SkillTypeGeneric             = 1
	SkillTypeExpert              = 2
	SkillTypeDAN                 = 991
	SkillTypeSTAN                = 992
	SkillTypeDUDE                = 993
	SkillTypeJailBreak           = 994
	SkillTypeMongo               = 995
	SkillTypeCustom              = 9999
)
View Source
const (
	// https://www.reddit.com/r/ChatGPT/comments/10vinun/presenting_dan_60
	DANPrompt string = `` /* 1935-byte string literal not displayed */

	STANPrompt string = `` /* 1340-byte string literal not displayed */

	// From "Sape", via email, Re: my YouTube video.
	DUDEPrompt string = `` /* 2168-byte string literal not displayed */

	JailBreakPrompt string = `` /* 4191-byte string literal not displayed */

	MongoPrompt string = `` /* 685-byte string literal not displayed */

)

Variables

View Source
var (
	// ErrInvalidInput required input was not found
	ErrInvalidInput = errors.New("required input was not found")

	// ErrInitAlready previously been initialized
	ErrInitAlready = errors.New("previously been initialized")

	// ErrEmptyChoices no valid choices
	ErrEmptyChoices = errors.New("no valid choices")
)

Functions

This section is empty.

Types

type AdvancedChat

type AdvancedChat interface {
	Init(level SkillType, model string) error
	InitWithProvided(model string, previous []CompletionMessage) error
	DynamicInit(model string, previous []CompletionMessage) error
	GetConversation() ([]CompletionMessage, error)
	EditConversation(index int, statement string) ([]CompletionChoice, error)
	Query(ctx context.Context, role, statement string) ([]CompletionChoice, error)
	AddDirective(directives string) error
	AddUserContext(text string) error
	CommitResponse(index int) error
}

type AdvancedChatStream added in v0.2.0

type AdvancedChatStream interface {
	Init(level SkillType, model string) error
	InitWithProvided(model string, previous []CompletionMessage) error
	DynamicInit(model string, previous []CompletionMessage) error
	GetConversation() ([]CompletionMessage, error)
	EditConversation(index int, statement string) (*StreamingCompletion, error)
	Query(ctx context.Context, statement string) (*StreamingCompletion, error)
	AddDirective(directives string) error
	AddUserContext(text string) error
}

type CompletionChoice added in v0.2.1

type CompletionChoice struct {
	Index   int
	Message *CompletionMessage
}

type CompletionMessage added in v0.2.1

type CompletionMessage struct {
	Role    string
	Content string
	Name    string
}

shared

type SimpleChat

type SimpleChat interface {
	Init(level SkillType, model string) error
	Query(ctx context.Context, statement string) (string, error)
}

rest interfaces

type SkillType

type SkillType int64

type StandardChat added in v0.2.0

type StandardChat interface {
	Init(level SkillType, model string) error
	Query(ctx context.Context, statement string) ([]CompletionChoice, error)
	AddDirective(directives string) error
	CommitResponse(index int) error
}

type StandardChatStream added in v0.2.0

type StandardChatStream interface {
	Init(level SkillType, model string) error
	GetConversation() ([]CompletionMessage, error)
	Query(ctx context.Context, statement string) (*StreamingCompletion, error)
	AddDirective(directives string) error
}

type StreamingCompletion added in v0.2.0

type StreamingCompletion interface {
	Stream(w io.Writer) error
	Close() error
}

streaming interfaces

Jump to

Keyboard shortcuts

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