checkExistApiConfig.ts 588 B

1234567891011121314151617181920212223
  1. import { ApiConfiguration } from "../shared/api"
  2. export function checkExistKey(config: ApiConfiguration | undefined) {
  3. return config
  4. ? [
  5. config.apiKey,
  6. config.glamaApiKey,
  7. config.openRouterApiKey,
  8. config.awsRegion,
  9. config.vertexProjectId,
  10. config.openAiApiKey,
  11. config.ollamaModelId,
  12. config.lmStudioModelId,
  13. config.geminiApiKey,
  14. config.openAiNativeApiKey,
  15. config.deepSeekApiKey,
  16. config.mistralApiKey,
  17. config.vsCodeLmModelSelector,
  18. config.requestyApiKey,
  19. config.unboundApiKey,
  20. ].some((key) => key !== undefined)
  21. : false
  22. }