MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / resolveGatewayConfig

Function resolveGatewayConfig

tools/model-gateway/server.mjs:7–26  ·  view source on GitHub ↗
(overrides = {})

Source from the content-addressed store, hash-verified

5import { fileURLToPath } from 'url'
6
7export function resolveGatewayConfig(overrides = {}) {
8 return {
9 host: overrides.host || process.env.GATEWAY_HOST || '127.0.0.1',
10 port: Number.parseInt(
11 String(overrides.port || process.env.GATEWAY_PORT || '8787'),
12 10,
13 ),
14 upstreamBaseUrl:
15 overrides.upstreamBaseUrl || process.env.OPENAI_COMPAT_BASE_URL || '',
16 upstreamApiKey:
17 overrides.upstreamApiKey || process.env.OPENAI_COMPAT_API_KEY || '',
18 upstreamModel: overrides.upstreamModel || process.env.OPENAI_COMPAT_MODEL || '',
19 upstreamChatPath:
20 overrides.upstreamChatPath ||
21 process.env.OPENAI_COMPAT_CHAT_PATH ||
22 '/chat/completions',
23 textMode:
24 overrides.textMode || process.env.UPSTREAM_TEXT_MODE || 'openai',
25 }
26}
27
28// ── Soul injection ──────────────────────────────────────
29// Reads .claw/bootstrap/*.md from the workspace directory and caches the result.

Callers 1

startGatewayServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected