Documentation
¶
Index ¶
- func BackoffDelay(attempt int, cfg RetryConfig) time.Duration
- func IsTransient(err error) bool
- type RetryConfig
- type RetryEvent
- type RouteEntry
- type Router
- func (r *Router) Chat(ctx context.Context, messages []client.EyrieMessage, opts client.ChatOptions) (*client.EyrieResponse, error)
- func (r *Router) Name() string
- func (r *Router) Ping(ctx context.Context) error
- func (r *Router) Stats() map[string]int64
- func (r *Router) StreamChat(ctx context.Context, messages []client.EyrieMessage, opts client.ChatOptions) (*client.StreamResult, error)
- type ToolFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackoffDelay ¶
func BackoffDelay(attempt int, cfg RetryConfig) time.Duration
func IsTransient ¶
Types ¶
type RetryConfig ¶
type RetryConfig struct {
MaxRetries int
BaseDelay time.Duration
MaxDelay time.Duration
OnRetry func(RetryEvent)
}
func DefaultRetryConfig ¶
func DefaultRetryConfig() RetryConfig
type RetryEvent ¶
type RouteEntry ¶
type RouteEntry struct {
Provider client.Provider
Weight int
Retry *RetryConfig
}
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func New ¶
func New(entries []RouteEntry, fallback []client.Provider, defaultRetry *RetryConfig) *Router
func (*Router) Chat ¶
func (r *Router) Chat(ctx context.Context, messages []client.EyrieMessage, opts client.ChatOptions) (*client.EyrieResponse, error)
func (*Router) StreamChat ¶
func (r *Router) StreamChat(ctx context.Context, messages []client.EyrieMessage, opts client.ChatOptions) (*client.StreamResult, error)
type ToolFilter ¶
type ToolFilter struct {
// contains filtered or unexported fields
}
func NewToolFilter ¶
func NewToolFilter(modelTools map[string][]string) *ToolFilter
func (*ToolFilter) FilterTools ¶
Click to show internal directories.
Click to hide internal directories.