Documentation
¶
Overview ¶
Package agentcli implements the LLM gateway by shelling out to a coding-agent CLI in print mode, so every model call is billed to the operator's existing subscription rather than requiring an API key.
Every flag the CLI needs lives in this file. CLI churn is a known risk, and the fake-binary test in this package is what pins the flag set.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoCLI = errors.New("agentcli: no supported agent CLI found on PATH")
ErrNoCLI is returned when no supported agent CLI is on PATH.
Functions ¶
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway is a subscription-backed LLM gateway.
func (*Gateway) ModelFor ¶
func (g *Gateway) ModelFor(c llm.ModelClass) string
ModelFor implements llm.Gateway. When StrongModel/FastModel were left unset, run passes no --model flag (see run) and the CLI picks its own default — this gateway never observes what that default resolved to, so it returns "" rather than guess. It only reports a model when the operator configured one explicitly.
type Options ¶
type Options struct {
Binary string
StrongModel string
FastModel string
Cache llm.Cache
Timeout time.Duration
// MaxRetries bounds retries of transient API errors. Transient upstream
// overload is common enough that zero retries will lose a long eval.
MaxRetries int
// Sleep is the backoff hook, overridden in tests so they do not wait.
Sleep func(time.Duration)
}
Options configures the gateway.