Documentation ¶
Index ¶
- type MultiCompletionStep
- type ParameterLayer
- type Step
- func (s *Step) GetOutput() <-chan helpers.Result[string]
- func (s *Step) GetState() interface{}
- func (s *Step) IsFinished() bool
- func (s *Step) Run(ctx context.Context, prompt string) error
- func (s *Step) RunChatCompletion(ctx context.Context, prompt, engine string) error
- func (s *Step) RunCompletion(ctx context.Context, prompt, engine string) error
- type StepFactory
- type StepSettings
- type StepState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiCompletionStep ¶
type MultiCompletionStep struct {
// contains filtered or unexported fields
}
MultiCompletionStep runs multiple completion steps in parallel
func NewMultiCompletionStep ¶
func NewMultiCompletionStep(settings *StepSettings) *MultiCompletionStep
func (*MultiCompletionStep) GetOutput ¶
func (mc *MultiCompletionStep) GetOutput() <-chan helpers.Result[[]string]
func (*MultiCompletionStep) GetState ¶
func (mc *MultiCompletionStep) GetState() interface{}
func (*MultiCompletionStep) IsFinished ¶
func (mc *MultiCompletionStep) IsFinished() bool
type ParameterLayer ¶
type ParameterLayer struct {
*layers.ParameterLayerImpl
}
func NewParameterLayer ¶
func NewParameterLayer(options ...layers.ParameterLayerOptions) (*ParameterLayer, error)
type Step ¶
type Step struct {
// contains filtered or unexported fields
}
func NewStep ¶
func NewStep(settings *StepSettings) *Step
func (*Step) IsFinished ¶
func (*Step) RunChatCompletion ¶
type StepFactory ¶
type StepFactory struct { ClientSettings *openai.ClientSettings `yaml:"client,omitempty"` StepSettings *StepSettings `yaml:"completion,omitempty"` }
func NewStepFactory ¶
func NewStepFactory( settings *StepSettings, clientSettings *openai.ClientSettings, ) *StepFactory
func NewStepFactoryFromYAML ¶
func NewStepFactoryFromYAML(s io.Reader) (*StepFactory, error)
func (*StepFactory) UpdateFromParameters ¶
func (csf *StepFactory) UpdateFromParameters(ps map[string]interface{}) error
type StepSettings ¶
type StepSettings 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"` // Sampling temperature to use Temperature *float64 `yaml:"temperature,omitempty" glazed.parameter:"openai-temperature"` // Alternative to temperature for nucleus sampling TopP *float64 `yaml:"top_p,omitempty" glazed.parameter:"openai-top-p"` // How many choice to create for each prompt N *int `yaml:"n" glazed.parameter:"openai-n"` // Include the probabilities of most likely tokens LogProbs *int `yaml:"logprobs" glazed.parameter:"openai-logprobs"` // 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"` Stream bool `yaml:"stream,omitempty" glazed.parameter:"openai-stream"` FrequencyPenalty *float64 `yaml:"frequency_penalty,omitempty" glazed.parameter:"openai-frequency-penalty"` PresencePenalty *float64 `yaml:"presence_penalty,omitempty" glazed.parameter:"openai-presence-penalty"` BestOf *int `yaml:"best_of,omitempty" glazed.parameter:"openai-best-of"` // 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"` }
func NewStepSettings ¶
func NewStepSettings() *StepSettings
func NewStepSettingsFromParameters ¶
func NewStepSettingsFromParameters(ps map[string]interface{}) (*StepSettings, error)
func (*StepSettings) Clone ¶
func (c *StepSettings) Clone() *StepSettings
Click to show internal directories.
Click to hide internal directories.