internal

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUpdateCallback

func GetUpdateCallback() func()

GetUpdateCallback returns a callback function that updates aix

Types

type Options

type Options struct {
	LLMSource          string              `yaml:"llm_source"`
	OpenaiApiKey       string              `yaml:"openai_api_key"`
	Prompt             string              `yaml:"prompt"`
	Gpt3               bool                `yaml:"gpt3"`
	Gpt4               bool                `yaml:"gpt4"`
	Model              string              `yaml:"model"`
	ListModels         bool                `yaml:"list_models"`
	Update             bool                `yaml:"update"`
	DisableUpdateCheck bool                `yaml:"disable_update_check"`
	Output             string              `yaml:"output"`
	Jsonl              bool                `yaml:"jsonl"`
	Verbose            bool                `yaml:"verbose"`
	Silent             bool                `yaml:"silent"`
	NoColor            bool                `yaml:"no_color"`
	Version            bool                `yaml:"version"`
	Stream             bool                `yaml:"stream"`
	TopP               float32             `yaml:"top_p"`
	Temperature        float32             `yaml:"temperature"`
	System             goflags.StringSlice `yaml:"system"`      // system message if any
	NoMarkdown         bool                `yaml:"no-markdown"` // render markdown message
}

Options contains the configuration options for tuning the enumeration process.

func ParseOptions

func ParseOptions() *Options

ParseOptions parses the command line flags provided by a user

type Result

type Result struct {
	Timestamp        string         `json:"timestamp"`
	Prompt           string         `json:"prompt"`
	Completion       string         `json:"completion"`
	Model            string         `json:"model"`
	CompletionStream *io.PipeReader `json:"-"` // contained stream response

	Error error `json:"-"`
	// contains filtered or unexported fields
}

func (*Result) CloseCompletionStream

func (r *Result) CloseCompletionStream()

CloseCompletionStream closes the completion stream

func (*Result) JSON

func (result *Result) JSON() string

func (*Result) SetupStreaming

func (r *Result) SetupStreaming()

SetupStreaming sets up the streaming for the result

func (*Result) WriteCompletionStreamResponse

func (r *Result) WriteCompletionStreamResponse(data string)

WriteCompletionStreamResponse writes a response to the completion stream

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳