Documentation
¶
Index ¶
- type LLM
- func (f *LLM) AddResponse(response string)
- func (f *LLM) Call(ctx context.Context, prompt string, options ...llms.CallOption) (string, error)
- func (f *LLM) GenerateContent(_ context.Context, messages []schema.MessageContent, _ ...llms.CallOption) (*schema.ContentResponse, error)
- func (f *LLM) GetCallCount() int
- func (f *LLM) LastPrompt() (string, bool)
- func (f *LLM) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LLM ¶
type LLM struct {
// contains filtered or unexported fields
}
func NewFakeLLM ¶
func (*LLM) AddResponse ¶
AddResponse appends a new response to the list.
func (*LLM) Call ¶
func (f *LLM) Call( ctx context.Context, prompt string, options ...llms.CallOption, ) (string, error)
Call is a simplified interface for generating responses from a string prompt.
func (*LLM) GenerateContent ¶
func (f *LLM) GenerateContent( _ context.Context, messages []schema.MessageContent, _ ...llms.CallOption, ) (*schema.ContentResponse, error)
GenerateContent returns the next predefined response in the cycle.
func (*LLM) GetCallCount ¶ added in v0.2.0
GetCallCount returns the number of times the LLM was called.
func (*LLM) LastPrompt ¶ added in v0.2.0
LastPrompt returns the last prompt sent to the LLM.
Click to show internal directories.
Click to hide internal directories.