Skip to content

Commit 2759030

Browse files
committed
Fix f-string formatting error in disease_qa_tutorial example
1 parent 9cff0f5 commit 2759030

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

disease_qa_tutorial.ipynb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@
9999
"metadata": {},
100100
"outputs": [],
101101
"source": [
102-
"# Step 3: Create the API Query Function\n",
103-
"\n",
104-
"def ask_disease_question(question):\n",
102+
"# Step 3: Create the API Query Functiondef ask_disease_question(question):\n",
105103
" \"\"\"\n",
106104
" Send a disease-related question to the Perplexity API and parse the response.\n",
107105
" \n",
@@ -115,12 +113,12 @@
115113
"You are a medical assistant. Please answer the following question about a disease and provide only valid JSON output.\n",
116114
"The JSON object must have exactly four keys: \"overview\", \"causes\", \"treatments\", and \"citations\".\n",
117115
"For example:\n",
118-
"{\n",
116+
"{{\n",
119117
" \"overview\": \"A brief description of the disease.\",\n",
120118
" \"causes\": \"The causes of the disease.\",\n",
121119
" \"treatments\": \"Possible treatments for the disease.\",\n",
122120
" \"citations\": [\"https://example.com/citation1\", \"https://example.com/citation2\"]\n",
123-
"}\n",
121+
"}}\n",
124122
"Now answer this question:\n",
125123
"\"{question}\"\n",
126124
" \"\"\".strip()\n",
@@ -156,9 +154,7 @@
156154
"\n",
157155
" except Exception as e:\n",
158156
" print(f\"Error: {e}\")\n",
159-
" return None\n",
160-
"\n",
161-
"print('ask_disease_question function defined.')"
157+
" return None"
162158
]
163159
},
164160
{

0 commit comments

Comments
 (0)