Documentation
¶
Index ¶
- type Builder
- func (b *Builder) Build() (chatter.Chatter, error)
- func (b *Builder) Cache(path string) *Builder
- func (b *Builder) Debug(enable bool) *Builder
- func (b *Builder) Profile(profile, model string) *Builder
- func (b *Builder) Quota(epoch int, usage chatter.Usage) *Builder
- func (b *Builder) Reporter(reporter interface{ ... }) *Builder
- func (b *Builder) Think(enable bool) *Builder
- type Mock
- type ProfileUsage
- type Route
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder creates LLM instances with configured capabilities using builder pattern. Each method immediately creates/decorates the instance.
Example:
llm, err := llm.New().
Profile("bedrock/claude-3-sonnet").
Debug(true).
Think(true).
MaxEpoch(10).
Build()
func (*Builder) Build ¶
Build returns the configured LLM instance. Returns any error encountered during building.
func (*Builder) Profile ¶
Creates LLM from profile defined at ~/.iqrc
machine iq
provider provider:bedrock/foundation/converse model us.anthropic.claude-3-7-sonnet-20250219-v1:0 region us-west-2
Special value "mock" creates a mock LLM for testing of client applications.
func (*Builder) Quota ¶
Quota the maximum number of epochs and tokens. Returns builder for chaining.
type Mock ¶
type Mock struct{}
Mock is a simple mock LLM that echoes the input.
type ProfileUsage ¶
ProfileUsage represents token usage for a specific LLM profile
type Route ¶
type Route string
Chatter interface option allowing to dynamically route prompts to choosen models
func (Route) ChatterOpt ¶
func (Route) ChatterOpt()
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Dynamic routing strategy throught pool of LLMs. The LLMs pool consists of default "route" and multiple named models.
func (*Router) ProfileUsage ¶
func (router *Router) ProfileUsage() []ProfileUsage
ProfileUsage returns token usage breakdown by LLM profile