Documentation
¶
Overview ¶
eliza implements a mock LLM provider based on the classic ELIZA chatbot created by Joseph Weizenbaum at MIT in 1966. It simulates a psychotherapist using pattern matching and transformation rules. It requires no API key or network access.
Index ¶
- func LoadLanguages() (map[string]*Language, error)
- func WithThinking() opt.Opt
- type Client
- func (c *Client) GetModel(ctx context.Context, name string, opts ...opt.Opt) (*schema.Model, error)
- func (c *Client) ListModels(ctx context.Context, opts ...opt.Opt) ([]schema.Model, error)
- func (*Client) Name() string
- func (c *Client) WithSession(ctx context.Context, model schema.Model, session *schema.Conversation, ...) (*schema.Message, *schema.Usage, error)
- func (c *Client) WithoutSession(ctx context.Context, model schema.Model, message *schema.Message, ...) (*schema.Message, *schema.Usage, error)
- type Engine
- type Language
- type Opt
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadLanguages ¶
LoadLanguages reads all embedded lang/*.json files and returns them keyed by model name
func WithThinking ¶
WithThinking enables thinking output for ELIZA sessions. When enabled, the accumulated memory from the conversation is emitted as a thinking content block in the response.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the ELIZA chatbot as an LLM provider
func (*Client) ListModels ¶
ListModels returns the available models
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine implements the classic ELIZA conversation algorithm created by Joseph Weizenbaum at MIT in 1966.
func (*Engine) InferMemory ¶
InferMemory scans conversation messages and rebuilds the memory list from user messages that match memorable rules. This allows the engine to be created fresh per request while preserving memory state.
type Language ¶
type Language struct {
Model string `json:"model"`
Description string `json:"description"`
LanguageCode string `json:"language"`
Quits []string `json:"quits"`
Greetings []string `json:"greetings"`
Reflections map[string]string `json:"reflections"`
Rules []Rule `json:"rules"`
GreetingResponses []string `json:"greetingResponses"`
GoodbyeResponses []string `json:"goodbyeResponses"`
DefaultResponses []string `json:"defaultResponses"`
MemoryResponses []string `json:"memoryResponses"`
}
Language defines all the text data for an ELIZA language variant