router

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package router maps task roles to specific AI providers. This enables heterogeneous multi-agent execution where different task types (backend, frontend, security, etc.) are handled by the most suitable model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router routes tasks to specific providers based on their role. When no route is configured for a role, the default provider is used.

func New

func New(defaultProvider provider.Provider) *Router

New creates a Router with the given default provider.

func (*Router) Default

func (r *Router) Default() provider.Provider

Default returns the default provider.

func (*Router) For

func (r *Router) For(role pm.AgentRole) provider.Provider

For returns the provider for a given task role. Falls back to the default provider if no route is registered for that role.

func (*Router) Register

func (r *Router) Register(role pm.AgentRole, prov provider.Provider)

Register binds a role to a provider.

func (*Router) Routes

func (r *Router) Routes() map[string]string

Routes returns a copy of the role→provider name mapping for display.

func (*Router) Summary

func (r *Router) Summary() string

Summary returns a human-readable description of the routing table.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL