MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / resolveApiKey

Function resolveApiKey

packages/config/src/auth-profiles.ts:75–81  ·  view source on GitHub ↗
(provider: string, authProfile?: string)

Source from the content-addressed store, hash-verified

73 * 查找 API Key:先按 authProfile 精确匹配,再按 provider 兜底
74 */
75export function resolveApiKey(provider: string, authProfile?: string): string {
76 if (authProfile) {
77 const key = getApiKeyByProfile(authProfile)
78 if (key) return key
79 }
80 return getApiKeyByProvider(provider)
81}
82
83/**
84 * 写入/更新一个 auth profile

Callers 6

startInternalServerFunction · 0.90
loadConfigStoreFunction · 0.90
startHttpServerFunction · 0.90
loadLlmConfigFunction · 0.90
toLlmConfigDisplayFunction · 0.85

Calls 2

getApiKeyByProfileFunction · 0.85
getApiKeyByProviderFunction · 0.85

Tested by

no test coverage detected