Documentation
¶
Overview ¶
Package llm provides a minimal OpenAI-compatible chat completions client for executing map, filter, and reduce calls.
Index ¶
Constants ¶
const ( // DefaultBaseURL is used when no custom OpenAI-compatible endpoint is set. DefaultBaseURL = "https://openrouter.ai/api/v1" // DefaultTimeout is the per-request HTTP timeout. DefaultTimeout = 90 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func EstimateTokens ¶
EstimateTokens approximates token count (~4 bytes per token) for budgeting.
func IsRetryable ¶
IsRetryable reports whether err is transient (429, 5xx, or network timeout).
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls an OpenAI-compatible /chat/completions endpoint.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes prompts via any external CLI command reading the prompt from stdin and returning stdout.
type RunnerError ¶
RunnerError represents a non-zero exit or launch failure from a CLI runner.
func (*RunnerError) Error ¶
func (e *RunnerError) Error() string
func (*RunnerError) Unwrap ¶
func (e *RunnerError) Unwrap() error