text

package
v1.3.16-rc0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOKEN_COUNT_FACTOR     = 1.1
	MAX_SHORTENED_NEWLINES = 5
)

Variables

View Source
var DEFAULT = Configurations{
	Model:        "gpt-4o",
	SystemPrompt: "You are an assistant for a CLI interface. Answer concisely and informatively. Prefer markdown if possible.",
	Raw:          false,
	UseTools:     false,

	TokenWarnLimit: 17000,
}

Functions

This section is empty.

Types

type Configurations

type Configurations struct {
	Model          string      `json:"model"`
	SystemPrompt   string      `json:"system-prompt"`
	Raw            bool        `json:"raw"`
	UseTools       bool        `json:"use-tools"`
	TokenWarnLimit int         `json:"token-warn-limit"`
	ConfigDir      string      `json:"-"`
	StdinReplace   string      `json:"-"`
	Stream         bool        `json:"-"`
	ReplyMode      bool        `json:"-"`
	ChatMode       bool        `json:"-"`
	Glob           string      `json:"-"`
	InitialPrompt  models.Chat `json:"-"`
	// PostProccessedPrompt which has had it's strings replaced etc
	PostProccessedPrompt string `json:"-"`
}

Configurations used to setup the requirements of text models

func (*Configurations) SetupPrompts

func (c *Configurations) SetupPrompts(args []string) error

type Querier added in v1.2.0

type Querier[C models.StreamCompleter] struct {
	Url string
	Raw bool

	Model C
	// contains filtered or unexported fields
}

func NewQuerier added in v1.2.0

func NewQuerier[C models.StreamCompleter](userConf Configurations, dfault C) (Querier[C], error)

func (*Querier[C]) Query added in v1.2.0

func (q *Querier[C]) Query(ctx context.Context) error

Query using the underlying model to stream completions and then print the output from the model to stdout. Blocking operation.

func (*Querier[C]) TextQuery added in v1.2.0

func (q *Querier[C]) TextQuery(ctx context.Context, chat models.Chat) (models.Chat, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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