MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / applyCodexWireAPI

Function applyCodexWireAPI

internal/tools/codex_postwrite.go:30–46  ·  view source on GitHub ↗
(path, endpointName, model string)

Source from the content-addressed store, hash-verified

28}
29
30func applyCodexWireAPI(path, endpointName, model string) error {
31 data, err := readConfigFile(path, "toml")
32 if err != nil {
33 return err
34 }
35 keyPath := "model_providers." + quoteSegmentIfNeeded(endpointName) + ".wire_api"
36 parts, err := editorconfig.Parse(keyPath)
37 if err != nil {
38 return err
39 }
40 if strings.HasPrefix(model, "gpt") {
41 editorconfig.Set(data, parts, "responses")
42 } else {
43 editorconfig.Unset(data, parts)
44 }
45 return writeConfigFile(path, "toml", data)
46}
47
48// quoteSegmentIfNeeded wraps name in TOML quotes when it would not be a
49// bare key (e.g. contains a hyphen or slash).

Callers 3

codexPostWriteFunction · 0.85

Calls 6

ParseFunction · 0.92
SetFunction · 0.92
UnsetFunction · 0.92
readConfigFileFunction · 0.85
quoteSegmentIfNeededFunction · 0.85
writeConfigFileFunction · 0.70