Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSession ¶
func NewSession(model llm.Model, factory MessageFactory, opts ...llm.Opt) *session
Create a new empty session to store a context window
Types ¶
type MessageFactory ¶
type MessageFactory interface { // Generate a system prompt SystemPrompt(prompt string) llm.Completion // Generate a user prompt, with attachments and other options UserPrompt(string, ...llm.Opt) (llm.Completion, error) // Generate an array of results from calling tools ToolResults(...llm.ToolResult) ([]llm.Completion, error) }
Abstract interface for a message factory
type ModelCache ¶
func NewModelCache ¶
func NewModelCache() *ModelCache
func (*ModelCache) Get ¶
func (c *ModelCache) Get(fn ModelLoadFunc, name string) (llm.Model, error)
Return a model by name
func (*ModelCache) Load ¶
func (c *ModelCache) Load(fn ModelLoadFunc) ([]llm.Model, error)
Load models and return them
type ModelLoadFunc ¶
Click to show internal directories.
Click to hide internal directories.