agent

package
v0.0.0-...-fc4cb94 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const LOG_MODEL = true

const MODEL_NAME = "orca-mini:13b"

View Source
const MODEL_NAME = "neural-chat"

const MODEL_NAME = "zephyr"

Variables

This section is empty.

Functions

func Browse

func Browse(url string) string

func BuildTree

func BuildTree(agent *Agent) *prompt.FunctionNode

func CurrentTime

func CurrentTime(_ string) string

func DefaultBuildTree

func DefaultBuildTree() *prompt.FunctionNode

DefaultBuildTree builds the default tree of FunctionNodes

func Finish

func Finish(input string) string

func FunctionsAsString

func FunctionsAsString(functions []FunctionInfo) string

func GetCurrentTimeString

func GetCurrentTimeString() string

GetCurrentTimeString returns the current time as a string.

func PullModel

func PullModel() error
func Search(text string) string

Types

type Agent

type Agent struct {
	PromptTree     *prompt.FunctionNode
	MaxLength      int
	MessageHistory *messages.MessageHistory
	Functions      []FunctionInfo
}

func NewAgent

func NewAgent(options ...AgentOption) *Agent

func (*Agent) GeneratePrompt

func (a *Agent) GeneratePrompt(input ...string) (string, string, error)

func (*Agent) Run

func (a *Agent) Run(input ...string) (string, error)

type AgentOption

type AgentOption func(*Agent)

func WithMaxLength

func WithMaxLength(maxLength int) AgentOption

func WithPromptTree

func WithPromptTree(promptTree *prompt.FunctionNode) AgentOption

type FunctionInfo

type FunctionInfo struct {
	FunctionName        string
	FunctionDescription string
	FunctionInput       string
	FunctionRef         func(string) string
}

type GenerateRequest

type GenerateRequest struct {
	Model  string `json:"model,omitempty"`
	System string `json:"system,omitempty"`
	Prompt string `json:"prompt,omitempty"`
	Raw    bool   `json:"raw,omitempty"`
	Stream bool   `json:"stream"`
}

type GenerateResponse

type GenerateResponse struct {
	Response string `json:"response"`
	Done     bool   `json:"done"`
}

Jump to

Keyboard shortcuts

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