Documentation ¶
Index ¶
Constants ¶
View Source
const AiChatSlug = "ai-chat"
View Source
const AiClientSlug = "ai-client"
Variables ¶
View Source
var ErrMissingYAMLAPIKey = &yaml.TypeError{Errors: []string{"missing api key"}}
Functions ¶
This section is empty.
Types ¶
type ChatParameterLayer ¶
type ChatParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewChatParameterLayer ¶
func NewChatParameterLayer(options ...layers.ParameterLayerOptions) (*ChatParameterLayer, error)
type ChatSettings ¶
type ChatSettings struct { Engine *string `yaml:"engine,omitempty" glazed.parameter:"ai-engine"` MaxResponseTokens *int `yaml:"max_response_tokens,omitempty" glazed.parameter:"ai-max-response-tokens"` TopP *float64 `yaml:"top_p,omitempty" glazed.parameter:"ai-top-p"` Temperature *float64 `yaml:"temperature,omitempty" glazed.parameter:"ai-temperature"` Stop []string `yaml:"stop,omitempty" glazed.parameter:"ai-stop"` Stream bool `yaml:"stream,omitempty" glazed.parameter:"ai-stream"` }
func NewChatSettings ¶
func NewChatSettings() *ChatSettings
func (*ChatSettings) Clone ¶
func (s *ChatSettings) Clone() *ChatSettings
type ClientParameterLayer ¶
type ClientParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewClientParameterLayer ¶
func NewClientParameterLayer(options ...layers.ParameterLayerOptions) (*ClientParameterLayer, error)
type ClientSettings ¶
type ClientSettings struct { Timeout *time.Duration `yaml:"timeout,omitempty"` TimeoutSeconds *int `yaml:"timeout_second,omitempty" glazed.parameter:"timeout"` Organization *string `yaml:"organization,omitempty" glazed.parameter:"organization"` UserAgent *string `yaml:"user_agent,omitempty" glazed.parameter:"user-agent"` HTTPClient *http.Client `yaml:"omitempty"` }
func NewClientSettings ¶
func NewClientSettings() *ClientSettings
func (*ClientSettings) Clone ¶
func (cs *ClientSettings) Clone() *ClientSettings
func (*ClientSettings) UnmarshalYAML ¶
func (cs *ClientSettings) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML overrides YAML parsing to convert time.duration from int
func (*ClientSettings) UpdateFromParameters ¶
func (cs *ClientSettings) UpdateFromParameters(parsedLayers *layers.ParsedLayer) error
func (*ClientSettings) UpdateFromParsedLayer ¶
func (cs *ClientSettings) UpdateFromParsedLayer(layer *layers.ParsedLayer) error
type StepSettings ¶
type StepSettings struct { Chat *ChatSettings `yaml:"chat,omitempty" glazed.layer:"ai-chat"` OpenAI *openai.Settings `yaml:"openai,omitempty" glazed.layer:"openai-chat"` Client *ClientSettings `yaml:"client,omitempty" glazed.layer:"ai-client"` Claude *claude.Settings `yaml:"claude,omitempty" glazed.layer:"claude-chat"` Ollama *ollama.Settings `yaml:"ollama,omitempty" glazed.layer:"ollama-chat"` }
func NewStepSettings ¶ added in v0.2.24
func NewStepSettings() *StepSettings
func NewStepSettingsFromYAML ¶
func NewStepSettingsFromYAML(s io.Reader) (*StepSettings, error)
func (*StepSettings) Clone ¶
func (s *StepSettings) Clone() *StepSettings
func (*StepSettings) GetMetadata ¶ added in v0.4.1
func (ss *StepSettings) GetMetadata() map[string]interface{}
func (*StepSettings) UpdateFromParsedLayers ¶
func (s *StepSettings) UpdateFromParsedLayers(parsedLayers *layers.ParsedLayers) error
UpdateFromParsedLayers updates the settings of a chat step from the parsedLayers of a glazed command. TODO(manuel, 2024-01-05) Not sure how this relates to InitializeStruct
Click to show internal directories.
Click to hide internal directories.