Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEchoServer ¶ added in v0.2.0
NewEchoServer creates a test server that echoes back the user message
Types ¶
type Brain ¶
Brain represents an interface for asking questions and receiving answers.
func New ¶
New creates a new instance of Brain based on the provided provider and optional playbook strings.
func NewDeepSeek ¶
NewDeepSeek creates a new deepSeek instance with the provided API key.
func NewMetricBrain ¶ added in v0.2.0
NewMetricBrain creates a new MetricBrain instance wrapping the given Brain and using the provided stats for writing statistics.
type EchoPlaybook ¶ added in v0.2.0
type EchoPlaybook struct{}
EchoPlaybook represents a playbook that echoes back the question asked.
func NewEchoPlaybook ¶ added in v0.2.0
func NewEchoPlaybook() *EchoPlaybook
NewEchoPlaybook creates a new instance of EchoPlaybook.
func (*EchoPlaybook) Ask ¶ added in v0.2.0
func (e *EchoPlaybook) Ask(question string) string
Ask echoes back the provided question.
type MetricBrain ¶ added in v0.2.0
type MetricBrain struct {
// contains filtered or unexported fields
}
MetricBrain is a wrapper around a Brain with added functionality to track metrics such as the duration of each question asked.
type Playbook ¶ added in v0.2.0
Playbook defines the interface for a playbook that can ask questions and return answers. It is used in tests mostly.
type YAMLPlaybook ¶ added in v0.2.0
type YAMLPlaybook struct {
// contains filtered or unexported fields
}
YAMLPlaybook represents a playbook loaded from a YAML file.
func NewYAMLPlaybook ¶ added in v0.2.0
func NewYAMLPlaybook(filePath string) (*YAMLPlaybook, error)
NewYAMLPlaybook loads a YAML playbook from the specified file path and returns a YAMLPlaybook instance.
func (*YAMLPlaybook) Ask ¶ added in v0.2.0
func (p *YAMLPlaybook) Ask(question string) string
Ask retrieves the answer to a given question from the playbook. If the question is not found, it returns a default "not found" message.