Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions backend/src/services/perplexity.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,18 @@ export class PerplexityService {
*/
async explainMedicalText(medicalText: string): Promise<string> {
const systemPrompt =
'You are an AI assistant that specializes in explaining complex medical information in simple terms. ' +
'Your goal is to help patients understand their medical reports by translating medical jargon into plain language. ' +
'Be accurate, comprehensive, but easy to understand. Use everyday analogies when helpful.';
'You are an AI assistant that specializes in explaining complex medical information in simple terms.\n' +
'Your goal is to help patients understand their medical reports by translating medical jargon into plain language.\n' +
'You must be accurate, concise, comprehensive, and easy to understand. Use everyday analogies when helpful.\n';

const userPrompt = `Please explain the following medical text in simple terms:\n\n${medicalText}`;
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}`;

const messages: PerplexityMessage[] = [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userPrompt },
];

const response = await this.createChatCompletion(messages);
return response.choices[0].message.content;
return response.choices[0].message.content.trim();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
--box-shadow: 0 -0.25rem 1rem rgba(0, 0, 0, 0.1);
--backdrop-opacity: 0.3;
align-items: flex-end;
transition: --height 0.3s ease-out, --max-height 0.3s ease-out;
transition:
--height 0.3s ease-out,
--max-height 0.3s ease-out;

&.expanded {
--height: 85vh;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/common/hooks/useFileUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const useFileUpload = ({
setError(
validation.errorKey
? t(validation.errorKey, validation.params)
: validation.error ?? t('upload.error.unknown'),
: (validation.error ?? t('upload.error.unknown')),
);
return;
}
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/pages/Chat/__tests__/ChatPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ interface MockComponentProps {
vi.mock('@ionic/react', () => {
const createMockComponent =
(name: string) =>
({ className, children, ...props }: MockComponentProps) =>
(
<div data-testid={`mock-${name}`} className={className} {...props}>
{children}
</div>
);
({ className, children, ...props }: MockComponentProps) => (
<div data-testid={`mock-${name}`} className={className} {...props}>
{children}
</div>
);

return {
IonPage: createMockComponent('ion-page'),
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/pages/Processing/ProcessingPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
height: 180px;
border-radius: 50%;
background: radial-gradient(circle at 30% 30%, #4f7dff 10%, #c97eff 40%, #ff8afc 80%);
box-shadow: 0 0 40px rgba(201, 126, 255, 0.5), 0 0 80px rgba(201, 126, 255, 0.3);
box-shadow:
0 0 40px rgba(201, 126, 255, 0.5),
0 0 80px rgba(201, 126, 255, 0.3);
position: relative;
overflow: hidden;
animation: pulse 3s infinite ease-in-out;
Expand Down Expand Up @@ -155,7 +157,9 @@
font-weight: 500;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.2s, color 0.2s;
transition:
background-color 0.2s,
color 0.2s;

&:hover {
background-color: var(--ion-color-primary-tint);
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/pages/Upload/__tests__/UploadPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ vi.mock('common/components/Upload/UploadModal', () => {
labValues: [],
summary: 'Test report summary',
filePath: '/reports/test-report.pdf',
originalFilename: 'test-report.pdf',
fileSize: 1024,
confidence: 0.95,
updatedAt: '2023-01-01',
};

Expand Down