Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 4,638 Bytes
a6bdbe4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
/**
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { useState } from "react";
import "./RolePlayDialogs.css";
import DetailsPopup from "../DetailsPopup/DetailsPopup";
const RolePlayDialogs = ({
selectedPatient,
selectedCondition,
onStart,
onBack,
}) => {
const [isDetailsPopupOpen, setIsDetailsPopupOpen] = useState(false);
return (
<div className="page">
<div className="headerButtonsContainer">
<button className="back-button" onClick={onBack}>
<i className="material-icons back-button-icon">keyboard_arrow_left</i>
Back
</button>
<button className="details-button" onClick={() => setIsDetailsPopupOpen(true)}>
<i className="material-icons code-block-icon">code</i> Details
about this Demo
</button>
</div>
<div className="frame role-play-container">
<div className="title-header">What’s happening in this simulation</div>
<div className="dialogs-container">
<div className="dialog-box">
<div className="dialog-title-text">Pre-visit AI agent</div>
<div className="dialog-subtitle">
Built with: <img src="assets/medgemma.avif" height="16px" />{" "}
27b
</div>
<img
src="assets/ai_headshot.svg"
alt="AI Avatar"
className="ai-avatar"
/>
<div className="dialog-body-scrollable">
In this demo, MedGemma functions as an AI agent designed to assist in pre-visit information
collection. It will interact with the patient agent to gather relevant data.
To provide additional context, MedGemma also has access to information from the patient's EHR (in FHIR format).
However, MedGemma is not provided the specific diagnois ({selectedCondition}).
MedGemma's goal is to gather details about symptoms, relevant history,
and current concerns to generate a comprehensive pre-visit report.
</div>
</div>
<div className="dialog-box">
<div className="dialog-title-text">
Patient persona: {selectedPatient.name}
</div>
<div className="dialog-subtitle">
Simulated by:{" "}Gemini 2.5 Flash
</div>
<img
src={selectedPatient.headshot}
alt="Patient Avatar"
className="patient-avatar"
/>
<div className="dialog-body-scrollable">
Gemini is provided a persona and information to play the role of the patient, {selectedPatient.name}.
In this simulation, the patient agent does not know their diagnosis,
but is experiencing related symptoms and concerns that can be shared during the interview.
To simulate a real-world situation with confounding information, additional information unrelated to the presenting condition has also been provided.
</div>
</div>
</div>
<div className="report-notice">
As the conversation develops, MedGemma <span className="highlight">creates and continually updates
a real-time pre-visit report</span> capturing relevant
information. Following pre-visit report generation, an evaluation is available. The purpose of this evaluation is to provide the viewer insights into quality of the output.
For this evaluation, MedGemma is provided the previously unknown reference diagnosis, and is prompted to generate a
<span className="highlight">self evaluation that highlights strengths as well opporutunities where the conversation and report could have been improved.</span>
</div>
<button className="info-button" onClick={onStart}>
Start conversation
</button>
</div>
<DetailsPopup
isOpen={isDetailsPopupOpen}
onClose={() => setIsDetailsPopupOpen(false)}
/>
</div>
);
};
export default RolePlayDialogs;
|