diff --git a/backend/PERPLEXITY_INTEGRATION.md b/backend/PERPLEXITY_INTEGRATION.md index 568c4ac2..fd59da46 100644 --- a/backend/PERPLEXITY_INTEGRATION.md +++ b/backend/PERPLEXITY_INTEGRATION.md @@ -28,7 +28,7 @@ export default () => ({ aws: { // ... existing aws config secretsManager: { - perplexityApiKeySecret: process.env.PERPLEXITY_API_KEY_SECRET_NAME || 'medical-reports-explainer/perplexity-api-key', + perplexityApiKeySecret: process.env.PERPLEXITY_API_KEY_SECRET_NAME || 'med-ai-perplexity-key', }, }, perplexity: { @@ -68,7 +68,7 @@ The `PerplexityController` exposes the following endpoints: 1. Create a secret in AWS Secrets Manager: ``` aws secretsmanager create-secret \ - --name medical-reports-explainer/perplexity-api-key \ + --name med-ai-perplexity-key \ --description "Perplexity API Key for Medical Reports Explainer" \ --secret-string "your-perplexity-api-key" ``` @@ -83,7 +83,7 @@ The `PerplexityController` exposes the following endpoints: "Action": [ "secretsmanager:GetSecretValue" ], - "Resource": "arn:aws:secretsmanager:region:account-id:secret:medical-reports-explainer/perplexity-api-key-*" + "Resource": "arn:aws:secretsmanager:region:account-id:secret:med-ai-perplexity-key-*" } ] } @@ -95,7 +95,7 @@ Configure the following environment variables: | Variable | Description | Default Value | |----------|-------------|---------------| -| `PERPLEXITY_API_KEY_SECRET_NAME` | Name of the secret in AWS Secrets Manager | `medical-reports-explainer/perplexity-api-key` | +| `PERPLEXITY_API_KEY_SECRET_NAME` | Name of the secret in AWS Secrets Manager | `med-ai-perplexity-key` | | `PERPLEXITY_MODEL` | Perplexity model to use | `mixtral-8x7b-instruct` | | `PERPLEXITY_MAX_TOKENS` | Maximum tokens to generate | `2048` | | `AWS_REGION` | AWS region for Secrets Manager | `us-east-1` | diff --git a/backend/src/config/configuration.ts b/backend/src/config/configuration.ts index 357d5ef0..9f6134cb 100644 --- a/backend/src/config/configuration.ts +++ b/backend/src/config/configuration.ts @@ -11,9 +11,7 @@ export default () => ({ clientId: process.env.AWS_COGNITO_CLIENT_ID, }, secretsManager: { - perplexityApiKeySecret: - process.env.PERPLEXITY_API_KEY_SECRET_NAME || - 'medical-reports-explainer/perplexity-api-key', + perplexityApiKeySecret: process.env.PERPLEXITY_API_KEY_SECRET_NAME || 'med-ai-perplexity-key', }, aws: { accessKeyId: process.env.AWS_ACCESS_KEY_ID, diff --git a/backend/src/iac/backend-stack.ts b/backend/src/iac/backend-stack.ts index e28b7688..1e74a657 100644 --- a/backend/src/iac/backend-stack.ts +++ b/backend/src/iac/backend-stack.ts @@ -255,7 +255,7 @@ export class BackendStack extends cdk.Stack { DYNAMODB_REPORTS_TABLE: reportsTable.tableName, // Perplexity related - PERPLEXITY_API_KEY_SECRET_NAME: `medical-reports-explainer/${props.environment}/perplexity-api-key`, + PERPLEXITY_API_KEY_SECRET_NAME: `med-ai-perplexity-key`, PERPLEXITY_MODEL: 'sonar', PERPLEXITY_MAX_TOKENS: '2048', diff --git a/backend/src/services/perplexity.service.ts b/backend/src/services/perplexity.service.ts index ab3751c7..329bec8c 100644 --- a/backend/src/services/perplexity.service.ts +++ b/backend/src/services/perplexity.service.ts @@ -79,9 +79,7 @@ export class PerplexityService { return this.apiKey; } - const secretName = - this.configService.get('aws.secretsManager.perplexityApiKeySecret') || - 'medical-reports-explainer/perplexity-api-key'; + const secretName = this.configService.get('aws.secretsManager.perplexityApiKeySecret'); if (!secretName) { throw new Error('Perplexity API key secret name is not configured');