Pythia offers multiple API calls to obtain information about LLM responses. Each API endpoint has a unique purpose and yields relevant output as shown in the examples.
ask_pythia Prompt Examples
Example 1
reference = ["2-D ECHOCARDIOGRAM,Multiple views of the heart and great vessels reveal normal intracardiac and great vessel relationships. Cardiac function is normal. There is no significant chamber enlargement or hypertrophy. There is no pericardial effusion or vegetations seen. Doppler interrogation, including color flow imaging, reveals systemic venous return to the right atrium with normal tricuspid inflow. Pulmonary outflow is normal at the valve. Pulmonary venous return is to the left atrium. The interatrial septum is intact. Mitral inflow and ascending aorta flow are normal. The aortic valve is trileaflet. The coronary arteries appear to be normal in their origins. The aortic arch is left-sided and patent with normal descending aorta pulsatility."]
response = "65 year old female presented with pT3 pN1a moderately differentiated adenocarcinoma of rectum on 9/15/2021."
question = "What was theTNM stage of the cancer?"
Output
Example 2
reference = ["HISTORY OF PRESENT ILLNESS:, The patient is an 85-year-old gentleman who follows as an outpatient with Dr. A. He is known to us from his last admission. At that time, he was admitted with a difficulty voiding and constipation. His urine cultures ended up being negative. He was seen by Dr. B and discharged home on Levaquin for five days.,He presents to the ER today with hematuria that began while he was sleeping last night. He denies any pain, nausea, vomiting or diarrhea. In the ER, a Foley catheter was placed and was irrigated with saline. White count was 7.6, H and H are 10.8 and 38.7, and BUN and creatinine are of 27 and 1.9. Urine culture is pending. Chest x-ray is pending. His UA did show lots of red cells. The patient currently is comfortable. CBI is running. His urine is clear.,PAST MEDICAL HISTORY:,1. Hypertension.,2. High cholesterol.,3. Bladder cancer.,4. Bilateral total knee replacements.,5. Cataracts.,6. Enlarged prostate.,ALLERGIES:, SULFA.,MEDICATIONS AT HOME:,1. Atenolol.,2. Cardura.,3. Zegerid.,4. Flomax.,5. Levaquin.,6. Proscar.,7. Vicodin.,8. Morphine.,9. Phenergan.,10. Ativan.,11. Zocor.,12. Prinivil.,13. Hydrochlorothiazide.,14. Folic acid.,15. Digoxin.,16. Vitamin B12.,17. Multivitamin.,SOCIAL HISTORY: , The patient lives at home with his daughter. He does not smoke, occasionally drinks alcohol. He is independent with his activities of daily living.,REVIEW OF SYSTEMS:, Not additionally rewarding.,PHYSICAL EXAMINATION:,GENERAL: An awake and alert 85-year-old gentleman who is afebrile.,VITAL SIGNS: BP of 162/60 and pulse oximetry of 98% on room air.,HEENT: Pink conjunctivae. Anicteric sclerae. Oral mucosa is moist.,NECK: Supple.,CHEST: Clear to auscultation.,HEART: Regular S1 and S2.,ABDOMEN: Soft and nontender to palpation.,EXTREMITIES: Without edema.,He has a Foley catheter in place. His urine is clear.,LABORATORY DATA:, Reviewed.,IMPRESSION:,1. Hematuria."]
response = "Presents to the ER with hematuria that began while sleeping last night. He denies any pain, nausea, vomiting or diarrhea."
question = "Incision and drainage of the penoscrotal abscess, packing, penile biopsy, cystoscopy, and urethral dilation?"
Output
Example 3
reference = ["CHIEF COMPLAINT: , Left flank pain and unable to urinate.,HISTORY: , The patient is a 46-year-old female who presented to the emergency room with left flank pain and difficulty urinating. Details are in the history and physical. She does have a vague history of a bruised left kidney in a motor vehicle accident. She feels much better today. I was consulted by Dr. X.,MEDICATIONS:, Ritalin 50 a day.,ALLERGIES: , To penicillin.,PAST MEDICAL HISTORY: , ADHD.,SOCIAL HISTORY:, No smoking, alcohol, or drug abuse.,PHYSICAL EXAMINATION: , She is awake, alert, and quite comfortable. Abdomen is benign. She points to her left flank, where she was feeling the pain.,DIAGNOSTIC DATA: , Her CAT scan showed a focal ileus in left upper quadrant, but no thickening, no obstruction, no free air, normal appendix, and no kidney stones.,LABORATORY WORK: , Showed white count 6200, hematocrit 44.7. Liver function tests and amylase were normal. Urinalysis 3+ bacteria.,IMPRESSION:,1. Left flank pain, question etiology.,2. No evidence of surgical pathology.,3. Rule out urinary tract infection.,PLAN:,1. No further intervention from my point of view.,2. Agree with discharge and followup as an outpatient. Further intervention will depend on how she does clinically. She fully understood and agreed.","REASON FOR CONSULTATION: , Left flank pain, ureteral stone.,BRIEF HISTORY: , The patient is a 76-year-old female who was referred to us from Dr. X for left flank pain. The patient was found to have a left ureteral stone measuring about 1.3 cm in size per the patient's history. The patient has had pain in the abdomen and across the back for the last four to five days. The patient has some nausea and vomiting. The patient wants something done for the stone. The patient denies any hematuria, dysuria, burning or pain. The patient denies any fevers.,PAST MEDICAL HISTORY: , Negative.,PAST SURGICAL HISTORY: ,Years ago she had surgery that she does not recall.,MEDICATIONS: , None.,ALLERGIES: , None.,REVIEW OF SYSTEMS: , Denies any seizure disorder, chest pain, denies any shortness of breath, denies any dysuria, burning or pain, denies any nausea or vomiting at this time. The patient does have a history of nausea and vomiting, but is doing better.,PHYSICAL EXAMINATION:,VITAL SIGNS: The patient is afebrile. Vitals are stable.,HEART: Regular rate and rhythm.,ABDOMEN: Soft, left-sided flank pain and left lower abdominal pain.,The rest of the exam is benign.,LABORATORY DATA: , White count of 7.8, hemoglobin 13.8, and platelets 234,000. The patient's creatinine is 0.92.,ASSESSMENT:,1. Left flank pain.,2. Left ureteral stone.,3. Nausea and vomiting.,PLAN: , Plan for laser lithotripsy tomorrow. Options such as watchful waiting, laser lithotripsy, and shockwave lithotripsy were discussed. The patient has a pretty enlarged stone. Failure of the procedure if the stone is significantly impacted into the ureteral wall was discussed. The patient understood that the success of the surgery may be or may not be 100%, that she may require shockwave lithotripsy if we are unable to get the entire stone out in one sitting. The patient understood all the risk, benefits of the procedure and wanted to proceed. Need for stent was also discussed with the patient. The patient will be scheduled for surgery tomorrow. Plan for continuation of the antibiotics, obtain urinalysis and culture, and plan for KUB to evaluate for the exact location of the stone prior to surgery tomorrow."]
response = "Left flank pain, ureteral stone."
question = " Cystoscopy, TUR, and electrofulguration of recurrent bladder tumors.?"
Output
qa Endpoint Prompt Example
question = "Is the protein Papilin secreted?"
client.qa(question)
Output
.question Prompt Example
client.documents(question)
Output
.search_text Prompt Example
client.search_text("diabetes")
Output
.advance_search Example
client.advance_search("%0A%20PREFIX%20rdfs:%20%3Chttp://www.w3.org/2000/01/rdf-schema#%3E%20%0A%20SELECT%20DISTINCT%20?this%20?this_label%20WHERE%20%7B%0A%20%20?this%20%3Chttp://www.wikidata.org/prop/direct/P31%3E%20%3Chttp://www.wikidata.org/entity/Q28885102%3E.%0A%20%20?this%20%3Chttp://www.wikidata.org/prop/direct/P176%3E%20%3Chttp://www.wikidata.org/entity/Q206921%3E.%0A%20%20?this%20%3Chttp://www.w3.org/2000/01/rdf-schema#label%3E%20?this_label.%0A%20%20FILTER(LANGMATCHES(LANG(?this_label),%20%22en%22))%0A%7D%0ALIMIT%2010")
Output
.get_predicates Example
client.get_predicates("encodes")
Output
.execute_vector_function Example
graphIds = [
"Q84263196",
"Q12078"
]
client.execute_vector_function(graphIds)
Output
.execute_score_function Example
triples = [
[
"Q14865565",
"P2293",
"Q3658562"
],
[
"Q14865565",
"P2293",
"Q282142"
],
[
"Q14865565",
"P2293",
"Q264118"
]
]
client.execute_score_function(triples)
Output
.get_admet_predictions Example
selected_model = WisecubeModel.CACO2
smiles = [
"O1COc(c12)ccc(c2)NC(=O)C(=O)NCCc(c3)ccc(c34)N(C)CCC4",
"C1COc(c12)cc(Br)c(c2)NC(=O)C(=O)NCc(c3)ccc(c34)N(C)CC(C4)CO"
]
client.get_admet_predictions(smiles=smiles, model=selected_model)
Output
.nl_to_sparql Example
client.nl_to_sparql(question)