MCPcopy Create free account
hub / github.com/github/gh-aw / extractOpenAIProxyBaseURLFromToml

Function extractOpenAIProxyBaseURLFromToml

actions/setup/js/codex_harness.cjs:279–285  ·  view source on GitHub ↗

* Read Codex openai-proxy base_url from config.toml content. * @param {string} tomlContent * @returns {string|null}

(tomlContent)

Source from the content-addressed store, hash-verified

277 * @returns {string|null}
278 */
279function extractOpenAIProxyBaseURLFromToml(tomlContent) {
280 if (!tomlContent || typeof tomlContent !== "string") return null;
281 const providerSection = tomlContent.match(/\[model_providers\.openai-proxy\]([\s\S]*?)(?:\n\[|$)/);
282 if (!providerSection) return null;
283 const baseURLMatch = providerSection[1].match(/(?:^|\n)\s*base_url\s*=\s*"([^"]+)"/);
284 return baseURLMatch && baseURLMatch[1] ? baseURLMatch[1].trim() : null;
285}
286
287/**
288 * Determine configured OpenAI endpoint port from AWF /reflect payload.

Calls

no outgoing calls

Tested by

no test coverage detected