chat

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 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 ParameterLayer

type ParameterLayer struct {
	*layers.ParameterLayerImpl `yaml:",inline"`
}

func NewParameterLayer

func NewParameterLayer(options ...layers.ParameterLayerOptions) (*ParameterLayer, error)

type Settings added in v0.2.4

type Settings struct {
	ClientSettings *openai.ClientSettings `yaml:"client,omitempty"`

	Engine *string `yaml:"engine,omitempty" glazed.parameter:"openai-engine"`

	MaxResponseTokens *int `yaml:"max_response_tokens,omitempty" glazed.parameter:"openai-max-response-tokens"`

	// TopP to use
	TopP *float64 `yaml:"top_p,omitempty" glazed.parameter:"openai-top-p"`
	// Sampling temperature to use
	Temperature *float64 `yaml:"temperature,omitempty" glazed.parameter:"openai-temperature"`
	// How many choice to create for each prompt
	N *int `yaml:"n" glazed.parameter:"openai-n"`
	// Up to 4 sequences where the API will stop generating tokens. Response will not contain the stop sequence.
	Stop []string `yaml:"stop,omitempty" glazed.parameter:"openai-stop"`
	// PresencePenalty to use
	PresencePenalty *float64 `yaml:"presence_penalty,omitempty" glazed.parameter:"openai-presence-penalty"`
	// FrequencyPenalty to use
	FrequencyPenalty *float64 `yaml:"frequency_penalty,omitempty" glazed.parameter:"openai-frequency-penalty"`
	// LogitBias to use
	// TODO(manuel, 2023-03-28) Properly load logit bias
	// See https://github.com/go-go-golems/geppetto/issues/48
	LogitBias map[string]string `yaml:"logit_bias,omitempty" glazed.parameter:"openai-logit-bias"`

	Stream bool `yaml:"stream,omitempty" glazed.parameter:"openai-stream"`
}

func NewSettings added in v0.2.4

func NewSettings() *Settings

func NewStepSettingsFromParameters

func NewStepSettingsFromParameters(ps map[string]interface{}) (*Settings, error)

func (*Settings) Clone added in v0.2.4

func (s *Settings) Clone() *Settings

type Step

type Step struct {
	ClientSettings *openai.ClientSettings `yaml:"client,omitempty"`
	StepSettings   *Settings              `yaml:"completion,omitempty"`
}

func NewStepFromYAML added in v0.2.4

func NewStepFromYAML(s io.Reader) (*Step, error)

func (*Step) Close added in v0.2.8

func (csf *Step) Close(ctx context.Context) error

Close is only called after the returned monad has been entirely consumed

func (*Step) Start added in v0.2.8

func (csf *Step) Start(
	ctx context.Context,
	messages []*geppetto_context.Message,
) (*steps.StepResult[string], error)

func (*Step) UpdateFromParameters added in v0.2.8

func (csf *Step) UpdateFromParameters(ps map[string]interface{}) error

Jump to

Keyboard shortcuts

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