Documentation
¶
Index ¶
- Variables
- func ApplyModelCapabilities(data map[string]interface{}, caps map[string]ModelCapability, ...) int
- func Handle(args []string) error
- func HandleUsages(args []string) error
- func ParseModelCapabilities(entries []string) (map[string]ModelCapability, error)
- func PatchCodexSSEOutput(body []byte) []byte
- func ReadCodexAuth(path string) (accessToken string, accountID string, err error)
- func StartAPIProxy(baseUrl string, modelMappings []string, port string, verbose bool, ...) error
- func StartCodexProxy(baseUrl string, modelMappings []string, port string, verbose bool, ...) error
- func TransformCodexRequest(data map[string]interface{}, logf func(format string, args ...any))
- type ColorMode
- type ConfigWebGrokDiffResult
- type ConfigWebSaveResult
- type ConfigWebSyncDiffResult
- type ModelCapability
Constants ¶
This section is empty.
Variables ¶
var CapNoImage = ModelCapability{NoImage: true}
CapNoImage is a capability value with only NoImage set.
Functions ¶
func ApplyModelCapabilities ¶ added in v0.0.10
func ApplyModelCapabilities(data map[string]interface{}, caps map[string]ModelCapability, logf func(format string, args ...any)) int
ApplyModelCapabilities delegates to the unexported applyModelCapabilities so the doctest harness can exercise image stripping on decoded request bodies.
func Handle ¶ added in v0.0.6
Handle dispatches a llm-proxy CLI invocation to the doc subcommand, the usage summary, the OpenAI/Codex proxies, or a generic --base-url proxy.
func HandleUsages ¶
func ParseModelCapabilities ¶ added in v0.0.10
func ParseModelCapabilities(entries []string) (map[string]ModelCapability, error)
ParseModelCapabilities delegates to the unexported parseModelCapabilities so the doctest harness can exercise --model-capability flag parsing.
func PatchCodexSSEOutput ¶ added in v0.0.6
PatchCodexSSEOutput delegates to the unexported patchCodexSSEOutput so the doctest harness can exercise SSE output-item injection.
func ReadCodexAuth ¶ added in v0.0.6
ReadCodexAuth delegates to the unexported readCodexAuth so the doctest harness can exercise auth.json parsing against temp files.
func StartAPIProxy ¶
func StartCodexProxy ¶
func StartCodexProxy(baseUrl string, modelMappings []string, port string, verbose bool, logFile string, modelCaps map[string]ModelCapability, colorEnabled bool) error
StartCodexProxy starts a Codex OAuth proxy with the default stream behavior.
func TransformCodexRequest ¶ added in v0.0.6
TransformCodexRequest delegates to the unexported transformCodexRequest so the doctest harness can exercise system-message -> instructions adaptation.
Types ¶
type ColorMode ¶ added in v0.0.12
type ColorMode int
ColorMode selects when ANSI color is emitted, per the three-mode policy (auto / always / never). See go-best-practice cli/color.
type ConfigWebGrokDiffResult ¶ added in v0.0.29
type ConfigWebGrokDiffResult struct {
State string
Region string
Hash string
Note string
Preview string
Changes int
}
ConfigWebGrokDiffResult mirrors the Grok read-only comparison for the doctest harness: the located [model.*] run, the export reduced to the same run, and how far apart they are.
func ConfigWebGrokDiff ¶ added in v0.0.29
func ConfigWebGrokDiff(path, preview string) ConfigWebGrokDiffResult
ConfigWebGrokDiff delegates to the same engine the report uses, with the target's path passed in so a leaf never resolves the developer's own ~/.grok/config.toml. The Grok target is compare-only, so nothing here writes.
type ConfigWebSaveResult ¶ added in v0.0.29
ConfigWebSaveResult mirrors the outcome of one block save.
func ConfigWebSaveRegion ¶ added in v0.0.29
func ConfigWebSaveRegion(path, key, preview, hash, region string, dryRun bool) (ConfigWebSaveResult, error)
ConfigWebSaveRegion delegates to the unexported block writer so the doctest harness can exercise the submitted text, conflict detection, locking, and the backup. The target behaves like the DSH one: it participates in the lock.
type ConfigWebSyncDiffResult ¶ added in v0.0.29
type ConfigWebSyncDiffResult struct {
State string
Region string
Hash string
Note string
Preview string
Changes int
Err string
}
ConfigWebSyncDiffResult mirrors the on-disk half of a fragment target for the doctest harness: the located block, its revision, and how far the preview and the file differ.
func ConfigWebSyncDiff ¶ added in v0.0.29
func ConfigWebSyncDiff(path, key, preview string) ConfigWebSyncDiffResult
ConfigWebSyncDiff delegates to the unexported fragment engine so the doctest harness can lock down block location and the preview/disk comparison. It mirrors the report and /api/diff paths without adding behavior.
type ModelCapability ¶ added in v0.0.10
type ModelCapability struct {
// NoImage marks a model that rejects image input upstream (e.g. a
// text-only gateway endpoint answers 404). Image content parts are
// replaced with a text note before the request leaves the proxy.
NoImage bool
// EffortMapping rewrites Anthropic output_config.effort to Command Code
// params.reasoning_effort. Keys are the client-sent effort; values are
// low, high, max, drop (omit the upstream field), or invalid (400 the
// client). A missing key leaves today's behavior (do not send reasoning_effort).
EffortMapping map[string]string
// AdjustUsageForDSH rewrites Command Code Anthropic usage so input_tokens
// is the uncached miss (DSH cache-hit % is cache_read / (input + cache_read)).
AdjustUsageForDSH bool
}
ModelCapability is the per-model limits declared via --model-capability MODEL=opt1,opt2.
Source Files
¶
- api.go
- codex.go
- codex_models.go
- codex_native.go
- color.go
- commandcode.go
- config.go
- config_lint.go
- config_model_listing.go
- config_models.go
- config_web.go
- config_web_catalog.go
- config_web_catalog_http.go
- config_web_catalog_http_generate.go
- config_web_codex_warnings.go
- config_web_credentials.go
- config_web_store.go
- config_web_sync.go
- doc.go
- doctest_seam.go
- grok.go
- grok_cli.go
- model_capability.go
- proxy.go