Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Configuration{
	OpenAIModel:   openai.GPT3Dot5Turbo,
	AutoMode:      false,
	TruncateLimit: 0,
	MD5Rewrites:   false,
	EnableLogs:    false,
	LoggerOutput:  "",
	Temperature:   1.0,
}

Functions

func NewContext

func NewContext(ctx context.Context, config Configuration) context.Context

Types

type Configuration

type Configuration struct {
	OpenAIModel   string
	EmbedModel    string
	CompletionURL string
	EmbeddingURL  string
	AutoMode      bool
	TruncateLimit int
	MD5Rewrites   bool
	EnableLogs    bool
	LoggerOutput  string
	Temperature   float32
}

func FromContext

func FromContext(ctx context.Context) Configuration

func WithDefaults added in v0.9.0

func WithDefaults(userConfig Configuration) Configuration

withDefaults merges the provided configuration with the default configuration, and returns a new configuration object with default values for any fields that are not provided.

Jump to

Keyboard shortcuts

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