ai

package
v0.0.0-...-5fbe0f3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func NewEngine

func NewEngine(mode EngineMode, config *config.Config) (*Engine, error)

func (*Engine) ChatStreamCompletion

func (e *Engine) ChatStreamCompletion(input string) error

func (*Engine) Clear

func (e *Engine) Clear() *Engine

func (*Engine) ExecCompletion

func (e *Engine) ExecCompletion(input string) (*EngineExecOutput, error)

func (*Engine) GetChannel

func (e *Engine) GetChannel() chan EngineChatStreamOutput

func (*Engine) GetMode

func (e *Engine) GetMode() EngineMode

func (*Engine) Interrupt

func (e *Engine) Interrupt() *Engine

func (*Engine) Reset

func (e *Engine) Reset() *Engine

func (*Engine) SetMode

func (e *Engine) SetMode(mode EngineMode) *Engine

func (*Engine) SetPipe

func (e *Engine) SetPipe(pipe string) *Engine

type EngineChatStreamOutput

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

func (EngineChatStreamOutput) GetContent

func (co EngineChatStreamOutput) GetContent() string

func (EngineChatStreamOutput) IsExecutable

func (co EngineChatStreamOutput) IsExecutable() bool

func (EngineChatStreamOutput) IsInterrupt

func (co EngineChatStreamOutput) IsInterrupt() bool

func (EngineChatStreamOutput) IsLast

func (co EngineChatStreamOutput) IsLast() bool

type EngineExecOutput

type EngineExecOutput struct {
	Command     string `json:"cmd"`
	Explanation string `json:"exp"`
	Executable  bool   `json:"exec"`
}

func (EngineExecOutput) GetCommand

func (eo EngineExecOutput) GetCommand() string

func (EngineExecOutput) GetExplanation

func (eo EngineExecOutput) GetExplanation() string

func (EngineExecOutput) IsExecutable

func (eo EngineExecOutput) IsExecutable() bool

type EngineMode

type EngineMode int
const (
	ExecEngineMode EngineMode = iota
	ChatEngineMode
)

func (EngineMode) String

func (m EngineMode) String() string

Jump to

Keyboard shortcuts

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