chore: cleanup and format and small refactor
This commit is contained in:
@@ -497,9 +497,13 @@ function getParametersForRole(role, explicitRoot = null) {
|
|||||||
function isApiKeySet(providerName, session = null, projectRoot = null) {
|
function isApiKeySet(providerName, session = null, projectRoot = null) {
|
||||||
// Define the expected environment variable name for each provider
|
// Define the expected environment variable name for each provider
|
||||||
|
|
||||||
const okKeys = ['ollama', 'bedrock'];
|
// Providers that don't require API keys for authentication
|
||||||
|
const providersWithoutApiKeys = [
|
||||||
|
CUSTOM_PROVIDERS.OLLAMA,
|
||||||
|
CUSTOM_PROVIDERS.BEDROCK
|
||||||
|
];
|
||||||
|
|
||||||
if (okKeys.includes(providerName?.toLowerCase())) {
|
if (providersWithoutApiKeys.includes(providerName?.toLowerCase())) {
|
||||||
return true; // Indicate key status is effectively "OK"
|
return true; // Indicate key status is effectively "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export class BedrockAIProvider extends BaseAIProvider {
|
|||||||
const credentialProvider = fromNodeProviderChain();
|
const credentialProvider = fromNodeProviderChain();
|
||||||
|
|
||||||
return createAmazonBedrock({
|
return createAmazonBedrock({
|
||||||
credentialProvider,
|
credentialProvider
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.handleError('client initialization', error);
|
this.handleError('client initialization', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user