Skip to content

Commit 57d2d01

Browse files
committed
MErge with main
2 parents 969b4eb + be95062 commit 57d2d01

File tree

134 files changed

+20176
-18699
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+20176
-18699
lines changed

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"plugins": [],
3+
"printWidth": 100,
4+
"semi": true,
5+
"singleQuote": true,
6+
"tabWidth": 2,
7+
"trailingComma": "all"
8+
}

backend/.eslintrc.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
module.exports = {
22
parser: '@typescript-eslint/parser',
33
parserOptions: {
4-
project: 'tsconfig.json',
4+
projectService: true, // Changed from project: 'tsconfig.json'
55
sourceType: 'module',
66
},
77
plugins: ['@typescript-eslint/eslint-plugin', 'prettier'],
8-
extends: [
9-
'plugin:@typescript-eslint/recommended',
10-
'plugin:prettier/recommended',
11-
],
8+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
129
root: true,
1310
env: {
1411
node: true,
@@ -22,4 +19,4 @@ module.exports = {
2219
'@typescript-eslint/explicit-module-boundary-types': 'off',
2320
'@typescript-eslint/no-explicit-any': 'off',
2421
},
25-
};
22+
};

backend/src/services/perplexity.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,18 @@ export class PerplexityService {
154154
*/
155155
async explainMedicalText(medicalText: string): Promise<string> {
156156
const systemPrompt =
157-
'You are an AI assistant that specializes in explaining complex medical information in simple terms. ' +
158-
'Your goal is to help patients understand their medical reports by translating medical jargon into plain language. ' +
159-
'Be accurate, comprehensive, but easy to understand. Use everyday analogies when helpful.';
157+
'You are an AI assistant that specializes in explaining complex medical information in simple terms.\n' +
158+
'Your goal is to help patients understand their medical reports by translating medical jargon into plain language.\n' +
159+
'You must be accurate, concise, comprehensive, and easy to understand. Use everyday analogies when helpful.\n';
160160

161-
const userPrompt = `Please explain the following medical text in simple terms:\n\n${medicalText}`;
161+
const userPrompt = `Please explain the following medical text in simple terms, in a single paragraph that's between 100 to 500 characters:\n\n${medicalText}`;
162162

163163
const messages: PerplexityMessage[] = [
164164
{ role: 'system', content: systemPrompt },
165165
{ role: 'user', content: userPrompt },
166166
];
167167

168168
const response = await this.createChatCompletion(messages);
169-
return response.choices[0].message.content;
169+
return response.choices[0].message.content.trim();
170170
}
171171
}

backend/tsconfig.json

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
"compilerOptions": {
33
"target": "ES2021",
44
"module": "commonjs",
5-
"lib": [
6-
"dom",
7-
"dom.iterable",
8-
"es2020",
9-
"esnext"
10-
],
5+
"lib": ["dom", "dom.iterable", "es2020", "esnext"],
116
"allowJs": true,
127
"skipLibCheck": true,
138
"esModuleInterop": true,
@@ -26,10 +21,7 @@
2621
"inlineSources": true,
2722
"experimentalDecorators": true,
2823
"strictPropertyInitialization": false,
29-
"typeRoots": [
30-
"./node_modules/@types",
31-
"./src/types"
32-
],
24+
"typeRoots": ["./node_modules/@types", "./src/types"],
3325
"moduleResolution": "node",
3426
"resolveJsonModule": true,
3527
"isolatedModules": true,
@@ -43,11 +35,6 @@
4335
"incremental": true,
4436
"strictBindCallApply": true
4537
},
46-
"include": [
47-
"src"
48-
],
49-
"exclude": [
50-
"node_modules",
51-
"cdk.out"
52-
]
38+
"include": ["src"],
39+
"exclude": ["node_modules", "cdk.out"]
5340
}

0 commit comments

Comments
 (0)