MCPcopy
hub / github.com/stephengpope/thepopebot / getCustomProvider

Function getCustomProvider

lib/db/config.js:177–188  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

175 * @returns {{ name: string, baseUrl: string, apiKey: string, models: string[] }|null}
176 */
177export function getCustomProvider(key) {
178 const db = getDb();
179 const row = db
180 .select()
181 .from(settings)
182 .where(and(eq(settings.type, 'llm_provider'), eq(settings.key, key)))
183 .get();
184 if (!row) return null;
185 const config = JSON.parse(decrypt(JSON.parse(row.value)));
186 if (!config.models) config.models = [];
187 return config;
188}
189
190/**
191 * Create or update a custom provider (encrypted JSON).

Callers 3

getConfigFunction · 0.90
buildAgentAuthEnvFunction · 0.90
resolveModelFunction · 0.90

Calls 3

getDbFunction · 0.90
decryptFunction · 0.90
parseMethod · 0.80

Tested by

no test coverage detected