Skip to content

Commit 26af3f2

Browse files
committed
fix: add also a check on bedrock credentials
1 parent b8198e1 commit 26af3f2

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

services/libs/common_services/src/services/llm.service.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ export class LlmService extends LoggerBase {
3636
) {
3737
super(parentLog)
3838

39+
if (!bedrockCredentials.accessKeyId || !bedrockCredentials.secretAccessKey) {
40+
this.log.warn('LLM usage is not configured properly. Missing Bedrock credentials!')
41+
}
42+
3943
this.qx = qx
4044
this.clientRegionMap = new Map()
4145
}
@@ -67,7 +71,11 @@ export class LlmService extends LoggerBase {
6771
metadata?: Record<string, unknown>,
6872
saveHistory = true,
6973
): Promise<ILlmResponse> {
70-
if (!IS_LLM_ENABLED) {
74+
if (
75+
!IS_LLM_ENABLED ||
76+
!this.bedrockCredentials.accessKeyId ||
77+
!this.bedrockCredentials.secretAccessKey
78+
) {
7179
this.log.error('LLM usage is disabled. Check CROWD_LLM_ENABLED env variable!')
7280
return
7381
}

0 commit comments

Comments
 (0)