Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditEntry ¶
type AuditEntry struct {
Time time.Time `json:"time"`
Type EventType `json:"type"`
Iteration int `json:"iteration,omitempty"`
MessageCount int `json:"message_count,omitempty"`
ToolName string `json:"tool_name,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
Error string `json:"error,omitempty"`
}
type AuditHook ¶
type AuditHook struct {
// contains filtered or unexported fields
}
func NewAuditHook ¶
func (*AuditHook) Entries ¶
func (h *AuditHook) Entries() []AuditEntry
type CounterHook ¶
type CounterHook struct {
// contains filtered or unexported fields
}
func NewCounterHook ¶
func NewCounterHook() *CounterHook
func (*CounterHook) Snapshot ¶
func (h *CounterHook) Snapshot() map[EventType]int
type EventType ¶
type EventType string
const ( EventLoopStart EventType = "loop_start" EventBeforeLLM EventType = "before_llm" EventAfterLLM EventType = "after_llm" EventBeforeTool EventType = "before_tool_call" EventAfterTool EventType = "after_tool_call" EventLoopEnd EventType = "loop_end" EventLoopError EventType = "error" DefaultMaxLoopIters = 8 )
type Loop ¶
type Loop struct {
// contains filtered or unexported fields
}
func (*Loop) Run ¶
func (l *Loop) Run(ctx context.Context, initial []llm.ChatMessage, opts RunOptions) (llm.ChatResponse, error)
type RunOptions ¶
type RunOptions struct {
MaxIterations int
OnDelta func(text string)
Tools []llm.ToolSchema
BlockedTools map[string]tool.BlockedToolError
ToolChoice *llm.ToolChoice
ResponseFormat *llm.ResponseFormat
AutoExpandOnce bool
}
Click to show internal directories.
Click to hide internal directories.