Documentation
¶
Index ¶
- type ProviderProxy
- type ProxyOption
- type Supervisor
- func (s *Supervisor) ExecuteTool(ctx context.Context, cmd string) (string, error)
- func (s *Supervisor) Generate(ctx context.Context, providerID, model string, params provider.GenerateParams) (iter.Seq2[provider.StreamEvent, error], error)
- func (s *Supervisor) GetBackgroundStatus(id string) (map[string]interface{}, error)
- func (s *Supervisor) SetEventBus(bus *eventbus.Bus)
- func (s *Supervisor) StartBackground(cmd string) (string, error)
- func (s *Supervisor) StopBackground(id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderProxy ¶
type ProviderProxy struct {
// contains filtered or unexported fields
}
ProviderProxy implements provider.Provider but forwards requests to the Supervisor.
func NewProviderProxy ¶
func NewProviderProxy(sv *Supervisor, providerID, defaultModel string, opts ...ProxyOption) *ProviderProxy
NewProviderProxy creates a new proxy for a specific provider.
func (*ProviderProxy) Generate ¶
func (p *ProviderProxy) Generate(ctx context.Context, params provider.GenerateParams) (iter.Seq2[provider.StreamEvent, error], error)
Generate forwards the request to the Supervisor.
func (*ProviderProxy) ListModels ¶
ListModels is not proxied yet; returns empty list. Implement when model listing via proxy is needed.
type ProxyOption ¶
type ProxyOption interface {
// contains filtered or unexported methods
}
ProxyOption configures optional parameters for ProviderProxy.
func WithFallback ¶
func WithFallback(providerID, model string) ProxyOption
WithFallback configures a fallback provider and model used when the primary fails.
func WithMaxTokens ¶
func WithMaxTokens(n int) ProxyOption
WithMaxTokens sets the default max tokens for generation requests.
func WithTemperature ¶
func WithTemperature(t float64) ProxyOption
WithTemperature sets the default temperature for generation requests.
type Supervisor ¶
Supervisor is the root component that manages secrets and lifecycle.
func (*Supervisor) ExecuteTool ¶
ExecuteTool forwards a command execution request to the internal exec tool. Importantly, the exec tool is configured with an environment whitelist in New(), ensuring that sensitive secrets (like API keys) are NOT passed to the command.
func (*Supervisor) Generate ¶
func (s *Supervisor) Generate(ctx context.Context, providerID, model string, params provider.GenerateParams) (iter.Seq2[provider.StreamEvent, error], error)
Generate forwards a generation request to the appropriate provider. This is called by the Runtime via the Proxy.
func (*Supervisor) GetBackgroundStatus ¶
func (s *Supervisor) GetBackgroundStatus(id string) (map[string]interface{}, error)
GetBackgroundStatus returns the status of a background process.
func (*Supervisor) SetEventBus ¶ added in v0.7.0
func (s *Supervisor) SetEventBus(bus *eventbus.Bus)
SetEventBus attaches an event bus to the supervised exec tool so that SandboxDecisionEvent records flow into audit. Wiring should call this once after the bus is constructed (post-build).
func (*Supervisor) StartBackground ¶
func (s *Supervisor) StartBackground(cmd string) (string, error)
StartBackground starts a command in the background.
func (*Supervisor) StopBackground ¶
func (s *Supervisor) StopBackground(id string) error
StopBackground stops a background process.