Documentation
¶
Overview ¶
Package codexcat renders models the way Codex describes them: the entries of its models.json, for `model_catalog_json` and for the model list magpie hands Codex in place of the ChatGPT backend's.
Index ¶
- Variables
- func AutoReview(e map[string]any)
- func CacheEntries() map[string]map[string]any
- func Catalog(ms []catalog.Model) []byte
- func CatalogAt(ms []catalog.Model, effort string) []byte
- func DefaultEffort(e []string) string
- func Entries(ms []catalog.Model, after int) []any
- func Keep(cur, b []byte) []byte
- func MarkedV1(etag string) bool
- func ModelDefault(levels []string, chosen string) string
- func NewSessionEffort() string
- func Order(entries []any, at map[string]int)
- func PolicyTag(tag string) string
- func Remember(entries []any)
- func ServiceTiers(ms []catalog.Model) map[string][]tier
- func Stamp(e map[string]any)
- func Tag(ms []catalog.Model) string
- func Tagged(etag, tag string) bool
- func TakesEffort(ms []catalog.Model, id string) string
- func V1() bool
- func Window(e map[string]any, n, most int)
- func WithTag(etag, tag string) string
Constants ¶
This section is empty.
Variables ¶
var Prompt string
Prompt is Codex's generic system prompt (Apache-2.0, openai/codex, core/gpt-5.2-codex_prompt.md). Third-party models need one because the bundled catalog only carries prompts for OpenAI models.
Functions ¶
func AutoReview ¶ added in v0.1.1062
AutoReview has one of Codex's own entries name the auto-review model the user picked. With none picked, one magpie put there before — a magpie id, which has a "/" where OpenAI's slugs have none, kept in Codex's cache — is taken out, and one OpenAI gave it is left.
func CacheEntries ¶
CacheEntries is Codex's own models, as models_cache.json describes them for the ChatGPT account it last asked with, by slug.
func Catalog ¶
Catalog renders models as a whole models.json, for the effort this machine's Codex starts new sessions at (NewSessionEffort).
func CatalogAt ¶ added in v0.1.1214
CatalogAt renders models as a whole models.json for a Codex that starts new sessions at effort ("" for its models' own defaults): each model's default_reasoning_level is ModelDefault's.
func DefaultEffort ¶
DefaultEffort picks the middle of the road: "medium" or "high" when offered, else whatever the list starts with.
func Entries ¶
Entries renders models as models.json entries, ranked after the first `after`. Only fields Codex requires or that change behaviour are set; the rest take Codex's defaults. A model's default effort is ModelDefault's for the effort this machine's Codex starts new sessions at.
func Keep ¶ added in v0.1.1151
Keep is the catalog b, as Catalog renders it, with what the user added by hand to the entries of cur, the catalog on disk magpie is about to write over: a key of an entry of the same slug that magpie doesn't own, and a true where magpie says false of a keepTrue key — supports_reasoning_ summaries, put in for Codex to send a model's effort and show its thinking (#1450). Another key magpie writes takes magpie's value; the entry of a model magpie no longer serves goes. b as it is when there is nothing to keep, or cur isn't a catalog.
func ModelDefault ¶ added in v0.1.1214
ModelDefault is the default_reasoning_level of a model of these levels with chosen set for new sessions: chosen when the model takes it, else the level of its own nearest chosen (catalog.NearestEffort: by strength, a tie going up — xhigh on a model of high and max is max), the one the gateway would send it at anyway. Codex takes a model's default when it is switched to: the CLI's /model offers it first and saves it as the effort, and the Codex app keeps the current effort only for a model that lists it. With the middle of the road there, a session started at xhigh dropped to medium on a switch to a routing group (Creat.wu on Discord). Nothing chosen, or nothing near it, keeps DefaultEffort.
func NewSessionEffort ¶ added in v0.1.1214
func NewSessionEffort() string
NewSessionEffort is the effort a new Codex session starts at, as the top of this machine's Codex config.toml says it (model_reasoning_effort, magpie's "New sessions" effort, or the one Codex's own picker last saved); "" when it is unset or the config can't be read.
func Order ¶ added in v0.1.952
Order ranks entries — Codex's own, as the backend gives them, and magpie's from Entries — in the order the user put them in (#855): Codex lists its models by priority, lowest first. The ones at names go first, by their place there; the others after them, as they stood. The slice is put in that order too.
func Remember ¶ added in v0.1.715
func Remember(entries []any)
Remember keeps the versions of entries as the backend gave them, before any is stamped: those of slugs it names are replaced, the rest kept.
func ServiceTiers ¶ added in v0.1.1159
ServiceTiers are the service tiers Entries offers Codex on each of ms, by id, where it offers any: what this magpie's list tells another magpie that has it as its provider, so that one's Codex is offered them too (#1234).
func TakesEffort ¶ added in v0.1.1150
TakesEffort is the effort Codex takes for the model id when none is set: the default_reasoning_level of the entry it reads for it. Codex's own model and a ChatGPT account's (codex/) keep their entry from Codex's models_cache.json, so it is that entry's (gpt-6.1-sol: low); one of magpie's other models takes the one Entries writes. "" when the model has no levels, or Codex's entry names none.
func V1 ¶ added in v0.1.715
func V1() bool
V1 reports whether the OpenAI models magpie hands Codex say "v1".
func Window ¶ added in v0.1.757
Window has one of Codex's own entries say a context window of n tokens (none: as it says), and most at the most it may be raised to (0: as it says). Only those two fields change. An entry whose max_context_window is below its window — one the user set past what OpenAI lists — would say two things at once, and Codex may hold the window to the max, so the max is raised to it.
Types ¶
This section is empty.