RichardZhu52 commited on
Commit
6bf89d5
·
1 Parent(s): e4f421b
Files changed (5) hide show
  1. app.py +79 -45
  2. fda_drug_labeling_tools.json +0 -0
  3. monarch_tools.json +112 -0
  4. opentarget_tools.json +2166 -0
  5. utils.py +10 -15
app.py CHANGED
@@ -6,41 +6,77 @@ import json
6
  from utils import format_chat, append_to_sheet, read_sheet_to_df
7
  import random
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  # Define the six evaluation criteria as a list of dictionaries.
10
  criteria = [
11
  {
12
  "label": "Problem Resolution",
13
  "text": (
14
  "Problem Resolution: Did the model effectively solve the problem?",
15
- "1️⃣ Did Not Solve the Problem at All<br>2️⃣ Attempted to Solve but Largely Incorrect or Incomplete<br>3️⃣ Partially Solved the Problem, but with Limitations<br>4️⃣ Mostly Solved the Problem, with Minor Issues<br>5️⃣ Completely and Effectively Solved the Problem"
16
  )
17
  },
18
  {
19
  "label": "Helpfulness",
20
  "text": (
21
  "Helpfulness: Was the answer and reasoning provided helpful in addressing the question?",
22
- "1️⃣ Not Helpful at All<br>2️⃣ Slightly Helpful, but Largely Insufficient<br>3️⃣ Moderately Helpful, but Needs Improvement<br>4️⃣ Helpful and Mostly Clear, with Minor Issues<br>5️⃣ Extremely Helpful and Comprehensive"
23
  )
24
  },
25
  {
26
  "label": "Scientific Consensus",
27
  "text": (
28
- "Scientific and Clinical Consensus: Does the answer align with established scientific and clinical consensus?",
29
- "1️⃣ Completely Misaligned with Scientific Consensus<br>2️⃣ Partially Aligned but Contains Significant Inaccuracies or Misinterpretations<br>3️⃣ Generally Aligned but Lacks Strong Scientific Rigor or Clarity<br>4️⃣ Mostly Aligned with Scientific Consensus, with Minor Omissions or Uncertainties<br>5️⃣ Fully Aligned with Established Scientific and Clinical Consensus"
30
  )
31
  },
32
  {
33
  "label": "Accuracy",
34
  "text": (
35
  "Accuracy of Content: Is there any incorrect or irrelevant content in the answer and the reasoning content?",
36
- "1️⃣ Completely Inaccurate or Irrelevant<br>2️⃣ Mostly Inaccurate, with Some Relevant Elements<br>3️⃣ Partially Accurate, but Includes Some Errors or Omissions<br>4️⃣ Mostly Accurate, with Minor Issues or Unverified Claims<br>5️⃣ Completely Accurate and Relevant"
37
  )
38
  },
39
  {
40
  "label": "Completeness",
41
  "text": (
42
  "Completeness: Did the answer omit any essential content necessary for a comprehensive response?",
43
- "1️⃣ Severely Incomplete – Major Content Omissions<br>2️⃣ Largely Incomplete – Missing Key Elements<br>3️⃣ Somewhat Complete – Covers Basics but Lacks Depth<br>4️⃣ Mostly Complete – Minor Omissions or Gaps<br>5️⃣ Fully Complete – No Important Omissions"
44
  )
45
  },
46
  ]
@@ -133,7 +169,7 @@ def get_evaluator_questions(email, disease_map_data, user_all_specs, all_files,
133
 
134
  # Handle case where no relevant questions are found based on specialty
135
  if not evaluator_question_ids:
136
- return gr.update(visible=True), gr.update(visible=False), None, "No questions found matching your selected specialties. Please adjust your selections or contact the study administrator.", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.State(),gr.update(visible=False),""
137
 
138
  #FINALLY, MAKE SURE THEY DIDNT ALREADY FILL IT OUT. Must go through every tuple of (question_ID, TxAgent, other model) where other model could be any of the other files in data_by_filename
139
  model_names = [key for key in data_by_filename.keys() if key != 'txagent']
@@ -148,8 +184,6 @@ def get_evaluator_questions(email, disease_map_data, user_all_specs, all_files,
148
  # collect all (question_ID, other_model) pairs already seen
149
  matched_pairs = set()
150
  for _, row in results_df.iterrows():
151
- # Only consider rows submitted by the current evaluator
152
- print(f"Evaluator ID: {row['Email']}")
153
  if row["Email"] == email:
154
  q = row["Question ID"]
155
  # pick whichever response isn’t 'txagent'
@@ -174,11 +208,11 @@ def get_evaluator_questions(email, disease_map_data, user_all_specs, all_files,
174
  def go_to_page0_from_minus1():
175
  return gr.update(visible=False), gr.update(visible=True)
176
 
177
- def go_to_eval_progress_modal(name, email, specialty_dd, subspecialty_dd, years_exp_radio, exp_explanation_tb):
178
 
179
  # ADDED: Validate that name and email are non-empty before proceeding
180
- if not name or not email:
181
- return gr.update(visible=True), gr.update(visible=False), None, "Please fill out all the fields.", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.State(),gr.update(visible=False), ""
182
 
183
  # Combine user's selected specialties and subspecialties into a set for efficient lookup
184
  # Ensure inputs are lists, even if None or single strings are passed (though Dropdown with multiselect=True should return lists)
@@ -209,7 +243,7 @@ def go_to_eval_progress_modal(name, email, specialty_dd, subspecialty_dd, years_
209
  full_question_ids_list, data_by_filename = get_evaluator_questions(email, disease_map_data, user_all_specs, all_files, evaluator_directory)
210
 
211
  if len(full_question_ids_list) == 0:
212
- return gr.update(visible=True), gr.update(visible=False), None, "Based on your Evaluator ID, you have evaluated all questions assigned to you. You may exit the page; we will follow-up if we require anything else from you. Thank you!", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.State(),gr.update(visible=False),""
213
 
214
  full_question_ids_list = sorted(full_question_ids_list, key=lambda x: str(x[0])+str(x[1]))
215
  #selected question is the first element
@@ -244,9 +278,9 @@ def go_to_eval_progress_modal(name, email, specialty_dd, subspecialty_dd, years_
244
  }
245
 
246
  #update user_info
247
- user_info = (name, email, specialty_dd, subspecialty_dd, years_exp_radio, exp_explanation_tb, q_id)
248
- chat_A_value = format_chat(question_for_eval['models'][0]['reasoning_trace'])
249
- chat_B_value = format_chat(question_for_eval['models'][1]['reasoning_trace'])
250
  prompt_text = question_for_eval['question']
251
 
252
  # Construct the question-specific elements of the pairwise rating page (page 1)
@@ -273,7 +307,7 @@ def go_to_eval_progress_modal(name, email, specialty_dd, subspecialty_dd, years_
273
  avatar_images=None, # Optional: omit user/assistant icons
274
  rtl=False
275
  )
276
- return gr.update(visible=True), gr.update(visible=False), user_info,"", chat_a, chat_b, page1_prompt, question_for_eval, gr.update(visible=True), f"You have {len(full_question_ids_list)} question(s) remaining to evaluate."
277
 
278
  #goes to page 1 from confirmation modal that tells users how many questions they have left to evaluate
279
  def go_to_page1():
@@ -303,8 +337,8 @@ def go_to_page2(data_subset_state,*pairwise_values):
303
  if any(answer is None for answer in pairwise_list):
304
  return gr.update(visible=True), gr.update(visible=False), None, None, "Error: Please select an option for every pairwise comparison.", gr.Chatbot(), gr.Chatbot(), gr.HTML(), *pairwise_results_for_display
305
 
306
- chat_A_value = format_chat(data_subset_state['models'][0]['reasoning_trace'])
307
- chat_B_value = format_chat(data_subset_state['models'][1]['reasoning_trace'])
308
  prompt_text = data_subset_state['question']
309
 
310
  # Construct the question-specific elements of the rating page (page 2)
@@ -382,7 +416,7 @@ centered_col_css = """
382
  #centered-column {
383
  margin-left: auto;
384
  margin-right: auto;
385
- max-width: 650px; /* Adjust this width as desired */
386
  width: 100%;
387
  }
388
  """
@@ -413,13 +447,20 @@ with gr.Blocks(css=centered_col_css) as demo:
413
  print(f"Error: Could not parse JSON from specialty files.")
414
  specialties_list = ["Error parsing specialties"]
415
  subspecialties_list = ["Error parsing subspecialties"]
416
-
417
  # Page -1: Page to link them to question submission form or evaluation portal
418
  with gr.Column(visible=True, elem_id="page-1") as page_minus1:
419
  gr.HTML("""
420
  <div>
421
  <h1>TxAgent Evaluation Portal</h1>
422
  <p>Welcome to the TxAgent Evaluation Portal.</p>
 
 
 
 
 
 
 
423
  <p><strong>About TxAgent:</strong> TxAgent is a first-of-its-kind AI model developed in the Zitnik Lab at Harvard Medical School. It leverages multi-step reasoning and real-time biomedical knowledge retrieval from a toolbox of 211 tools to analyze drug interactions, contraindications, and patient-specific treatment strategies. It is designed to provide personalized treatment recommendations across a wide range of diseases, including rare diseases.</p>
424
  <p>TxAgent evaluates how drugs interact at molecular, pharmacokinetic, and clinical levels, identifies contraindications based on patient comorbidities and concurrent medications, and tailors treatment strategies to individual patient characteristics, including age, genetic factors, and disease progression. It achieves 92.1% accuracy in open-ended drug reasoning tasks, surpassing GPT-4o by up to 25.8% and outperforming DeepSeek-R1 (671B) in structured multi-step reasoning.</p>
425
  <p>TxAgent's toolbox, ToolUniverse, consolidates 211 tools from trusted sources, including all US FDA-approved drugs since 1939 and validated clinical insights from Open Targets. By integrating multi-step inference, real-time knowledge grounding, and tool-assisted decision-making, TxAgent ensures that treatment recommendations align with established clinical guidelines and real-world evidence, reducing the risk of adverse events and improving therapeutic decision-making.</p>
@@ -432,9 +473,6 @@ with gr.Blocks(css=centered_col_css) as demo:
432
  <p>Your contribution is invaluable to us. Thank you for your time and expertise!</p>
433
  </div>
434
  """)
435
- with gr.Row():
436
- submit_questions_btn = gr.Button("Submit Questions for TxAgent Evaluation")
437
- participate_eval_btn = gr.Button("Participate in TxAgent Evaluation")
438
 
439
  # Define actions for the new buttons
440
  # For the Google Form button, we'll use JavaScript to open a new tab.
@@ -464,13 +502,14 @@ with gr.Blocks(css=centered_col_css) as demo:
464
  By clicking 'Next' below, you will start the study, with your progress saved after submitting each question. If you have any other questions or concerns, please contact us directly. Thank you for your participation!
465
  """)
466
  gr.Markdown("## Please enter your information to get a question to evaluate. Please use the same email every time you log onto this evaluation portal, as we use your email to prevent showing repeat questions.")
467
- name = gr.Textbox(label="Name")
468
- email = gr.Textbox(label="Email. Please use the same email every time you log onto this evaluation portal, as we use your email to prevent showing repeat questions.")
469
- specialty_dd = gr.Dropdown(choices=specialties_list, label="Primary Medical Specialty (if applicable, select one). Go to https://www.abms.org/member-boards/specialty-subspecialty-certificates/ for categorization)", multiselect=True)
470
- subspecialty_dd = gr.Dropdown(choices=subspecialties_list, label="Subspecialty (if applicable, select one). Go to https://www.abms.org/member-boards/specialty-subspecialty-certificates/ for categorization)", multiselect=True)
 
471
  years_exp_radio = gr.Radio(
472
  choices=["0-2 years", "3-5 years", "6-10 years", "11-20 years", "20+ years", "Not Applicable"],
473
- label="How many years have you been involved in clinical and/or research activities related to your biomedical area of expertise?"
474
  )
475
  exp_explanation_tb = gr.Textbox(label="Please briefly explain your expertise/experience relevant to evaluating AI for clinical decision support (optional)")
476
 
@@ -545,8 +584,7 @@ with gr.Blocks(css=centered_col_css) as demo:
545
  next_btn_1 = gr.Button("Next: Rate Responses")
546
 
547
  with gr.Row():
548
- home_btn_1 = gr.Button("Home Page (your progress on this question will be saved but not submitted)") # ADDED: Home button on page1
549
- instructions_btn_1 = gr.Button("Instructions Page (your progress on this question will be saved but not submitted)") # ADDED: FAQ button on page1
550
 
551
  # Page 2: Combined Rating Page for both responses.
552
  with gr.Column(visible=False) as page2:
@@ -683,7 +721,7 @@ with gr.Blocks(css=centered_col_css) as demo:
683
  label=f"Score for Response B - {crit['label']}",
684
  interactive=True)
685
  with gr.Row():
686
- clear_btn = gr.Button("Clear Selection")
687
  clear_btn.click(fn=clear_selection, outputs=[rating_a,rating_b])
688
 
689
  # wire each to re‐restrict the other on change
@@ -701,12 +739,10 @@ with gr.Blocks(css=centered_col_css) as demo:
701
  ratings_B.append(rating_b)
702
  with gr.Row():
703
  back_btn_2 = gr.Button("Back")
704
- instructions_btn_2 = gr.Button("Instructions Page (your progress on this question will be saved but not submitted)") # ADDED: FAQ button on page1
705
  submit_btn = gr.Button("Submit (Note: Once submitted, you cannot edit your responses)", elem_id="submit_btn")
706
 
707
  with gr.Row():
708
  home_btn_2 = gr.Button("Home Page (your progress on this question will be saved but not submitted)")
709
- instructions_btn_2 = gr.Button("Instructions Page (your progress on this question will be saved but not submitted)") # ADDED: FAQ button on page1
710
 
711
  result_text = gr.Textbox(label="Validation Result")
712
 
@@ -748,7 +784,8 @@ with gr.Blocks(css=centered_col_css) as demo:
748
  "Subspecialty": str(user_info[3]),
749
  "Years of Experience": user_info[4],
750
  "Experience Explanation": user_info[5],
751
- "Question ID": user_info[6],
 
752
  "Prompt": prompt_text,
753
  "ResponseA_Model": response_A_model,
754
  "ResponseB_Model": response_B_model,
@@ -785,7 +822,7 @@ with gr.Blocks(css=centered_col_css) as demo:
785
  disease_specialty_map = hf_hub_download(repo_id=REPO_ID, filename=DISEASE_SPECIALTY_MAP_FILENAME, repo_type="dataset", revision="main")
786
  with open(disease_specialty_map, 'r') as f: disease_map_data = json.load(f)
787
 
788
- _, email, specialty, subspecialty, _, _, _ = user_info
789
  user_specialties = set(specialty if isinstance(specialty, list) else ([specialty] if specialty else []))
790
  user_subspecialties = set(subspecialty if isinstance(subspecialty, list) else ([subspecialty] if subspecialty else []))
791
  user_all_specs = user_specialties.union(user_subspecialties)
@@ -842,8 +879,8 @@ with gr.Blocks(css=centered_col_css) as demo:
842
  "models": models_list,
843
  }
844
 
845
- chat_A_value = format_chat(question_for_eval['models'][0]['reasoning_trace'])
846
- chat_B_value = format_chat(question_for_eval['models'][1]['reasoning_trace'])
847
  prompt_text = question_for_eval['question']
848
 
849
  # Construct the question-specific elements of the pairwise rating page (page 1)
@@ -877,7 +914,7 @@ with gr.Blocks(css=centered_col_css) as demo:
877
  gr.update(visible=False), # page2 (Hide)
878
  gr.update(visible=False), # confirm_modal (Hide)
879
  gr.update(visible=True), # eval_progress_modal (Show)
880
- f"Submission successful! You have {remaining_count} question(s) remaining to evaluate. You may exit the page and return later if you wish.", # eval_progress_text
881
  gr.update(visible=False), # final_page (Hide)
882
  "",
883
  chat_a,
@@ -962,7 +999,7 @@ with gr.Blocks(css=centered_col_css) as demo:
962
  # Transition from Page 0 (Welcome) to Page 1.
963
  next_btn_0.click(
964
  fn=go_to_eval_progress_modal,
965
- inputs=[name, email, specialty_dd, subspecialty_dd, years_exp_radio, exp_explanation_tb],
966
  outputs=[page0, page1, user_info_state, page0_error_box, chat_a, chat_b, page1_prompt, data_subset_state,eval_progress_modal,eval_progress_text],
967
  scroll_to_output=True
968
  )
@@ -978,10 +1015,6 @@ with gr.Blocks(css=centered_col_css) as demo:
978
  home_btn_0.click(lambda: (gr.update(visible=True), gr.update(visible=False)), None, [page_minus1, page0])
979
  home_btn_1.click(lambda: (gr.update(visible=True), gr.update(visible=False)), None, [page_minus1, page1])
980
  home_btn_2.click(lambda: (gr.update(visible=True), gr.update(visible=False)), None, [page_minus1, page2])
981
-
982
- # FAQ buttons simply bring back to page0
983
- instructions_btn_1.click(lambda: (gr.update(visible=True), gr.update(visible=False)), None, [page0, page1])
984
- instructions_btn_2.click(lambda: (gr.update(visible=True), gr.update(visible=False)), None, [page0, page2])
985
 
986
  # Transition from Page 1 to Page 0 (Back button).
987
  back_btn_0.click(
@@ -1035,7 +1068,8 @@ with gr.Blocks(css=centered_col_css) as demo:
1035
  ).then(
1036
  fn=process_result,
1037
  inputs=error_message_box,
1038
- outputs=[page2, final_page, confirm_modal, error_modal, error_message_box]
 
1039
  )
1040
 
1041
  # Finalize submission if user confirms.
 
6
  from utils import format_chat, append_to_sheet, read_sheet_to_df
7
  import random
8
 
9
+ # Load tool lists
10
+ fda_drug_labeling_tools_path = "fda_drug_labeling_tools.json"
11
+ monarch_tools_path = "monarch_tools.json"
12
+ opentarget_tools_path = "opentarget_tools.json"
13
+
14
+ try:
15
+ with open(fda_drug_labeling_tools_path, 'r') as f:
16
+ fda_data = json.load(f)
17
+ fda_drug_labeling_tools_list = [item['name'] for item in fda_data if 'name' in item]
18
+ except Exception as e:
19
+ print(f"Error processing {fda_drug_labeling_tools_path}: {e}")
20
+ fda_drug_labeling_tools_list = ["Error loading FDA tools"]
21
+
22
+ try:
23
+ with open(monarch_tools_path, 'r') as f:
24
+ monarch_data = json.load(f)
25
+ monarch_tools_list = [item['name'] for item in monarch_data if 'name' in item]
26
+ except Exception as e:
27
+ print(f"Error processing {monarch_tools_path}: {e}")
28
+ monarch_tools_list = ["Error loading Monarch tools"]
29
+
30
+ try:
31
+ with open(opentarget_tools_path, 'r') as f:
32
+ opentarget_data = json.load(f)
33
+ opentarget_tools_list = [item['name'] for item in opentarget_data if 'name' in item]
34
+ except Exception as e:
35
+ print(f"Error processing {opentarget_tools_path}: {e}")
36
+ opentarget_tools_list = ["Error loading OpenTarget tools"]
37
+
38
+ #for labeling the different tool calls in format_chat
39
+ tool_database_labels = {
40
+ "**from approved FDA drug labels**": fda_drug_labeling_tools_list,
41
+ "**from the Monarch Initiative databases**": monarch_tools_list,
42
+ "**from the Open Targets database**": opentarget_tools_list,
43
+ }
44
+
45
  # Define the six evaluation criteria as a list of dictionaries.
46
  criteria = [
47
  {
48
  "label": "Problem Resolution",
49
  "text": (
50
  "Problem Resolution: Did the model effectively solve the problem?",
51
+ "1️⃣ Did Not Solve the Problem at All. 2️⃣ Attempted to Solve but Largely Incorrect or Incomplete. 3️⃣ Partially Solved the Problem, but with Limitations. 4️⃣ Mostly Solved the Problem, with Minor Issues. 5️⃣ Completely and Effectively Solved the Problem."
52
  )
53
  },
54
  {
55
  "label": "Helpfulness",
56
  "text": (
57
  "Helpfulness: Was the answer and reasoning provided helpful in addressing the question?",
58
+ "1️⃣ Not Helpful at All. 2️⃣ Slightly Helpful, but Largely Insufficient. 3️⃣ Moderately Helpful, but Needs Improvement. 4️⃣ Helpful and Mostly Clear, with Minor Issues. 5️⃣ Extremely Helpful and Comprehensive."
59
  )
60
  },
61
  {
62
  "label": "Scientific Consensus",
63
  "text": (
64
+ "Clinical Consensus: Does the answer align with established scientific and clinical consensus?",
65
+ "1️⃣ Completely Misaligned with Clinical Consensus. 2️⃣ Partially Aligned but Contains Significant Inaccuracies or Misinterpretations. 3️⃣ Generally Aligned but Lacks Rigor or Clarity. 4️⃣ Mostly Aligned with Clinical Consensus, with Minor Omissions or Uncertainties. 5️⃣ Fully Aligned with Established Clinical Consensus."
66
  )
67
  },
68
  {
69
  "label": "Accuracy",
70
  "text": (
71
  "Accuracy of Content: Is there any incorrect or irrelevant content in the answer and the reasoning content?",
72
+ "1️⃣ Completely Inaccurate or Irrelevant. 2️⃣ Mostly Inaccurate, with Some Relevant Elements. 3️⃣ Partially Accurate, but Includes Some Errors or Omissions. 4️⃣ Mostly Accurate, with Minor Issues or Unverified Claims. 5️⃣ Completely Accurate and Relevant."
73
  )
74
  },
75
  {
76
  "label": "Completeness",
77
  "text": (
78
  "Completeness: Did the answer omit any essential content necessary for a comprehensive response?",
79
+ "1️⃣ Severely Incomplete – Major Content Omissions. 2️⃣ Largely Incomplete – Missing Key Elements. 3️⃣ Somewhat Complete – Covers Basics but Lacks Depth. 4️⃣ Mostly Complete – Minor Omissions or Gaps. 5️⃣ Fully Complete – No Important Omissions."
80
  )
81
  },
82
  ]
 
169
 
170
  # Handle case where no relevant questions are found based on specialty
171
  if not evaluator_question_ids:
172
+ return [], data_by_filename
173
 
174
  #FINALLY, MAKE SURE THEY DIDNT ALREADY FILL IT OUT. Must go through every tuple of (question_ID, TxAgent, other model) where other model could be any of the other files in data_by_filename
175
  model_names = [key for key in data_by_filename.keys() if key != 'txagent']
 
184
  # collect all (question_ID, other_model) pairs already seen
185
  matched_pairs = set()
186
  for _, row in results_df.iterrows():
 
 
187
  if row["Email"] == email:
188
  q = row["Question ID"]
189
  # pick whichever response isn’t 'txagent'
 
208
  def go_to_page0_from_minus1():
209
  return gr.update(visible=False), gr.update(visible=True)
210
 
211
+ def go_to_eval_progress_modal(name, email, specialty_dd, subspecialty_dd, years_exp_radio, exp_explanation_tb, npi_id):
212
 
213
  # ADDED: Validate that name and email are non-empty before proceeding
214
+ if not name or not email or not specialty_dd or not years_exp_radio:
215
+ return gr.update(visible=True), gr.update(visible=False), None, "Please fill out all the required fields (name, email, specialty, years of experience). If you are not a licensed physician with a specific specialty, please choose the specialty that most closely aligns with your biomedical expertise.", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.State(),gr.update(visible=False), ""
216
 
217
  # Combine user's selected specialties and subspecialties into a set for efficient lookup
218
  # Ensure inputs are lists, even if None or single strings are passed (though Dropdown with multiselect=True should return lists)
 
243
  full_question_ids_list, data_by_filename = get_evaluator_questions(email, disease_map_data, user_all_specs, all_files, evaluator_directory)
244
 
245
  if len(full_question_ids_list) == 0:
246
+ return gr.update(visible=True), gr.update(visible=False), None, "Based on your submitted data, you have no more questions to evaluate. You may exit the page; we will follow-up if we require anything else from you. Thank you!", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.State(),gr.update(visible=False),""
247
 
248
  full_question_ids_list = sorted(full_question_ids_list, key=lambda x: str(x[0])+str(x[1]))
249
  #selected question is the first element
 
278
  }
279
 
280
  #update user_info
281
+ user_info = (name, email, specialty_dd, subspecialty_dd, years_exp_radio, exp_explanation_tb, npi_id, q_id)
282
+ chat_A_value = format_chat(question_for_eval['models'][0]['reasoning_trace'], tool_database_labels)
283
+ chat_B_value = format_chat(question_for_eval['models'][1]['reasoning_trace'], tool_database_labels)
284
  prompt_text = question_for_eval['question']
285
 
286
  # Construct the question-specific elements of the pairwise rating page (page 1)
 
307
  avatar_images=None, # Optional: omit user/assistant icons
308
  rtl=False
309
  )
310
+ return gr.update(visible=True), gr.update(visible=False), user_info,"", chat_a, chat_b, page1_prompt, question_for_eval, gr.update(visible=True), f"You are about to evaluate the next question."#f"You have {len(full_question_ids_list)} question(s) remaining to evaluate."
311
 
312
  #goes to page 1 from confirmation modal that tells users how many questions they have left to evaluate
313
  def go_to_page1():
 
337
  if any(answer is None for answer in pairwise_list):
338
  return gr.update(visible=True), gr.update(visible=False), None, None, "Error: Please select an option for every pairwise comparison.", gr.Chatbot(), gr.Chatbot(), gr.HTML(), *pairwise_results_for_display
339
 
340
+ chat_A_value = format_chat(data_subset_state['models'][0]['reasoning_trace'], tool_database_labels)
341
+ chat_B_value = format_chat(data_subset_state['models'][1]['reasoning_trace'], tool_database_labels)
342
  prompt_text = data_subset_state['question']
343
 
344
  # Construct the question-specific elements of the rating page (page 2)
 
416
  #centered-column {
417
  margin-left: auto;
418
  margin-right: auto;
419
+ max-width: 800px; /* Adjust this width as desired */
420
  width: 100%;
421
  }
422
  """
 
447
  print(f"Error: Could not parse JSON from specialty files.")
448
  specialties_list = ["Error parsing specialties"]
449
  subspecialties_list = ["Error parsing subspecialties"]
450
+
451
  # Page -1: Page to link them to question submission form or evaluation portal
452
  with gr.Column(visible=True, elem_id="page-1") as page_minus1:
453
  gr.HTML("""
454
  <div>
455
  <h1>TxAgent Evaluation Portal</h1>
456
  <p>Welcome to the TxAgent Evaluation Portal.</p>
457
+ </div>
458
+ """)
459
+ with gr.Row():
460
+ submit_questions_btn = gr.Button("Submit Questions for TxAgent Evaluation")
461
+ participate_eval_btn = gr.Button("Participate in TxAgent Evaluation")
462
+ gr.HTML("""
463
+ <div>
464
  <p><strong>About TxAgent:</strong> TxAgent is a first-of-its-kind AI model developed in the Zitnik Lab at Harvard Medical School. It leverages multi-step reasoning and real-time biomedical knowledge retrieval from a toolbox of 211 tools to analyze drug interactions, contraindications, and patient-specific treatment strategies. It is designed to provide personalized treatment recommendations across a wide range of diseases, including rare diseases.</p>
465
  <p>TxAgent evaluates how drugs interact at molecular, pharmacokinetic, and clinical levels, identifies contraindications based on patient comorbidities and concurrent medications, and tailors treatment strategies to individual patient characteristics, including age, genetic factors, and disease progression. It achieves 92.1% accuracy in open-ended drug reasoning tasks, surpassing GPT-4o by up to 25.8% and outperforming DeepSeek-R1 (671B) in structured multi-step reasoning.</p>
466
  <p>TxAgent's toolbox, ToolUniverse, consolidates 211 tools from trusted sources, including all US FDA-approved drugs since 1939 and validated clinical insights from Open Targets. By integrating multi-step inference, real-time knowledge grounding, and tool-assisted decision-making, TxAgent ensures that treatment recommendations align with established clinical guidelines and real-world evidence, reducing the risk of adverse events and improving therapeutic decision-making.</p>
 
473
  <p>Your contribution is invaluable to us. Thank you for your time and expertise!</p>
474
  </div>
475
  """)
 
 
 
476
 
477
  # Define actions for the new buttons
478
  # For the Google Form button, we'll use JavaScript to open a new tab.
 
502
  By clicking 'Next' below, you will start the study, with your progress saved after submitting each question. If you have any other questions or concerns, please contact us directly. Thank you for your participation!
503
  """)
504
  gr.Markdown("## Please enter your information to get a question to evaluate. Please use the same email every time you log onto this evaluation portal, as we use your email to prevent showing repeat questions.")
505
+ name = gr.Textbox(label="Name (required)")
506
+ email = gr.Textbox(label="Email (required). Please use the same email every time you log onto this evaluation portal, as we use your email to prevent showing repeat questions.")
507
+ specialty_dd = gr.Dropdown(choices=specialties_list, label="Primary Medical Specialty (required). Go to https://www.abms.org/member-boards/specialty-subspecialty-certificates/ for categorization)", multiselect=True)
508
+ subspecialty_dd = gr.Dropdown(choices=subspecialties_list, label="Subspecialty (if applicable). Go to https://www.abms.org/member-boards/specialty-subspecialty-certificates/ for categorization)", multiselect=True)
509
+ npi_id = gr.Textbox(label="National Provider Identifier ID (optional). Got to https://npiregistry.cms.hhs.gov/search to search for your NPI ID. If you do not have an NPI ID, please leave this blank.")
510
  years_exp_radio = gr.Radio(
511
  choices=["0-2 years", "3-5 years", "6-10 years", "11-20 years", "20+ years", "Not Applicable"],
512
+ label="How many years have you been involved in clinical and/or research activities related to your biomedical area of expertise? (required)"
513
  )
514
  exp_explanation_tb = gr.Textbox(label="Please briefly explain your expertise/experience relevant to evaluating AI for clinical decision support (optional)")
515
 
 
584
  next_btn_1 = gr.Button("Next: Rate Responses")
585
 
586
  with gr.Row():
587
+ home_btn_1 = gr.Button("Home Page (your progress on this question will be saved but not submitted)") # ADDED: Home button on page11
 
588
 
589
  # Page 2: Combined Rating Page for both responses.
590
  with gr.Column(visible=False) as page2:
 
721
  label=f"Score for Response B - {crit['label']}",
722
  interactive=True)
723
  with gr.Row():
724
+ clear_btn = gr.Button("Clear Selection", size="sm")
725
  clear_btn.click(fn=clear_selection, outputs=[rating_a,rating_b])
726
 
727
  # wire each to re‐restrict the other on change
 
739
  ratings_B.append(rating_b)
740
  with gr.Row():
741
  back_btn_2 = gr.Button("Back")
 
742
  submit_btn = gr.Button("Submit (Note: Once submitted, you cannot edit your responses)", elem_id="submit_btn")
743
 
744
  with gr.Row():
745
  home_btn_2 = gr.Button("Home Page (your progress on this question will be saved but not submitted)")
 
746
 
747
  result_text = gr.Textbox(label="Validation Result")
748
 
 
784
  "Subspecialty": str(user_info[3]),
785
  "Years of Experience": user_info[4],
786
  "Experience Explanation": user_info[5],
787
+ "NPI ID": user_info[6],
788
+ "Question ID": user_info[7],
789
  "Prompt": prompt_text,
790
  "ResponseA_Model": response_A_model,
791
  "ResponseB_Model": response_B_model,
 
822
  disease_specialty_map = hf_hub_download(repo_id=REPO_ID, filename=DISEASE_SPECIALTY_MAP_FILENAME, repo_type="dataset", revision="main")
823
  with open(disease_specialty_map, 'r') as f: disease_map_data = json.load(f)
824
 
825
+ _, email, specialty, subspecialty, _, _, _, _ = user_info
826
  user_specialties = set(specialty if isinstance(specialty, list) else ([specialty] if specialty else []))
827
  user_subspecialties = set(subspecialty if isinstance(subspecialty, list) else ([subspecialty] if subspecialty else []))
828
  user_all_specs = user_specialties.union(user_subspecialties)
 
879
  "models": models_list,
880
  }
881
 
882
+ chat_A_value = format_chat(question_for_eval['models'][0]['reasoning_trace'], tool_database_labels)
883
+ chat_B_value = format_chat(question_for_eval['models'][1]['reasoning_trace'], tool_database_labels)
884
  prompt_text = question_for_eval['question']
885
 
886
  # Construct the question-specific elements of the pairwise rating page (page 1)
 
914
  gr.update(visible=False), # page2 (Hide)
915
  gr.update(visible=False), # confirm_modal (Hide)
916
  gr.update(visible=True), # eval_progress_modal (Show)
917
+ f"Submission successful! There are more questions to evaluate. You may exit the page and return later if you wish.",#f"Submission successful! You have {remaining_count} question(s) remaining to evaluate. You may exit the page and return later if you wish.", # eval_progress_text
918
  gr.update(visible=False), # final_page (Hide)
919
  "",
920
  chat_a,
 
999
  # Transition from Page 0 (Welcome) to Page 1.
1000
  next_btn_0.click(
1001
  fn=go_to_eval_progress_modal,
1002
+ inputs=[name, email, specialty_dd, subspecialty_dd, years_exp_radio, exp_explanation_tb, npi_id],
1003
  outputs=[page0, page1, user_info_state, page0_error_box, chat_a, chat_b, page1_prompt, data_subset_state,eval_progress_modal,eval_progress_text],
1004
  scroll_to_output=True
1005
  )
 
1015
  home_btn_0.click(lambda: (gr.update(visible=True), gr.update(visible=False)), None, [page_minus1, page0])
1016
  home_btn_1.click(lambda: (gr.update(visible=True), gr.update(visible=False)), None, [page_minus1, page1])
1017
  home_btn_2.click(lambda: (gr.update(visible=True), gr.update(visible=False)), None, [page_minus1, page2])
 
 
 
 
1018
 
1019
  # Transition from Page 1 to Page 0 (Back button).
1020
  back_btn_0.click(
 
1068
  ).then(
1069
  fn=process_result,
1070
  inputs=error_message_box,
1071
+ outputs=[page2, final_page, confirm_modal, error_modal, error_message_box],
1072
+ scroll_to_output=True
1073
  )
1074
 
1075
  # Finalize submission if user confirms.
fda_drug_labeling_tools.json ADDED
The diff for this file is too large to render. See raw diff
 
monarch_tools.json ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "get_joint_associated_diseases_by_HPO_ID_list",
4
+ "description": "Retrieve diseases associated with a list of phenotypes or symptoms by a list of HPO IDs.",
5
+ "parameter": {
6
+ "type": "object",
7
+ "properties": {
8
+ "HPO_ID_list": {
9
+ "type": "array",
10
+ "description": "List of phenotypes or symptoms",
11
+ "items": {
12
+ "type": "string",
13
+ "description": "The HPO ID of the phenotype or symptom.",
14
+ "required": true
15
+ },
16
+ "required": true
17
+ },
18
+ "limit": {
19
+ "type": "integer",
20
+ "description": "Number of entries to fetch.",
21
+ "required": false
22
+ },
23
+ "offset": {
24
+ "type": "integer",
25
+ "description": "Number of initial entries to skip.",
26
+ "required": false
27
+ }
28
+ }
29
+ },
30
+ "query_schema": {
31
+ "category": ["biolink:DiseaseToPhenotypicFeatureAssociation"],
32
+ "object": null,
33
+ "compact": true,
34
+ "object_category": ["biolink:PhenotypicFeature"],
35
+ "limit": 500,
36
+ "offset": 0
37
+ },
38
+ "label": [
39
+ "Monarch",
40
+ "Phenotype",
41
+ "Symptom",
42
+ "Disease",
43
+ "HPO_ID"
44
+ ],
45
+ "type": "MonarchDiseasesForMultiplePheno",
46
+ "tool_url": "/association"
47
+ },
48
+ {
49
+ "name": "get_phenotype_by_HPO_ID",
50
+ "description": "Retrieve a phenotype or symptom by its HPO ID.",
51
+ "parameter": {
52
+ "type": "object",
53
+ "properties": {
54
+ "id": {
55
+ "type": "string",
56
+ "description": "The HPO ID of the phenotype or symptom.",
57
+ "required": true
58
+ }
59
+ }
60
+ },
61
+ "query_schema": {
62
+ "id": null,
63
+ "url_key": "id"
64
+ },
65
+ "label": [
66
+ "Monarch",
67
+ "Phenotype",
68
+ "Symptom",
69
+ "HPO_ID"
70
+ ],
71
+ "type": "Monarch",
72
+ "tool_url": "/entity/{url_key}"
73
+ },
74
+ {
75
+ "name": "get_HPO_ID_by_phenotype",
76
+ "description": "Retrieve the HPO ID of a phenotype or symptom.",
77
+ "parameter": {
78
+ "type": "object",
79
+ "properties": {
80
+ "query": {
81
+ "type": "string",
82
+ "description": "One query phenotype or symptom.",
83
+ "required": true
84
+ },
85
+ "limit": {
86
+ "type": "integer",
87
+ "description": "Number of entries to fetch.",
88
+ "required": false
89
+ },
90
+ "offset": {
91
+ "type": "integer",
92
+ "description": "Number of initial entries to skip.",
93
+ "required": false
94
+ }
95
+ }
96
+ },
97
+ "query_schema": {
98
+ "query": null,
99
+ "category": ["biolink:PhenotypicFeature"],
100
+ "limit": 20,
101
+ "offset": 0
102
+ },
103
+ "label": [
104
+ "Monarch",
105
+ "Phenotype",
106
+ "Symptom",
107
+ "HPO_ID"
108
+ ],
109
+ "type": "Monarch",
110
+ "tool_url": "/search"
111
+ }
112
+ ]
opentarget_tools.json ADDED
@@ -0,0 +1,2166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "get_associated_targets_by_disease_efoId",
4
+ "description": "Find targets associated with a specific disease or phenotype based on efoId.",
5
+ "label": [
6
+ "Disease",
7
+ "Phenotype",
8
+ "Target",
9
+ "Association",
10
+ "OpenTarget",
11
+ "GraphQL"
12
+ ],
13
+ "parameter": {
14
+ "type": "object",
15
+ "properties": {
16
+ "efoId": {
17
+ "type": "string",
18
+ "description": "The efoId of a disease or phenotype.",
19
+ "required": true
20
+ }
21
+ }
22
+ },
23
+ "query_schema": "\nquery associatedTargets($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n associatedTargets {\n count\n rows {\n target {\n id\n approvedSymbol\n }\n score\n }\n }\n }\n}\n",
24
+ "type": "OpenTarget"
25
+ },
26
+ {
27
+ "name": "get_associated_diseases_phenotypes_by_target_ensemblID",
28
+ "description": "Find diseases or phenotypes associated with a specific target using ensemblId.",
29
+ "label": [
30
+ "Target",
31
+ "Disease",
32
+ "Phenotype",
33
+ "Association",
34
+ "OpenTarget",
35
+ "GraphQL"
36
+ ],
37
+ "parameter": {
38
+ "type": "object",
39
+ "properties": {
40
+ "ensemblId": {
41
+ "type": "string",
42
+ "description": "The ensemblId of a target.",
43
+ "required": true
44
+ }
45
+ }
46
+ },
47
+ "query_schema": "\nquery associatedDiseases($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n associatedDiseases {\n count\n rows {\n disease {\n id\n name\n }\n datasourceScores {\n id\n score\n }\n }\n }\n }\n}\n",
48
+ "type": "OpenTarget"
49
+ },
50
+ {
51
+ "name": "target_disease_evidence",
52
+ "description": "Explore evidence that supports a specific target-disease association. Input is disease efoId and target ensemblID.",
53
+ "label": [
54
+ "Target",
55
+ "Disease",
56
+ "Evidence",
57
+ "Association",
58
+ "OpenTarget",
59
+ "GraphQL"
60
+ ],
61
+ "parameter": {
62
+ "type": "object",
63
+ "properties": {
64
+ "efoId": {
65
+ "type": "string",
66
+ "description": "The efoId of a disease or phenotype.",
67
+ "required": true
68
+ },
69
+ "ensemblId": {
70
+ "type": "string",
71
+ "description": "The ensemblId of a target.",
72
+ "required": true
73
+ }
74
+ }
75
+ },
76
+ "query_schema": "\nquery targetDiseaseEvidence($efoId: String!, $ensemblId: String!) {\n disease(efoId: $efoId) {\n id\n name\n evidences(datasourceIds: [\"intogen\"], ensemblIds: [$ensemblId]) {\n count\n rows {\n disease {\n id\n name\n }\n diseaseFromSource\n target {\n id\n approvedSymbol\n }\n mutatedSamples {\n functionalConsequence {\n id\n label\n }\n numberSamplesTested\n numberMutatedSamples\n }\n resourceScore\n significantDriverMethods\n cohortId\n cohortShortName\n cohortDescription\n }\n }\n }\n}\n",
77
+ "type": "OpenTarget"
78
+ },
79
+ {
80
+ "name": "get_drug_warnings_by_chemblId",
81
+ "description": "Retrieve warnings for a specific drug using ChEMBL ID.",
82
+ "parameter": {
83
+ "type": "object",
84
+ "properties": {
85
+ "chemblId": {
86
+ "type": "string",
87
+ "description": "The ChEMBL ID of the drug.",
88
+ "required": true
89
+ }
90
+ }
91
+ },
92
+ "query_schema": "\n query drugWarnings($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n drugWarnings {\n warningType\n description\n country\n year\n toxicityClass\n chemblIds\n efoIdForWarningClass\n references {\n id\n source\n url\n }\n }\n }\n }\n ",
93
+ "label": [
94
+ "Drug",
95
+ "AdverseEvents",
96
+ "SafetyLiability",
97
+ "OpenTarget",
98
+ "GraphQL",
99
+ "Warnings",
100
+ "Safety",
101
+ "Withdrawal",
102
+ "Toxicity"
103
+ ],
104
+ "type": "OpenTarget"
105
+ },
106
+ {
107
+ "name": "get_drug_mechanisms_of_action_by_chemblId",
108
+ "description": "Retrieve the mechanisms of action associated with a specific drug using chemblId.",
109
+ "parameter": {
110
+ "type": "object",
111
+ "properties": {
112
+ "chemblId": {
113
+ "type": "string",
114
+ "description": "The ChEMBL ID of the drug.",
115
+ "required": true
116
+ }
117
+ }
118
+ },
119
+ "query_schema": "\n query drugMechanismsOfAction($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n mechanismsOfAction {\n rows {\n mechanismOfAction\n actionType\n targetName\n targets {\n id\n approvedSymbol\n }\n }\n }\n }\n }\n ",
120
+ "label": [
121
+ "Drug",
122
+ "MechanismsOfAction",
123
+ "Target",
124
+ "Pharmacology",
125
+ "ChemblId",
126
+ "OpenTarget",
127
+ "GraphQL"
128
+ ],
129
+ "type": "OpenTarget"
130
+ },
131
+ {
132
+ "name": "get_associated_drugs_by_disease_efoId",
133
+ "description": "Retrieve known drugs associated with a specific disease by disease efoId.",
134
+ "parameter": {
135
+ "type": "object",
136
+ "properties": {
137
+ "efoId": {
138
+ "type": "string",
139
+ "description": "The EFO ID of the disease.",
140
+ "required": true
141
+ },
142
+ "size": {
143
+ "type": "integer",
144
+ "description": "Number of entries to fetch, recomanding a large number to avoid missing drugs.",
145
+ "required": true
146
+ }
147
+ }
148
+ },
149
+ "query_schema": "\n query diseaseKnownDrugs($efoId: String!, $size: Int!, $freeTextQuery: String) {\n disease(efoId: $efoId) {\n id\n name\n knownDrugs(size: $size, freeTextQuery: $freeTextQuery) {\n count\n rows {\n drug {\n id\n name\n tradeNames\n maximumClinicalTrialPhase\n isApproved\n hasBeenWithdrawn\n }\n phase\n status\n mechanismOfAction\n target {\n id\n approvedSymbol\n }\n }\n }\n }\n }\n ",
150
+ "examples": [
151
+ {
152
+ "question": "Please list the drugs associated with the disease with efoId 'EFO_0005548' and filter by 'dopamine'.",
153
+ "query": {
154
+ "name": "get_associated_drugs_by_disease_efoId",
155
+ "arguments": {
156
+ "efoId": "EFO_0005548",
157
+ "size": 10,
158
+ "freeTextQuery": "dopamine"
159
+ }
160
+ }
161
+ }
162
+ ],
163
+ "label": [
164
+ "OpenTarget",
165
+ "Disease",
166
+ "Drug",
167
+ "Pagination",
168
+ "GraphQL"
169
+ ],
170
+ "type": "OpenTarget"
171
+ },
172
+ {
173
+ "name": "get_similar_entities_by_disease_efoId",
174
+ "description": "Retrieve similar entities for a given disease efoId using a model trained with PubMed.",
175
+ "parameter": {
176
+ "type": "object",
177
+ "properties": {
178
+ "efoId": {
179
+ "type": "string",
180
+ "description": "The EFO ID of the disease.",
181
+ "required": true
182
+ },
183
+ "threshold": {
184
+ "type": "number",
185
+ "description": "Threshold similarity between 0 and 1. Only results above threshold are returned.",
186
+ "required": true
187
+ },
188
+ "size": {
189
+ "type": "integer",
190
+ "description": "Number of similar entities to fetch.",
191
+ "required": true
192
+ }
193
+ }
194
+ },
195
+ "query_schema": "\n query diseaseSimilarEntities($efoId: String!, $threshold: Float!, $size: Int!) {\n disease(efoId: $efoId) {\n id\n name\n similarEntities(threshold: $threshold, size: $size) {\n id\n category\n score\n object {\n ... on Disease {\n id\n name\n }\n ... on Target {\n id\n approvedSymbol\n }\n ... on Drug {\n id\n name\n }\n }\n }\n }\n }\n ",
196
+ "label": [
197
+ "Disease",
198
+ "Similarity",
199
+ "Model",
200
+ "Entities",
201
+ "OpenTarget",
202
+ "GraphQL"
203
+ ],
204
+ "type": "OpenTarget"
205
+ },
206
+ {
207
+ "name": "get_similar_entities_by_drug_chemblId",
208
+ "description": "Retrieve similar entities for a given drug chemblId using a model trained with PubMed.",
209
+ "parameter": {
210
+ "type": "object",
211
+ "properties": {
212
+ "chemblId": {
213
+ "type": "string",
214
+ "description": "The chemblId of the disease.",
215
+ "required": true
216
+ },
217
+ "threshold": {
218
+ "type": "number",
219
+ "description": "Threshold similarity between 0 and 1. Only results above threshold are returned.",
220
+ "required": true
221
+ },
222
+ "size": {
223
+ "type": "integer",
224
+ "description": "Number of similar entities to fetch.",
225
+ "required": true
226
+ }
227
+ }
228
+ },
229
+ "query_schema": "\n query diseaseSimilarEntities($chemblId: String!, $threshold: Float!, $size: Int!) {\n drug(chemblId: $chemblId) {\n id\n name\n similarEntities(threshold: $threshold, size: $size) {\n id\n category\n score\n object {\n ... on Disease {\n id\n name\n }\n ... on Target {\n id\n approvedSymbol\n }\n ... on Drug {\n id\n name\n }\n }\n }\n }\n }\n ",
230
+ "label": [
231
+ "Drug",
232
+ "Similarity",
233
+ "Model",
234
+ "Entities",
235
+ "OpenTarget",
236
+ "GraphQL"
237
+ ],
238
+ "type": "OpenTarget"
239
+ },
240
+ {
241
+ "name": "get_similar_entities_by_target_ensemblID",
242
+ "description": "Retrieve similar entities for a given target ensemblID using a model trained with PubMed.",
243
+ "parameter": {
244
+ "type": "object",
245
+ "properties": {
246
+ "ensemblId": {
247
+ "type": "string",
248
+ "description": "The ensemblID of the disease.",
249
+ "required": true
250
+ },
251
+ "threshold": {
252
+ "type": "number",
253
+ "description": "Threshold similarity between 0 and 1. Only results above threshold are returned.",
254
+ "required": true
255
+ },
256
+ "size": {
257
+ "type": "integer",
258
+ "description": "Number of similar entities to fetch.",
259
+ "required": true
260
+ }
261
+ }
262
+ },
263
+ "query_schema": "\n query diseaseSimilarEntities($ensemblId: String!, $threshold: Float!, $size: Int!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n similarEntities(threshold: $threshold, size: $size) {\n id\n category\n score\n object {\n ... on Disease {\n id\n name\n }\n ... on Target {\n id\n approvedSymbol\n }\n ... on Drug {\n id\n name\n }\n }\n }\n }\n }\n ",
264
+ "label": [
265
+ "Disease",
266
+ "Similarity",
267
+ "Model",
268
+ "Entities",
269
+ "OpenTarget",
270
+ "GraphQL"
271
+ ],
272
+ "type": "OpenTarget"
273
+ },
274
+ {
275
+ "name": "get_associated_phenotypes_by_disease_efoId",
276
+ "description": "Find HPO phenotypes asosciated with the specified disease efoId.",
277
+ "parameter": {
278
+ "type": "object",
279
+ "properties": {
280
+ "efoId": {
281
+ "type": "string",
282
+ "description": "The efoId of a disease or phenotype.",
283
+ "required": true
284
+ }
285
+ }
286
+ },
287
+ "query_schema": "query diseaseAnnotation($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n phenotypes {\n rows {\n phenotypeHPO {\n id\n name\n description\n namespace\n }\n phenotypeEFO {\n id\n name\n }\n }\n }\n }\n}",
288
+ "label": [
289
+ "Disease",
290
+ "OpenTarget",
291
+ "GraphQL",
292
+ "Phenotype",
293
+ "Symptoms",
294
+ "Clinical signs"
295
+ ],
296
+ "type": "OpenTarget"
297
+ },
298
+ {
299
+ "name": "get_drug_withdrawn_blackbox_status_by_chemblId",
300
+ "description": "Find withdrawn and black-box warning statuses for a specific drug by chemblId.",
301
+ "parameter": {
302
+ "type": "object",
303
+ "properties": {
304
+ "chemblId": {
305
+ "type": "array",
306
+ "items": {
307
+ "type": "string"
308
+ },
309
+ "description": "The chemblId of a drug.",
310
+ "required": true
311
+ }
312
+ }
313
+ },
314
+ "query_schema": "\n query drugWithdrawnWarningData($chemblId: String!) {\n drug(chemblId: $chemblId) {\n name\n id\n hasBeenWithdrawn\n blackBoxWarning\n }\n }\n ",
315
+ "label": [
316
+ "Drug",
317
+ "SafetyWarnings",
318
+ "Withdrawal",
319
+ "OpenTarget",
320
+ "GraphQL"
321
+ ],
322
+ "type": "OpenTarget"
323
+ },
324
+ {
325
+ "name": "search_category_counts_by_query_string",
326
+ "description": "Get the count of entries in each entity category (disease, target, drug) based on a query string.",
327
+ "parameter": {
328
+ "type": "object",
329
+ "properties": {
330
+ "queryString": {
331
+ "type": "string",
332
+ "description": "The search string for querying information.",
333
+ "required": true
334
+ }
335
+ }
336
+ },
337
+ "query_schema": "\n query searchCategoryCounts($queryString: String!) {\n search(queryString: $queryString) {\n aggregations {\n total\n entities {\n total\n name\n }\n }\n }\n }\n ",
338
+ "label": [
339
+ "OpenTarget",
340
+ "GraphQL",
341
+ "SearchResults",
342
+ "Search",
343
+ "Query",
344
+ "Counts",
345
+ "Categories"
346
+ ],
347
+ "type": "OpenTarget"
348
+ },
349
+ {
350
+ "name": "get_disease_id_description_by_name",
351
+ "description": "Retrieve the efoId and additional details of a disease based on its name.",
352
+ "parameter": {
353
+ "type": "object",
354
+ "properties": {
355
+ "diseaseName": {
356
+ "type": "string",
357
+ "description": "The name of the disease to search for.",
358
+ "required": true
359
+ }
360
+ }
361
+ },
362
+ "query_schema": "\n query getDiseaseIdByName($diseaseName: String!) {\n search(queryString: $diseaseName, entityNames: [\"disease\"]) {\n hits {\n id\n name\n description\n }\n }\n }\n ",
363
+ "label": [
364
+ "Disease",
365
+ "Identification",
366
+ "Search",
367
+ "Name",
368
+ "Disease",
369
+ "OpenTarget",
370
+ "GraphQL"
371
+ ],
372
+ "type": "OpenTarget"
373
+ },
374
+ {
375
+ "name": "get_drug_id_description_by_name",
376
+ "description": "Fetch the drug chemblId and description based on the drug name.",
377
+ "parameter": {
378
+ "type": "object",
379
+ "properties": {
380
+ "drugName": {
381
+ "type": "string",
382
+ "description": "The name of the drug for which the ID is required.",
383
+ "required": true
384
+ }
385
+ }
386
+ },
387
+ "query_schema": "\n query getDrugIdByName($drugName: String!) {\n search(queryString: $drugName, entityNames: [\"drug\"]) {\n hits {\n id\n name\n description\n }\n }\n }\n ",
388
+ "label": [
389
+ "Identification",
390
+ "Search",
391
+ "Name",
392
+ "Drug",
393
+ "OpenTarget",
394
+ "GraphQL"
395
+ ],
396
+ "type": "OpentargetToolDrugNameMatch"
397
+ },
398
+ {
399
+ "name": "get_drug_indications_by_chemblId",
400
+ "description": "Fetch indications (treatable phenotypes/diseases) for a given drug chemblId.",
401
+ "parameter": {
402
+ "type": "object",
403
+ "properties": {
404
+ "chemblId": {
405
+ "type": "string",
406
+ "description": "The chemblId of the drug for which to retrieve treatable phenotypes information.",
407
+ "required": true
408
+ }
409
+ }
410
+ },
411
+ "query_schema": "\n query drugIndications($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n indications {\n rows {\n disease {\n id\n name\n }\n maxPhaseForIndication\n references {\n source\n ids\n }\n }\n }\n }\n }\n ",
412
+ "label": [
413
+ "Drug",
414
+ "Indications",
415
+ "Disease",
416
+ "Treatment",
417
+ "OpenTarget",
418
+ "GraphQL"
419
+ ],
420
+ "type": "OpenTarget"
421
+ },
422
+ {
423
+ "name": "get_target_gene_ontology_by_ensemblID",
424
+ "description": "Retrieve Gene Ontology annotations for a specific target by Ensembl ID.",
425
+ "parameter": {
426
+ "type": "object",
427
+ "properties": {
428
+ "ensemblId": {
429
+ "type": "string",
430
+ "description": "The Ensembl ID of the target for which to retrieve Gene Ontology annotations.",
431
+ "required": true
432
+ }
433
+ }
434
+ },
435
+ "query_schema": "\n query targetGeneOntology($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n geneOntology {\n aspect\n evidence\n geneProduct\n source\n term {\n id\n name\n }\n }\n }\n }\n ",
436
+ "examples": [
437
+ {
438
+ "question": "Can you retrieve the Gene Ontology annotations for the target with Ensembl ID 'ENSG00000136492'?",
439
+ "query": {
440
+ "name": "get_target_gene_ontology_by_ensemblID",
441
+ "arguments": {
442
+ "ensemblId": "ENSG00000136492"
443
+ }
444
+ }
445
+ },
446
+ {
447
+ "question": "What are the Gene Ontology annotations for the target identified by Ensembl ID 'ENSG00000138653'?",
448
+ "query": {
449
+ "name": "get_target_gene_ontology_by_ensemblID",
450
+ "arguments": {
451
+ "ensemblId": "ENSG00000138653"
452
+ }
453
+ }
454
+ },
455
+ {
456
+ "question": "Please provide the Gene Ontology annotations for the target with Ensembl ID 'ENSG00000186162'.",
457
+ "query": {
458
+ "name": "get_target_gene_ontology_by_ensemblID",
459
+ "arguments": {
460
+ "ensemblId": "ENSG00000186162"
461
+ }
462
+ }
463
+ }
464
+ ],
465
+ "label": [
466
+ "Target",
467
+ "GeneOntology",
468
+ "OpenTarget",
469
+ "GraphQL"
470
+ ],
471
+ "type": "OpenTarget"
472
+ },
473
+ {
474
+ "name": "get_target_homologues_by_ensemblID",
475
+ "description": "Fetch homologues for a specific target by Ensembl ID.",
476
+ "parameter": {
477
+ "type": "object",
478
+ "properties": {
479
+ "ensemblId": {
480
+ "type": "string",
481
+ "description": "The Ensembl ID of the target for which to retrieve homologues.",
482
+ "required": true
483
+ }
484
+ }
485
+ },
486
+ "query_schema": "\n query targetHomologues($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n homologues {\n homologyType\n queryPercentageIdentity\n speciesId\n speciesName\n targetGeneId\n targetGeneSymbol\n targetPercentageIdentity\n isHighConfidence\n }\n }\n }\n ",
487
+ "examples": [
488
+ {
489
+ "question": "Can you fetch homologues for the target with Ensembl ID 'ENSG00000100033'?",
490
+ "query": {
491
+ "name": "get_target_homologues_by_ensemblID",
492
+ "arguments": {
493
+ "ensemblId": "ENSG00000100033"
494
+ }
495
+ }
496
+ },
497
+ {
498
+ "question": "What are the homologues for the target identified by Ensembl ID 'ENSG00000288534'?",
499
+ "query": {
500
+ "name": "get_target_homologues_by_ensemblID",
501
+ "arguments": {
502
+ "ensemblId": "ENSG00000288534"
503
+ }
504
+ }
505
+ },
506
+ {
507
+ "question": "Please provide the homologues for the target with Ensembl ID 'ENSG00000198937'.",
508
+ "query": {
509
+ "name": "get_target_homologues_by_ensemblID",
510
+ "arguments": {
511
+ "ensemblId": "ENSG00000198937"
512
+ }
513
+ }
514
+ }
515
+ ],
516
+ "label": [
517
+ "OpenTarget",
518
+ "Target Information",
519
+ "GraphQL",
520
+ "Homologue"
521
+ ],
522
+ "type": "OpenTarget"
523
+ },
524
+ {
525
+ "name": "get_target_safety_profile_by_ensemblID",
526
+ "description": "Retrieve known target safety liabilities for a specific target Ensembl ID.",
527
+ "parameter": {
528
+ "type": "object",
529
+ "properties": {
530
+ "ensemblId": {
531
+ "type": "string",
532
+ "description": "The Ensembl ID of the target for which to retrieve safety liabilities.",
533
+ "required": true
534
+ }
535
+ }
536
+ },
537
+ "query_schema": "\n query targetSafetyLiabilities($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n safetyLiabilities {\n event\n eventId\n biosamples {\n cellFormat\n cellLabel\n tissueLabel\n tissueId\n }\n effects {\n dosing\n direction\n }\n studies {\n name\n type\n description\n }\n datasource\n literature\n }\n }\n }\n ",
538
+ "examples": [
539
+ {
540
+ "question": "Can you provide the safety liabilities for the target with Ensembl ID 'ENSG00000175274'?",
541
+ "query": {
542
+ "name": "target_safety_liabilities",
543
+ "arguments": {
544
+ "ensemblId": "ENSG00000175274"
545
+ }
546
+ }
547
+ },
548
+ {
549
+ "question": "What are the known safety effects for the target identified by Ensembl ID 'ENSG00000226446'?",
550
+ "query": {
551
+ "name": "target_safety_liabilities",
552
+ "arguments": {
553
+ "ensemblId": "ENSG00000226446"
554
+ }
555
+ }
556
+ },
557
+ {
558
+ "question": "Please retrieve the safety risk information for the target with Ensembl ID 'ENSG00000151929'.",
559
+ "query": {
560
+ "name": "target_safety_liabilities",
561
+ "arguments": {
562
+ "ensemblId": "ENSG00000151929"
563
+ }
564
+ }
565
+ }
566
+ ],
567
+ "label": [
568
+ "Target",
569
+ "SafetyLiability",
570
+ "OpenTarget",
571
+ "GraphQL",
572
+ "Safety",
573
+ "Liabilities"
574
+ ],
575
+ "type": "OpenTarget"
576
+ },
577
+ {
578
+ "name": "get_biological_mouse_models_by_ensemblID",
579
+ "description": "Retrieve biological mouse models, including allelic compositions and genetic backgrounds, for a specific target.",
580
+ "parameter": {
581
+ "type": "object",
582
+ "properties": {
583
+ "ensemblId": {
584
+ "type": "string",
585
+ "description": "The Ensembl ID of the target.",
586
+ "required": true
587
+ }
588
+ }
589
+ },
590
+ "query_schema": "\n query fetchBiologicalModels($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n mousePhenotypes {\n biologicalModels {\n allelicComposition\n geneticBackground\n id\n literature\n }\n }\n }\n }\n ",
591
+ "examples": [
592
+ {
593
+ "question": "What are the allelic compositions and genetic backgrounds for the target identified by Ensembl ID 'ENSG00000196639'?",
594
+ "query": {
595
+ "name": "get_biological_mouse_models_by_ensemblID",
596
+ "arguments": {
597
+ "ensemblId": "ENSG00000196639"
598
+ }
599
+ }
600
+ },
601
+ {
602
+ "question": "Please provide the biological models for the target with the Ensembl ID 'ENSG00000171862'.",
603
+ "query": {
604
+ "name": "get_biological_mouse_models_by_ensemblID",
605
+ "arguments": {
606
+ "ensemblId": "ENSG00000171862"
607
+ }
608
+ }
609
+ }
610
+ ],
611
+ "label": [
612
+ "OpenTarget",
613
+ "Target Information",
614
+ "BiologicalModels",
615
+ "GraphQL"
616
+ ],
617
+ "type": "OpenTarget"
618
+ },
619
+ {
620
+ "name": "get_target_genomic_location_by_ensemblID",
621
+ "description": "Retrieve genomic location data for a specific target, including chromosome, start, end, and strand.",
622
+ "parameter": {
623
+ "type": "object",
624
+ "properties": {
625
+ "ensemblId": {
626
+ "type": "string",
627
+ "description": "The Ensembl ID of the target for which to retrieve genomic location information.",
628
+ "required": true
629
+ }
630
+ }
631
+ },
632
+ "query_schema": "\n query targetGenomicLocation($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n genomicLocation {\n chromosome\n start\n end\n strand\n }\n }\n }\n ",
633
+ "examples": [
634
+ {
635
+ "question": "Can you provide the genomic location for the target with Ensembl ID 'ENSG00000114098'?",
636
+ "query": {
637
+ "name": "get_target_genomic_location_by_ensemblID",
638
+ "arguments": {
639
+ "ensemblId": "ENSG00000114098"
640
+ }
641
+ }
642
+ },
643
+ {
644
+ "question": "What is the genomic location data for the target identified by Ensembl ID 'ENSG00000231404'?",
645
+ "query": {
646
+ "name": "get_target_genomic_location_by_ensemblID",
647
+ "arguments": {
648
+ "ensemblId": "ENSG00000231404"
649
+ }
650
+ }
651
+ },
652
+ {
653
+ "question": "Please retrieve the genomic location information for the target with Ensembl ID 'ENSG00000167258'.",
654
+ "query": {
655
+ "name": "get_target_genomic_location_by_ensemblID",
656
+ "arguments": {
657
+ "ensemblId": "ENSG00000167258"
658
+ }
659
+ }
660
+ }
661
+ ],
662
+ "label": [
663
+ "Target",
664
+ "GenomicLocation",
665
+ "OpenTarget",
666
+ "GraphQL"
667
+ ],
668
+ "type": "OpenTarget"
669
+ },
670
+ {
671
+ "name": "get_target_subcellular_locations_by_ensemblID",
672
+ "description": "Retrieve information about subcellular locations for a specific target ensemblID.",
673
+ "parameter": {
674
+ "type": "object",
675
+ "properties": {
676
+ "ensemblId": {
677
+ "type": "string",
678
+ "description": "The ensemblId of a target.",
679
+ "required": true
680
+ }
681
+ }
682
+ },
683
+ "query_schema": "\n query targetSubcellularLocations($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n subcellularLocations {\n location\n source\n termSL\n labelSL\n }\n }\n }\n ",
684
+ "examples": [
685
+ {
686
+ "question": "Can you provide the subcellular locations for the target with Ensembl ID 'ENSG00000121898'?",
687
+ "query": {
688
+ "name": "get_target_subcellular_locations_by_ensemblID",
689
+ "arguments": {
690
+ "ensemblId": "ENSG00000121898"
691
+ }
692
+ }
693
+ },
694
+ {
695
+ "question": "What are the subcellular locations for the target identified by Ensembl ID 'ENSG00000274286'?",
696
+ "query": {
697
+ "name": "get_target_subcellular_locations_by_ensemblID",
698
+ "arguments": {
699
+ "ensemblId": "ENSG00000274286"
700
+ }
701
+ }
702
+ },
703
+ {
704
+ "question": "Please retrieve the subcellular location information for the target with Ensembl ID 'ENSG00000171843'.",
705
+ "query": {
706
+ "name": "get_target_subcellular_locations_by_ensemblID",
707
+ "arguments": {
708
+ "ensemblId": "ENSG00000171843"
709
+ }
710
+ }
711
+ }
712
+ ],
713
+ "label": [
714
+ "Target",
715
+ "Subcellular Locations",
716
+ "GraphQL",
717
+ "OpenTarget"
718
+ ],
719
+ "type": "OpenTarget"
720
+ },
721
+ {
722
+ "name": "get_target_synonyms_by_ensemblID",
723
+ "description": "Retrieve synonyms for specified target, including alternative names and symbols, using given ensemblID.",
724
+ "parameter": {
725
+ "type": "object",
726
+ "properties": {
727
+ "ensemblId": {
728
+ "type": "string",
729
+ "description": "The Ensembl ID of the target.",
730
+ "required": true
731
+ }
732
+ }
733
+ },
734
+ "query_schema": "\n query retrieveTargetSynonyms($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n synonyms {\n label\n source\n }\n symbolSynonyms {\n label\n source\n }\n nameSynonyms {\n label\n source\n }\n }\n }\n ",
735
+ "examples": [
736
+ {
737
+ "question": "Can you retrieve synonyms for the target with the Ensembl ID 'ENSG00000188986'?",
738
+ "query": {
739
+ "name": "get_target_synonyms_by_ensemblID",
740
+ "arguments": {
741
+ "ensemblId": "ENSG00000188986"
742
+ }
743
+ }
744
+ },
745
+ {
746
+ "question": "What are the alternative names and symbols for the target identified by Ensembl ID 'ENSG00000269335'?",
747
+ "query": {
748
+ "name": "get_target_synonyms_by_ensemblID",
749
+ "arguments": {
750
+ "ensemblId": "ENSG00000269335"
751
+ }
752
+ }
753
+ },
754
+ {
755
+ "question": "Please provide the synonyms for the target with Ensembl ID 'ENSG00000141052'.",
756
+ "query": {
757
+ "name": "get_target_synonyms_by_ensemblID",
758
+ "arguments": {
759
+ "ensemblId": "ENSG00000141052"
760
+ }
761
+ }
762
+ }
763
+ ],
764
+ "label": [
765
+ "OpenTarget",
766
+ "Target Information",
767
+ "GraphQL",
768
+ "Target"
769
+ ],
770
+ "type": "OpenTarget"
771
+ },
772
+ {
773
+ "name": "get_target_tractability_by_ensemblID",
774
+ "description": "Retrieve tractability assessments, including modality and values, for a specific target ensembl ID.",
775
+ "parameter": {
776
+ "type": "object",
777
+ "properties": {
778
+ "ensemblId": {
779
+ "type": "string",
780
+ "description": "The Ensembl ID of the target.",
781
+ "required": true
782
+ }
783
+ }
784
+ },
785
+ "query_schema": "\n query targetTractabilityAssessment($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n tractability {\n label\n modality\n value\n }\n }\n }\n ",
786
+ "examples": [
787
+ {
788
+ "question": "Can you retrieve the tractability assessment for the target with Ensembl ID 'ENSG00000141736'?",
789
+ "query": {
790
+ "name": "get_target_tractability_by_ensemblID",
791
+ "arguments": {
792
+ "ensemblId": "ENSG00000141736"
793
+ }
794
+ }
795
+ },
796
+ {
797
+ "question": "What are the tractability assessments for the target identified by Ensembl ID 'ENSG00000169249'?",
798
+ "query": {
799
+ "name": "get_target_tractability_by_ensemblID",
800
+ "arguments": {
801
+ "ensemblId": "ENSG00000169249"
802
+ }
803
+ }
804
+ },
805
+ {
806
+ "question": "Please provide the tractability assessment details for the target with Ensembl ID 'ENSG00000122548'.",
807
+ "query": {
808
+ "name": "get_target_tractability_by_ensemblID",
809
+ "arguments": {
810
+ "ensemblId": "ENSG00000122548"
811
+ }
812
+ }
813
+ }
814
+ ],
815
+ "label": [
816
+ "Target",
817
+ "Tractability",
818
+ "OpenTarget",
819
+ "Target Information",
820
+ "GraphQL"
821
+ ],
822
+ "type": "OpenTarget"
823
+ },
824
+ {
825
+ "name": "get_target_classes_by_ensemblID",
826
+ "description": "Retrieve the target classes associated with a specific target ensemblID.",
827
+ "parameter": {
828
+ "type": "object",
829
+ "properties": {
830
+ "ensemblId": {
831
+ "type": "string",
832
+ "description": "The Ensembl ID of the target.",
833
+ "required": true
834
+ }
835
+ }
836
+ },
837
+ "query_schema": "\n query fetchTargetClasses($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n targetClass {\n id\n label\n level\n }\n }\n }\n ",
838
+ "examples": [
839
+ {
840
+ "question": "Can you retrieve the target classes for the target with Ensembl ID 'ENSG00000185324'?",
841
+ "query": {
842
+ "name": "get_target_classes_by_ensemblID",
843
+ "arguments": {
844
+ "ensemblId": "ENSG00000185324"
845
+ }
846
+ }
847
+ },
848
+ {
849
+ "question": "What are the target classes associated with the Ensembl ID 'ENSG00000141646'?",
850
+ "query": {
851
+ "name": "get_target_classes_by_ensemblID",
852
+ "arguments": {
853
+ "ensemblId": "ENSG00000141646"
854
+ }
855
+ }
856
+ },
857
+ {
858
+ "question": "Please provide the target classes for the target identified by Ensembl ID 'ENSG00000141736'.",
859
+ "query": {
860
+ "name": "get_target_classes_by_ensemblID",
861
+ "arguments": {
862
+ "ensemblId": "ENSG00000141736"
863
+ }
864
+ }
865
+ }
866
+ ],
867
+ "label": [
868
+ "OpenTarget",
869
+ "Target Information",
870
+ "GraphQL",
871
+ "Target"
872
+ ],
873
+ "type": "OpenTarget"
874
+ },
875
+ {
876
+ "name": "get_target_enabling_packages_by_ensemblID",
877
+ "description": "Retrieve the Target Enabling Packages (TEP) associated with a specific target ensemblID.",
878
+ "parameter": {
879
+ "type": "object",
880
+ "properties": {
881
+ "ensemblId": {
882
+ "type": "string",
883
+ "description": "The Ensembl ID of the target.",
884
+ "required": true
885
+ }
886
+ }
887
+ },
888
+ "query_schema": "\n query fetchTargetEnablingPackages($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n tep {\n name\n uri\n therapeuticArea\n description\n }\n }\n }\n ",
889
+ "examples": [
890
+ {
891
+ "question": "Can you retrieve the Target Enabling Packages for the target with Ensembl ID 'ENSG00000167258'?",
892
+ "query": {
893
+ "name": "get_target_enabling_packages_by_ensemblID",
894
+ "arguments": {
895
+ "ensemblId": "ENSG00000167258"
896
+ }
897
+ }
898
+ }
899
+ ],
900
+ "label": [
901
+ "OpenTarget",
902
+ "Target Information",
903
+ "GraphQL",
904
+ "Target"
905
+ ],
906
+ "type": "OpenTarget"
907
+ },
908
+ {
909
+ "name": "get_target_interactions_by_ensemblID",
910
+ "description": "Retrieve interaction data for a specific target ensemblID, including interaction partners and evidence.",
911
+ "label": [
912
+ "Target",
913
+ "Interaction",
914
+ "Evidence",
915
+ "GraphQL",
916
+ "Pagination",
917
+ "OpenTarget"
918
+ ],
919
+ "parameter": {
920
+ "type": "object",
921
+ "properties": {
922
+ "ensemblId": {
923
+ "type": "string",
924
+ "description": "The Ensembl ID of the target.",
925
+ "required": true
926
+ },
927
+ "page": {
928
+ "type": "object",
929
+ "properties": {
930
+ "index": {
931
+ "type": "integer",
932
+ "description": "The index of the page to retrieve.",
933
+ "required": true
934
+ },
935
+ "size": {
936
+ "type": "integer",
937
+ "description": "The number of items per page.",
938
+ "required": true
939
+ }
940
+ },
941
+ "description": "Pagination parameters.",
942
+ "required": false
943
+ }
944
+ }
945
+ },
946
+ "query_schema": "\n query targetInteractions($ensemblId: String!, $page: Pagination!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n interactions(page: $page) {\n count\n rows {\n intA\n targetA {\n id\n approvedSymbol\n }\n intB\n targetB {\n id\n approvedSymbol\n }\n score\n sourceDatabase\n evidences {\n evidenceScore\n pubmedId\n interactionDetectionMethodShortName\n }\n }\n }\n }\n }\n ",
947
+ "examples": [
948
+ {
949
+ "question": "Can you retrieve interaction data for the target with Ensembl ID 'ENSG00000134508' from the source database 'BioGRID'?",
950
+ "query": {
951
+ "name": "target_interactions",
952
+ "arguments": {
953
+ "ensemblId": "ENSG00000134508",
954
+ "page": {
955
+ "index": 1,
956
+ "size": 10
957
+ }
958
+ }
959
+ }
960
+ },
961
+ {
962
+ "question": "What are the interaction partners and evidence for the target identified by Ensembl ID 'ENSG00000276601'?",
963
+ "query": {
964
+ "name": "target_interactions",
965
+ "arguments": {
966
+ "ensemblId": "ENSG00000276601",
967
+ "page": {
968
+ "index": 2,
969
+ "size": 5
970
+ }
971
+ }
972
+ }
973
+ },
974
+ {
975
+ "question": "Please provide the interaction data for the target with Ensembl ID 'ENSG00000287061' on the first page with 20 items per page.",
976
+ "query": {
977
+ "name": "target_interactions",
978
+ "arguments": {
979
+ "ensemblId": "ENSG00000287061",
980
+ "page": {
981
+ "index": 1,
982
+ "size": 20
983
+ }
984
+ }
985
+ }
986
+ }
987
+ ],
988
+ "type": "OpenTarget"
989
+ },
990
+ {
991
+ "name": "get_disease_ancestors_parents_by_efoId",
992
+ "description": "Retrieve the disease ancestors and parents in the ontology using the disease EFO ID.",
993
+ "parameter": {
994
+ "type": "object",
995
+ "properties": {
996
+ "efoId": {
997
+ "type": "string",
998
+ "description": "The EFO ID of the disease.",
999
+ "required": true
1000
+ }
1001
+ }
1002
+ },
1003
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n ancestors\n parents {\n id\n name\n }\n }\n }\n ",
1004
+ "label": [
1005
+ "OpenTarget",
1006
+ "Disease",
1007
+ "Disease Information",
1008
+ "GraphQL"
1009
+ ],
1010
+ "type": "OpenTarget"
1011
+ },
1012
+ {
1013
+ "name": "get_disease_descendants_children_by_efoId",
1014
+ "description": "Retrieve the disease descendants and children in the ontology using the disease EFO ID.",
1015
+ "parameter": {
1016
+ "type": "object",
1017
+ "properties": {
1018
+ "efoId": {
1019
+ "type": "string",
1020
+ "description": "The EFO ID of the disease.",
1021
+ "required": true
1022
+ }
1023
+ }
1024
+ },
1025
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n descendants\n children {\n id\n name\n }\n }\n }\n",
1026
+ "label": [
1027
+ "OpenTarget",
1028
+ "Disease",
1029
+ "Disease Information",
1030
+ "GraphQL"
1031
+ ],
1032
+ "type": "OpenTarget"
1033
+ },
1034
+ {
1035
+ "name": "get_disease_locations_by_efoId",
1036
+ "description": "Retrieve the disease's direct location and indirect location disease terms and IDs using the disease EFO ID.",
1037
+ "parameter": {
1038
+ "type": "object",
1039
+ "properties": {
1040
+ "efoId": {
1041
+ "type": "string",
1042
+ "description": "The EFO ID of the disease.",
1043
+ "required": true
1044
+ }
1045
+ }
1046
+ },
1047
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n directLocationIds\n indirectLocationIds\n directLocations {\n id\n name\n }\n indirectLocations {\n id\n name\n }\n }\n }\n ",
1048
+ "label": [
1049
+ "OpenTarget",
1050
+ "Disease",
1051
+ "Disease Information",
1052
+ "GraphQL"
1053
+ ],
1054
+ "type": "OpenTarget"
1055
+ },
1056
+ {
1057
+ "name": "get_disease_synonyms_by_efoId",
1058
+ "description": "Retrieve disease synonyms by its EFO ID.",
1059
+ "parameter": {
1060
+ "type": "object",
1061
+ "properties": {
1062
+ "efoId": {
1063
+ "type": "string",
1064
+ "description": "The EFO ID of the disease.",
1065
+ "required": true
1066
+ }
1067
+ }
1068
+ },
1069
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n synonyms {\n relation\n terms\n }\n }\n }\n",
1070
+ "label": [
1071
+ "OpenTarget",
1072
+ "Disease",
1073
+ "Disease Information",
1074
+ "GraphQL"
1075
+ ],
1076
+ "type": "OpenTarget"
1077
+ },
1078
+ {
1079
+ "name": "get_disease_description_by_efoId",
1080
+ "description": "Retrieve disease description, name, database cros references, obsolete terms, and whether it's a therapeutic area, all using the specified efoId.",
1081
+ "parameter": {
1082
+ "type": "object",
1083
+ "properties": {
1084
+ "efoId": {
1085
+ "type": "string",
1086
+ "description": "The EFO ID of the disease.",
1087
+ "required": true
1088
+ }
1089
+ }
1090
+ },
1091
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n description\n dbXRefs\n obsoleteTerms\n isTherapeuticArea\n }\n }\n ",
1092
+ "examples": [
1093
+ {
1094
+ "question": "Can you provide detailed information about the disease with the EFO ID 'MONDO_0000030'?",
1095
+ "query": {
1096
+ "name": "get_disease_description_by_efoId",
1097
+ "arguments": {
1098
+ "efoId": "MONDO_0000030"
1099
+ }
1100
+ }
1101
+ },
1102
+ {
1103
+ "question": "What are the details of the disease identified by the EFO ID 'EFO_0007468'?",
1104
+ "query": {
1105
+ "name": "get_disease_description_by_efoId",
1106
+ "arguments": {
1107
+ "efoId": "EFO_0007468"
1108
+ }
1109
+ }
1110
+ },
1111
+ {
1112
+ "question": "Please retrieve information about the disease with the EFO ID 'Orphanet_217563'.",
1113
+ "query": {
1114
+ "name": "get_disease_description_by_efoId",
1115
+ "arguments": {
1116
+ "efoId": "Orphanet_217563"
1117
+ }
1118
+ }
1119
+ }
1120
+ ],
1121
+ "label": [
1122
+ "OpenTarget",
1123
+ "Disease",
1124
+ "Disease Information",
1125
+ "GraphQL"
1126
+ ],
1127
+ "type": "OpenTarget"
1128
+ },
1129
+ {
1130
+ "name": "get_disease_therapeutic_areas_by_efoId",
1131
+ "description": "Retrieve the therapeutic areas associated with a specific disease efoId.",
1132
+ "parameter": {
1133
+ "type": "object",
1134
+ "properties": {
1135
+ "efoId": {
1136
+ "type": "string",
1137
+ "description": "The EFO ID of the disease.",
1138
+ "required": true
1139
+ }
1140
+ }
1141
+ },
1142
+ "query_schema": "\n query diseaseTherapeuticAreas($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n therapeuticAreas {\n id\n name\n }\n }\n }\n ",
1143
+ "examples": [
1144
+ {
1145
+ "question": "What therapeutic areas are linked to the disease with the efoId 'MONDO_0016474'?",
1146
+ "query": {
1147
+ "name": "get_disease_therapeutic_areas_by_efoId",
1148
+ "arguments": {
1149
+ "efoId": "MONDO_0016474"
1150
+ }
1151
+ }
1152
+ },
1153
+ {
1154
+ "question": "Can you provide the therapeutic areas associated with the disease identified by efoId 'Orphanet_2579'?",
1155
+ "query": {
1156
+ "name": "get_disease_therapeutic_areas_by_efoId",
1157
+ "arguments": {
1158
+ "efoId": "Orphanet_2579"
1159
+ }
1160
+ }
1161
+ },
1162
+ {
1163
+ "question": "Please list the therapeutic areas for the disease with the efoId 'MONDO_0000873'.",
1164
+ "query": {
1165
+ "name": "get_disease_therapeutic_areas_by_efoId",
1166
+ "arguments": {
1167
+ "efoId": "MONDO_0000873"
1168
+ }
1169
+ }
1170
+ }
1171
+ ],
1172
+ "label": [
1173
+ "OpenTarget",
1174
+ "Disease",
1175
+ "TherapeuticArea",
1176
+ "GraphQL"
1177
+ ],
1178
+ "type": "OpenTarget"
1179
+ },
1180
+ {
1181
+ "name": "get_drug_adverse_events_by_chemblId",
1182
+ "description": "Retrieve significant adverse events reported for a specific drug chemblId.",
1183
+ "parameter": {
1184
+ "type": "object",
1185
+ "properties": {
1186
+ "chemblId": {
1187
+ "type": "string",
1188
+ "description": "The ChEMBL ID of the drug.",
1189
+ "required": true
1190
+ },
1191
+ "page": {
1192
+ "type": "object",
1193
+ "properties": {
1194
+ "index": {
1195
+ "type": "integer",
1196
+ "description": "Index of the page to fetch, starting from 0.",
1197
+ "required": true
1198
+ },
1199
+ "size": {
1200
+ "type": "integer",
1201
+ "description": "Number of entries per page.",
1202
+ "required": true
1203
+ }
1204
+ },
1205
+ "description": "Pagination settings.",
1206
+ "required": false
1207
+ }
1208
+ }
1209
+ },
1210
+ "query_schema": "\n query drugAdverseEvents($chemblId: String!, $page: Pagination!) {\n drug(chemblId: $chemblId) {\n id\n name\n adverseEvents(page: $page) {\n count\n criticalValue\n rows {\n name\n meddraCode\n count\n logLR\n }\n }\n }\n }\n ",
1211
+ "label": [
1212
+ "Drug",
1213
+ "AdverseEvents",
1214
+ "Safety",
1215
+ "Reporting",
1216
+ "Pagination",
1217
+ "OpenTarget",
1218
+ "GraphQL",
1219
+ "AdverseEvents"
1220
+ ],
1221
+ "type": "OpenTarget"
1222
+ },
1223
+ {
1224
+ "name": "get_known_drugs_by_drug_chemblId",
1225
+ "description": "Get a list of known drugs and associated information using the specified chemblId.",
1226
+ "parameter": {
1227
+ "type": "object",
1228
+ "properties": {
1229
+ "chemblId": {
1230
+ "type": "string",
1231
+ "description": "The ChEMBL ID of the drug.",
1232
+ "required": true
1233
+ }
1234
+ }
1235
+ },
1236
+ "query_schema": "\n query retrieveMultipleDrugsInfo($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n knownDrugs {\n uniqueDrugs\n uniqueDiseases\n uniqueTargets\n count\n cursor\n rows {\n approvedSymbol\n approvedName\n label\n prefName\n drugType\n targetId\n diseaseId\n drugId\n phase\n mechanismOfAction\n status\n targetClass\n references {\n source\n ids\n urls\n }\n ctIds\n urls {\n url\n name\n }\n disease {\n id\n name\n }\n target {\n id\n approvedSymbol\n }\n drug {\n id\n name\n }\n }\n }\n }\n }\n ",
1237
+ "label": [
1238
+ "OpenTarget",
1239
+ "Drug",
1240
+ "Drug Information",
1241
+ "GraphQL"
1242
+ ],
1243
+ "type": "OpenTarget"
1244
+ },
1245
+ {
1246
+ "name": "get_parent_child_molecules_by_drug_chembl_ID",
1247
+ "description": "Get parent and child molecules of specified drug chemblId.",
1248
+ "parameter": {
1249
+ "type": "object",
1250
+ "properties": {
1251
+ "chemblId": {
1252
+ "type": "string",
1253
+ "description": "The ChEMBL ID of the drug.",
1254
+ "required": true
1255
+ }
1256
+ }
1257
+ },
1258
+ "query_schema": "\n query retrieveMultipleDrugsInfo($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n parentMolecule {\n id\n name\n }\n childMolecules {\n id\n name\n }\n }\n }\n ",
1259
+ "label": [
1260
+ "OpenTarget",
1261
+ "Drug",
1262
+ "Drug Information",
1263
+ "GraphQL"
1264
+ ],
1265
+ "type": "OpenTarget"
1266
+ },
1267
+ {
1268
+ "name": "get_approved_indications_by_drug_chemblId",
1269
+ "description": "Retrieve detailed information about multiple drugs using a list of ChEMBL IDs.",
1270
+ "parameter": {
1271
+ "type": "object",
1272
+ "properties": {
1273
+ "chemblId": {
1274
+ "type": "string",
1275
+ "description": "The ChEMBL ID of the drug.",
1276
+ "required": true
1277
+ }
1278
+ }
1279
+ },
1280
+ "query_schema": "\n query retrieveMultipleDrugsInfo($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n approvedIndications\n }\n }\n ",
1281
+ "label": [
1282
+ "OpenTarget",
1283
+ "Drug",
1284
+ "Drug Information",
1285
+ "GraphQL"
1286
+ ],
1287
+ "type": "OpenTarget"
1288
+ },
1289
+ {
1290
+ "name": "get_drug_description_by_chemblId",
1291
+ "description": "Get drug name, year of first approval, type, cross references, and max clinical trial phase based on specified chemblId.",
1292
+ "parameter": {
1293
+ "type": "object",
1294
+ "properties": {
1295
+ "chemblId": {
1296
+ "type": "string",
1297
+ "description": "The ChEMBL ID of the drug.",
1298
+ "required": true
1299
+ }
1300
+ }
1301
+ },
1302
+ "query_schema": "\n query retrieveMultipleDrugsInfo($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n yearOfFirstApproval\n drugType\n crossReferences {\n source\n reference\n }\n maximumClinicalTrialPhase\n }\n }\n ",
1303
+ "label": [
1304
+ "OpenTarget",
1305
+ "Drug",
1306
+ "Drug Information",
1307
+ "GraphQL"
1308
+ ],
1309
+ "type": "OpenTarget"
1310
+ },
1311
+ {
1312
+ "name": "get_drug_synonyms_by_chemblId",
1313
+ "description": "Retrieve the synonyms associated with a specific drug chemblId.",
1314
+ "parameter": {
1315
+ "type": "object",
1316
+ "properties": {
1317
+ "chemblId": {
1318
+ "type": "string",
1319
+ "description": "The ChEMBL ID of the drug.",
1320
+ "required": true
1321
+ }
1322
+ }
1323
+ },
1324
+ "query_schema": "\n query drugSynonyms($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n synonyms\n }\n }\n ",
1325
+ "examples": [
1326
+ {
1327
+ "question": "Can you provide the synonyms for the drug with ChEMBL ID 'CHEMBL2021430'?",
1328
+ "query": {
1329
+ "name": "drug_synget_drug_synonyms_by_chemblIdonyms",
1330
+ "arguments": {
1331
+ "chemblId": "CHEMBL2021430"
1332
+ }
1333
+ }
1334
+ },
1335
+ {
1336
+ "question": "What are the synonyms associated with the drug identified by ChEMBL ID 'CHEMBL295698'?",
1337
+ "query": {
1338
+ "name": "get_drug_synonyms_by_chemblId",
1339
+ "arguments": {
1340
+ "chemblId": "CHEMBL295698"
1341
+ }
1342
+ }
1343
+ },
1344
+ {
1345
+ "question": "Please list the synonyms for the drug that has the ChEMBL ID 'CHEMBL1084617'.",
1346
+ "query": {
1347
+ "name": "get_drug_synonyms_by_chemblId",
1348
+ "arguments": {
1349
+ "chemblId": "CHEMBL1084617"
1350
+ }
1351
+ }
1352
+ }
1353
+ ],
1354
+ "label": [
1355
+ "OpenTarget",
1356
+ "Drug Information",
1357
+ "Drug",
1358
+ "GraphQL"
1359
+ ],
1360
+ "type": "OpenTarget"
1361
+ },
1362
+ {
1363
+ "name": "get_drug_trade_names_by_chemblId",
1364
+ "description": "Retrieve the trade names associated with a specific drug chemblId.",
1365
+ "parameter": {
1366
+ "type": "object",
1367
+ "properties": {
1368
+ "chemblId": {
1369
+ "type": "string",
1370
+ "description": "The ChEMBL ID of the drug.",
1371
+ "required": true
1372
+ }
1373
+ }
1374
+ },
1375
+ "query_schema": "\n query drugTradeNames($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n tradeNames\n }\n }\n ",
1376
+ "examples": [
1377
+ {
1378
+ "question": "What are the trade names for the drug with ChEMBL ID 'CHEMBL25'?",
1379
+ "query": {
1380
+ "name": "get_drug_trade_names_by_chemblId",
1381
+ "arguments": {
1382
+ "chemblId": "CHEMBL25"
1383
+ }
1384
+ }
1385
+ },
1386
+ {
1387
+ "question": "Can you provide the trade names associated with the drug identified by ChEMBL ID 'CHEMBL1201613'?",
1388
+ "query": {
1389
+ "name": "get_drug_trade_names_by_chemblId",
1390
+ "arguments": {
1391
+ "chemblId": "CHEMBL1201613"
1392
+ }
1393
+ }
1394
+ },
1395
+ {
1396
+ "question": "Please list the trade names for the drug that has the ChEMBL ID 'CHEMBL3182621'.",
1397
+ "query": {
1398
+ "name": "get_drug_trade_names_by_chemblId",
1399
+ "arguments": {
1400
+ "chemblId": "CHEMBL3182621"
1401
+ }
1402
+ }
1403
+ }
1404
+ ],
1405
+ "label": [
1406
+ "Drug",
1407
+ "OpenTarget",
1408
+ "Drug Information",
1409
+ "GraphQL"
1410
+ ],
1411
+ "type": "OpenTarget"
1412
+ },
1413
+ {
1414
+ "name": "get_drug_approval_status_by_chemblId",
1415
+ "description": "Retrieve the approval status of a specific drug chemblId.",
1416
+ "parameter": {
1417
+ "type": "object",
1418
+ "properties": {
1419
+ "chemblId": {
1420
+ "type": "string",
1421
+ "description": "The ChEMBL ID of the drug.",
1422
+ "required": true
1423
+ }
1424
+ }
1425
+ },
1426
+ "query_schema": "\n query drugApprovalStatus($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n isApproved\n }\n }\n ",
1427
+ "examples": [
1428
+ {
1429
+ "question": "What is the approval status of the drug with ChEMBL ID 'CHEMBL2103799'?",
1430
+ "query": {
1431
+ "name": "get_drug_approval_status_by_chemblId",
1432
+ "arguments": {
1433
+ "chemblId": "CHEMBL2103799"
1434
+ }
1435
+ }
1436
+ },
1437
+ {
1438
+ "question": "Can you tell me if the drug identified by ChEMBL ID 'CHEMBL1684' is approved?",
1439
+ "query": {
1440
+ "name": "get_drug_approval_status_by_chemblId",
1441
+ "arguments": {
1442
+ "chemblId": "CHEMBL1684"
1443
+ }
1444
+ }
1445
+ },
1446
+ {
1447
+ "question": "Please provide the approval status for the drug with ChEMBL ID 'CHEMBL1086997'.",
1448
+ "query": {
1449
+ "name": "get_drug_approval_status_by_chemblId",
1450
+ "arguments": {
1451
+ "chemblId": "CHEMBL1086997"
1452
+ }
1453
+ }
1454
+ }
1455
+ ],
1456
+ "label": [
1457
+ "Drug",
1458
+ "Drug Information",
1459
+ "GraphQL",
1460
+ "OpenTarget"
1461
+ ],
1462
+ "type": "OpenTarget"
1463
+ },
1464
+ {
1465
+ "name": "get_chemical_probes_by_target_ensemblID",
1466
+ "description": "Retrieve chemical probes associated with a specific target using its ensemblID.",
1467
+ "parameter": {
1468
+ "type": "object",
1469
+ "properties": {
1470
+ "ensemblId": {
1471
+ "type": "string",
1472
+ "description": "The Ensembl ID of the target for which to retrieve chemical probes.",
1473
+ "required": true
1474
+ }
1475
+ }
1476
+ },
1477
+ "query_schema": "\n query getTargetChemicalProbes($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n chemicalProbes {\n id\n control\n drugId\n mechanismOfAction\n isHighQuality\n origin\n probeMinerScore\n probesDrugsScore\n scoreInCells\n scoreInOrganisms\n targetFromSourceId\n urls {\n niceName\n url\n }\n }\n }\n }\n ",
1478
+ "examples": [
1479
+ {
1480
+ "question": "Can you retrieve the chemical probes for the target with Ensembl ID 'ENSG00000163515'?",
1481
+ "query": {
1482
+ "name": "get_chemical_probes_by_target_ensemblID",
1483
+ "arguments": {
1484
+ "ensemblId": "ENSG00000163515"
1485
+ }
1486
+ }
1487
+ },
1488
+ {
1489
+ "question": "What chemical probes are associated with the target identified by Ensembl ID 'ENSG00000157916'?",
1490
+ "query": {
1491
+ "name": "get_chemical_probes_by_target_ensemblID",
1492
+ "arguments": {
1493
+ "ensemblId": "ENSG00000157916"
1494
+ }
1495
+ }
1496
+ },
1497
+ {
1498
+ "question": "Please list the chemical probes linked to the target with Ensembl ID 'ENSG00000253563'.",
1499
+ "query": {
1500
+ "name": "get_chemical_probes_by_target_ensemblID",
1501
+ "arguments": {
1502
+ "ensemblId": "ENSG00000253563"
1503
+ }
1504
+ }
1505
+ }
1506
+ ],
1507
+ "label": [
1508
+ "OpenTarget",
1509
+ "Drug Information",
1510
+ "ChemicalProbe",
1511
+ "GraphQL"
1512
+ ],
1513
+ "type": "OpenTarget"
1514
+ },
1515
+ {
1516
+ "name": "drug_pharmacogenomics_data",
1517
+ "description": "Retrieve pharmacogenomics data for a specific drug, including evidence levels and genotype annotations.",
1518
+ "label": [
1519
+ "Drug",
1520
+ "Pharmacogenomics",
1521
+ "Evidence",
1522
+ "Genotype",
1523
+ "Pagination",
1524
+ "OpenTarget",
1525
+ "GraphQL"
1526
+ ],
1527
+ "parameter": {
1528
+ "type": "object",
1529
+ "properties": {
1530
+ "chemblId": {
1531
+ "type": "string",
1532
+ "description": "The ChEMBL ID of the drug.",
1533
+ "required": true
1534
+ },
1535
+ "page": {
1536
+ "type": "object",
1537
+ "description": "Pagination options.",
1538
+ "properties": {
1539
+ "index": {
1540
+ "type": "integer",
1541
+ "description": "Pagination index.",
1542
+ "required": true
1543
+ },
1544
+ "size": {
1545
+ "type": "integer",
1546
+ "description": "Number of records to fetch per page.",
1547
+ "required": true
1548
+ }
1549
+ },
1550
+ "required": false
1551
+ }
1552
+ }
1553
+ },
1554
+ "query_schema": "\n query drugPharmacogenomicsData($chemblId: String!, $page: Pagination!) {\n drug(chemblId: $chemblId) {\n id\n name\n pharmacogenomics(page: $page) {\n datasourceId\n datatypeId\n genotype\n evidenceLevel\n genotypeAnnotationText\n genotypeId\n haplotypeFromSourceId\n haplotypeId\n literature\n pgxCategory\n phenotypeFromSourceId\n phenotypeText\n studyId\n targetFromSourceId\n variantFunctionalConsequenceId\n variantRsId\n isDirectTarget\n variantFunctionalConsequence {\n id\n label\n }\n drugs {\n drugId\n drug {\n name\n }\n }\n target {\n id\n approvedSymbol\n }\n }\n }\n }\n ",
1555
+ "examples": [
1556
+ {
1557
+ "question": "Can you provide the pharmacogenomics data for the drug with ChEMBL ID 'CHEMBL23261'?",
1558
+ "query": {
1559
+ "name": "drug_pharmacogenomics_data",
1560
+ "arguments": {
1561
+ "chemblId": "CHEMBL23261",
1562
+ "page": {
1563
+ "index": 1,
1564
+ "size": 10
1565
+ }
1566
+ }
1567
+ }
1568
+ },
1569
+ {
1570
+ "question": "What are the genotype annotations and evidence levels for the drug identified by ChEMBL ID 'CHEMBL1497'?",
1571
+ "query": {
1572
+ "name": "drug_pharmacogenomics_data",
1573
+ "arguments": {
1574
+ "chemblId": "CHEMBL1497",
1575
+ "page": {
1576
+ "index": 2,
1577
+ "size": 5
1578
+ }
1579
+ }
1580
+ }
1581
+ },
1582
+ {
1583
+ "question": "Retrieve the pharmacogenomics data for the drug with ChEMBL ID 'CHEMBL4455124', including evidence levels.",
1584
+ "query": {
1585
+ "name": "drug_pharmacogenomics_data",
1586
+ "arguments": {
1587
+ "chemblId": "CHEMBL4455124",
1588
+ "page": {
1589
+ "index": 3,
1590
+ "size": 15
1591
+ }
1592
+ }
1593
+ }
1594
+ }
1595
+ ],
1596
+ "type": "OpenTarget"
1597
+ },
1598
+ {
1599
+ "name": "get_associated_drugs_by_target_ensemblID",
1600
+ "description": "Get known drugs associated with a specific target ensemblID, including clinical trial phase and mechanism of action of the drugs.",
1601
+ "parameter": {
1602
+ "type": "object",
1603
+ "properties": {
1604
+ "ensemblId": {
1605
+ "type": "string",
1606
+ "description": "The Ensembl ID of the target.",
1607
+ "required": true
1608
+ },
1609
+ "size": {
1610
+ "type": "integer",
1611
+ "description": "Number of entries to fetch.",
1612
+ "required": true
1613
+ },
1614
+ "cursor": {
1615
+ "type": "string",
1616
+ "description": "Cursor for pagination.",
1617
+ "required": false
1618
+ }
1619
+ }
1620
+ },
1621
+ "query_schema": "\n query targetKnownDrugs($ensemblId: String!, $size: Int!, $cursor: String) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n knownDrugs(size: $size, cursor: $cursor) {\n count\n rows {\n drug {\n id\n name\n tradeNames\n maximumClinicalTrialPhase\n isApproved\n hasBeenWithdrawn\n }\n phase\n status\n mechanismOfAction\n disease {\n id\n name\n }\n }\n }\n }\n }\n ",
1622
+ "examples": [
1623
+ {
1624
+ "question": "Can you retrieve known drugs associated with the target having Ensembl ID 'ENSG00000141736' and fetch 10 entries?",
1625
+ "query": {
1626
+ "name": "get_associated_drugs_by_target_ensemblID",
1627
+ "arguments": {
1628
+ "ensemblId": "ENSG00000141736",
1629
+ "size": 10
1630
+ }
1631
+ }
1632
+ },
1633
+ {
1634
+ "question": "What are the known drugs for the target with Ensembl ID 'ENSG00000184182', and can you provide 5 entries?",
1635
+ "query": {
1636
+ "name": "get_associated_drugs_by_target_ensemblID",
1637
+ "arguments": {
1638
+ "ensemblId": "ENSG00000184182",
1639
+ "size": 5
1640
+ }
1641
+ }
1642
+ },
1643
+ {
1644
+ "question": "Please list the known drugs associated with the target identified by Ensembl ID 'ENSG00000104884', and fetch 15 entries. Use the cursor 'abc123' for pagination.",
1645
+ "query": {
1646
+ "name": "get_associated_drugs_by_target_ensemblID",
1647
+ "arguments": {
1648
+ "ensemblId": "ENSG00000104884",
1649
+ "size": 15,
1650
+ "cursor": "abc123"
1651
+ }
1652
+ }
1653
+ }
1654
+ ],
1655
+ "label": [
1656
+ "Target",
1657
+ "Drug",
1658
+ "MechanismsOfAction",
1659
+ "Pagination",
1660
+ "OpenTarget",
1661
+ "GraphQL"
1662
+ ],
1663
+ "type": "OpenTarget"
1664
+ },
1665
+ {
1666
+ "name": "get_associated_diseases_by_drug_chemblId",
1667
+ "description": "Retrieve the list of diseases associated with a specific drug chemblId based on clinical trial data or post-marketed drugs.",
1668
+ "parameter": {
1669
+ "type": "object",
1670
+ "properties": {
1671
+ "chemblId": {
1672
+ "type": "string",
1673
+ "description": "The ChEMBL ID of the drug.",
1674
+ "required": true
1675
+ }
1676
+ }
1677
+ },
1678
+ "query_schema": "\n query fetchLinkedDiseasesForDrug($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n linkedDiseases {\n count\n rows {\n id\n name\n description\n }\n }\n }\n }\n ",
1679
+ "examples": [
1680
+ {
1681
+ "question": "Can you retrieve the list of diseases linked to the drug with ChEMBL ID 'CHEMBL3137349'?",
1682
+ "query": {
1683
+ "name": "get_associated_diseases_by_drug_chemblId",
1684
+ "arguments": {
1685
+ "chemblId": "CHEMBL3137349"
1686
+ }
1687
+ }
1688
+ },
1689
+ {
1690
+ "question": "What diseases are associated with the drug identified by ChEMBL ID 'CHEMBL1389'?",
1691
+ "query": {
1692
+ "name": "get_associated_diseases_by_drug_chemblId",
1693
+ "arguments": {
1694
+ "chemblId": "CHEMBL1389"
1695
+ }
1696
+ }
1697
+ },
1698
+ {
1699
+ "question": "Please provide the diseases linked to the drug that has the ChEMBL ID 'CHEMBL2109266'.",
1700
+ "query": {
1701
+ "name": "get_associated_diseases_by_drug_chemblId",
1702
+ "arguments": {
1703
+ "chemblId": "CHEMBL2109266"
1704
+ }
1705
+ }
1706
+ }
1707
+ ],
1708
+ "label": [
1709
+ "Drug",
1710
+ "Disease",
1711
+ "OpenTarget",
1712
+ "Drug Information",
1713
+ "GraphQL"
1714
+ ],
1715
+ "type": "OpenTarget"
1716
+ },
1717
+ {
1718
+ "name": "get_associated_targets_by_drug_chemblId",
1719
+ "description": "Retrieve the list of targets linked to a specific drug chemblId based on its mechanism of action.",
1720
+ "parameter": {
1721
+ "type": "object",
1722
+ "properties": {
1723
+ "chemblId": {
1724
+ "type": "string",
1725
+ "description": "The ChEMBL ID of the drug.",
1726
+ "required": true
1727
+ }
1728
+ }
1729
+ },
1730
+ "query_schema": "\n query fetchLinkedTargetsForDrug($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n linkedTargets {\n count\n rows {\n id\n approvedSymbol\n approvedName\n }\n }\n }\n }\n ",
1731
+ "examples": [
1732
+ {
1733
+ "question": "Can you retrieve the list of targets linked to the drug with ChEMBL ID 'CHEMBL459008'?",
1734
+ "query": {
1735
+ "name": "get_associated_targets_by_drug_chemblId",
1736
+ "arguments": {
1737
+ "chemblId": "CHEMBL459008"
1738
+ }
1739
+ }
1740
+ },
1741
+ {
1742
+ "question": "What are the targets associated with the drug identified by ChEMBL ID 'CHEMBL1800955'?",
1743
+ "query": {
1744
+ "name": "get_associated_targets_by_drug_chemblId",
1745
+ "arguments": {
1746
+ "chemblId": "CHEMBL1800955"
1747
+ }
1748
+ }
1749
+ },
1750
+ {
1751
+ "question": "Please provide the list of targets for the drug with ChEMBL ID 'CHEMBL32'.",
1752
+ "query": {
1753
+ "name": "get_associated_targets_by_drug_chemblId",
1754
+ "arguments": {
1755
+ "chemblId": "CHEMBL32"
1756
+ }
1757
+ }
1758
+ }
1759
+ ],
1760
+ "label": [
1761
+ "Drug",
1762
+ "Target",
1763
+ "MechanismsOfAction",
1764
+ "OpenTarget",
1765
+ "GraphQL"
1766
+ ],
1767
+ "type": "OpenTarget"
1768
+ },
1769
+ {
1770
+ "name": "multi_entity_search_by_query_string",
1771
+ "description": "Perform a multi-entity search based on a query string, filtering by entity names and pagination settings.",
1772
+ "parameter": {
1773
+ "type": "object",
1774
+ "properties": {
1775
+ "queryString": {
1776
+ "type": "string",
1777
+ "description": "The search string for querying information.",
1778
+ "required": true
1779
+ },
1780
+ "entityNames": {
1781
+ "type": "array",
1782
+ "items": {
1783
+ "type": "string"
1784
+ },
1785
+ "description": "List of entity names to search for (e.g., target, disease, drug).",
1786
+ "required": false
1787
+ },
1788
+ "page": {
1789
+ "type": "object",
1790
+ "properties": {
1791
+ "index": {
1792
+ "type": "integer",
1793
+ "description": "Pagination index.",
1794
+ "required": "True"
1795
+ },
1796
+ "size": {
1797
+ "type": "integer",
1798
+ "description": "Pagination size.",
1799
+ "required": "True"
1800
+ }
1801
+ },
1802
+ "description": "Pagination settings with index and size.",
1803
+ "required": false
1804
+ }
1805
+ }
1806
+ },
1807
+ "query_schema": "\n query multiEntitySearch($queryString: String!, $entityNames: [String!], $page: Pagination) {\n search(queryString: $queryString, entityNames: $entityNames, page: $page) {\n total\n hits {\n id\n entity\n description\n name\n score\n }\n }\n }\n ",
1808
+ "examples": [
1809
+ {
1810
+ "question": "Can you search for information on the drug 'Aspirin' and the disease 'Hypertension'?",
1811
+ "query": {
1812
+ "name": "multi_entity_search_by_query_string",
1813
+ "arguments": {
1814
+ "queryString": "Aspirin Hypertension",
1815
+ "entityNames": [
1816
+ "drug",
1817
+ "disease"
1818
+ ],
1819
+ "page": {
1820
+ "index": 1,
1821
+ "size": 10
1822
+ }
1823
+ }
1824
+ }
1825
+ },
1826
+ {
1827
+ "question": "Please find details about the target 'BRCA1' with pagination settings of index 2 and size 5.",
1828
+ "query": {
1829
+ "name": "multi_entity_search_by_query_string",
1830
+ "arguments": {
1831
+ "queryString": "BRCA1",
1832
+ "entityNames": [
1833
+ "target"
1834
+ ],
1835
+ "page": {
1836
+ "index": 2,
1837
+ "size": 5
1838
+ }
1839
+ }
1840
+ }
1841
+ },
1842
+ {
1843
+ "question": "What information is available for the disease 'Diabetes'?",
1844
+ "query": {
1845
+ "name": "multi_entity_search_by_query_string",
1846
+ "arguments": {
1847
+ "queryString": "Diabetes",
1848
+ "entityNames": [
1849
+ "disease"
1850
+ ]
1851
+ }
1852
+ }
1853
+ }
1854
+ ],
1855
+ "label": [
1856
+ "Search and Mapping Functions",
1857
+ "MultiEntitySearch",
1858
+ "Pagination",
1859
+ "OpenTarget",
1860
+ "GraphQL"
1861
+ ],
1862
+ "type": "OpenTarget"
1863
+ },
1864
+ {
1865
+ "name": "get_gene_ontology_terms_by_goID",
1866
+ "description": "Retrieve Gene Ontology terms based on a list of GO IDs.",
1867
+ "parameter": {
1868
+ "type": "object",
1869
+ "properties": {
1870
+ "goIds": {
1871
+ "type": "array",
1872
+ "items": {
1873
+ "type": "string"
1874
+ },
1875
+ "description": "A list of Gene Ontology (GO) IDs to fetch the corresponding terms.",
1876
+ "required": true
1877
+ }
1878
+ }
1879
+ },
1880
+ "query_schema": "\n query fetchGeneOntologyTerms($goIds: [String!]!) {\n geneOntologyTerms(goIds: $goIds) {\n id\n name\n }\n }\n ",
1881
+ "examples": [
1882
+ {
1883
+ "question": "Can you retrieve the Gene Ontology terms for the GO IDs 'GO:0008150' and 'GO:0003674'?",
1884
+ "query": {
1885
+ "name": "fetch_gene_ontology_terms",
1886
+ "arguments": {
1887
+ "goIds": [
1888
+ "GO:0008150",
1889
+ "GO:0003674"
1890
+ ]
1891
+ }
1892
+ }
1893
+ },
1894
+ {
1895
+ "question": "What are the Gene Ontology terms associated with the GO IDs 'GO:0005575', 'GO:0003674', and 'GO:0008150'?",
1896
+ "query": {
1897
+ "name": "fetch_gene_ontology_terms",
1898
+ "arguments": {
1899
+ "goIds": [
1900
+ "GO:0005575",
1901
+ "GO:0003674",
1902
+ "GO:0008150"
1903
+ ]
1904
+ }
1905
+ }
1906
+ },
1907
+ {
1908
+ "question": "Please provide the Gene Ontology terms for the following GO IDs: 'GO:0008150', 'GO:0003674', 'GO:0005575', and 'GO:0003677'.",
1909
+ "query": {
1910
+ "name": "fetch_gene_ontology_terms",
1911
+ "arguments": {
1912
+ "goIds": [
1913
+ "GO:0008150",
1914
+ "GO:0003674",
1915
+ "GO:0005575",
1916
+ "GO:0003677"
1917
+ ]
1918
+ }
1919
+ }
1920
+ }
1921
+ ],
1922
+ "label": [
1923
+ "GeneOntology",
1924
+ "Data Retrieval and Aggregation",
1925
+ "OpenTarget",
1926
+ "GraphQL"
1927
+ ],
1928
+ "type": "OpenTarget"
1929
+ },
1930
+ {
1931
+ "name": "get_target_constraint_info_by_ensemblID",
1932
+ "description": "Retrieve genetic constraint information for a specific target ensemblID, including expected and observed values, and scores.",
1933
+ "parameter": {
1934
+ "type": "object",
1935
+ "properties": {
1936
+ "ensemblId": {
1937
+ "type": "string",
1938
+ "description": "The Ensembl ID of the target.",
1939
+ "required": true
1940
+ }
1941
+ }
1942
+ },
1943
+ "query_schema": "\n query targetConstraintInfo($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n geneticConstraint {\n constraintType\n exp\n obs\n oe\n oeLower\n oeUpper\n score\n upperBin\n upperBin6\n upperRank\n }\n }\n }\n ",
1944
+ "examples": [
1945
+ {
1946
+ "question": "Can you provide the genetic constraint information for the target with Ensembl ID 'ENSG00000135476'?",
1947
+ "query": {
1948
+ "name": "target_constraint_info",
1949
+ "arguments": {
1950
+ "ensemblId": "ENSG00000135476"
1951
+ }
1952
+ }
1953
+ },
1954
+ {
1955
+ "question": "What are the expected and observed values, and scores for the target identified by Ensembl ID 'ENSG00000290763'?",
1956
+ "query": {
1957
+ "name": "target_constraint_info",
1958
+ "arguments": {
1959
+ "ensemblId": "ENSG00000290763"
1960
+ }
1961
+ }
1962
+ },
1963
+ {
1964
+ "question": "Please retrieve the genetic constraint details for the target with Ensembl ID 'ENSG00000109906'.",
1965
+ "query": {
1966
+ "name": "target_constraint_info",
1967
+ "arguments": {
1968
+ "ensemblId": "ENSG00000109906"
1969
+ }
1970
+ }
1971
+ }
1972
+ ],
1973
+ "label": [
1974
+ "Target",
1975
+ "Constraint",
1976
+ "Data Retrieval and Aggregation",
1977
+ "OpenTarget",
1978
+ "GraphQL"
1979
+ ],
1980
+ "type": "OpenTarget"
1981
+ },
1982
+ {
1983
+ "name": "get_publications_by_disease_efoId",
1984
+ "description": "Retrieve publications related to a disease efoId, including PubMed IDs and publication dates.",
1985
+ "parameter": {
1986
+ "type": "object",
1987
+ "properties": {
1988
+ "entityId": {
1989
+ "type": "string",
1990
+ "description": "The ID of the entity (efoId).",
1991
+ "required": true
1992
+ },
1993
+ "additionalIds": {
1994
+ "type": "array",
1995
+ "items": {
1996
+ "type": "string"
1997
+ },
1998
+ "description": "List of additional IDs to include in the search.",
1999
+ "required": false
2000
+ },
2001
+ "startYear": {
2002
+ "type": "integer",
2003
+ "description": "Year at the lower end of the filter.",
2004
+ "required": false
2005
+ },
2006
+ "startMonth": {
2007
+ "type": "integer",
2008
+ "description": "Month at the lower end of the filter.",
2009
+ "required": false
2010
+ },
2011
+ "endYear": {
2012
+ "type": "integer",
2013
+ "description": "Year at the higher end of the filter.",
2014
+ "required": false
2015
+ },
2016
+ "endMonth": {
2017
+ "type": "integer",
2018
+ "description": "Month at the higher end of the filter.",
2019
+ "required": false
2020
+ }
2021
+ }
2022
+ },
2023
+ "query_schema": "\n query entityPublications($entityId: String!, $additionalIds: [String!], $startYear: Int, $startMonth: Int, $endYear: Int, $endMonth: Int) {\n disease(efoId: $entityId) {\n id\n name\n literatureOcurrences(additionalIds: $additionalIds, startYear: $startYear, startMonth: $startMonth, endYear: $endYear, endMonth: $endMonth) {\n count\n filteredCount\n earliestPubYear\n rows {\n pmid\n pmcid\n publicationDate\n sentences {\n section\n matches {\n mappedId\n matchedLabel\n sectionStart\n sectionEnd\n startInSentence\n endInSentence\n matchedType\n }\n }\n }\n }\n }\n }\n ",
2024
+ "examples": [
2025
+ {
2026
+ "question": "Can you retrieve publications related to the entity with ID 'EFO_0000400'?",
2027
+ "query": {
2028
+ "name": "get_publications_by_disease_efoId",
2029
+ "arguments": {
2030
+ "entityId": "EFO_0000400"
2031
+ }
2032
+ }
2033
+ }
2034
+ ],
2035
+ "label": [
2036
+ "Publications",
2037
+ "Data Retrieval and Aggregation",
2038
+ "GraphQL",
2039
+ "OpenTarget"
2040
+ ],
2041
+ "type": "OpenTarget"
2042
+ },
2043
+ {
2044
+ "name": "get_publications_by_target_ensemblID",
2045
+ "description": "Retrieve publications related to a target ensemblID, including PubMed IDs and publication dates.",
2046
+ "parameter": {
2047
+ "type": "object",
2048
+ "properties": {
2049
+ "entityId": {
2050
+ "type": "string",
2051
+ "description": "The ID of the entity (ensemblID).",
2052
+ "required": true
2053
+ },
2054
+ "additionalIds": {
2055
+ "type": "array",
2056
+ "items": {
2057
+ "type": "string"
2058
+ },
2059
+ "description": "List of additional IDs to include in the search.",
2060
+ "required": false
2061
+ },
2062
+ "startYear": {
2063
+ "type": "integer",
2064
+ "description": "Year at the lower end of the filter.",
2065
+ "required": false
2066
+ },
2067
+ "startMonth": {
2068
+ "type": "integer",
2069
+ "description": "Month at the lower end of the filter.",
2070
+ "required": false
2071
+ },
2072
+ "endYear": {
2073
+ "type": "integer",
2074
+ "description": "Year at the higher end of the filter.",
2075
+ "required": false
2076
+ },
2077
+ "endMonth": {
2078
+ "type": "integer",
2079
+ "description": "Month at the higher end of the filter.",
2080
+ "required": false
2081
+ }
2082
+ }
2083
+ },
2084
+ "query_schema": "\n query entityPublications($entityId: String!, $additionalIds: [String!], $startYear: Int, $startMonth: Int, $endYear: Int, $endMonth: Int) {\n target(ensemblId: $entityId) {\n id\n approvedSymbol\n literatureOcurrences(additionalIds: $additionalIds, startYear: $startYear, startMonth: $startMonth, endYear: $endYear, endMonth: $endMonth) {\n count\n filteredCount\n earliestPubYear\n rows {\n pmid\n pmcid\n publicationDate\n sentences {\n section\n matches {\n mappedId\n matchedLabel\n sectionStart\n sectionEnd\n startInSentence\n endInSentence\n matchedType\n }\n }\n }\n }\n }\n }\n ",
2085
+ "label": [
2086
+ "Publications",
2087
+ "Data Retrieval and Aggregation",
2088
+ "GraphQL",
2089
+ "OpenTarget"
2090
+ ],
2091
+ "type": "OpenTarget"
2092
+ },
2093
+ {
2094
+ "name": "get_publications_by_drug_chemblId",
2095
+ "description": "Retrieve publications related to a drug chemblId, including PubMed IDs and publication dates.",
2096
+ "parameter": {
2097
+ "type": "object",
2098
+ "properties": {
2099
+ "entityId": {
2100
+ "type": "string",
2101
+ "description": "The ID of the entity (chemblId).",
2102
+ "required": true
2103
+ },
2104
+ "additionalIds": {
2105
+ "type": "array",
2106
+ "items": {
2107
+ "type": "string"
2108
+ },
2109
+ "description": "List of additional IDs to include in the search.",
2110
+ "required": false
2111
+ },
2112
+ "startYear": {
2113
+ "type": "integer",
2114
+ "description": "Year at the lower end of the filter.",
2115
+ "required": false
2116
+ },
2117
+ "startMonth": {
2118
+ "type": "integer",
2119
+ "description": "Month at the lower end of the filter.",
2120
+ "required": false
2121
+ },
2122
+ "endYear": {
2123
+ "type": "integer",
2124
+ "description": "Year at the higher end of the filter.",
2125
+ "required": false
2126
+ },
2127
+ "endMonth": {
2128
+ "type": "integer",
2129
+ "description": "Month at the higher end of the filter.",
2130
+ "required": false
2131
+ }
2132
+ }
2133
+ },
2134
+ "query_schema": "\n query entityPublications($entityId: String!, $additionalIds: [String!], $startYear: Int, $startMonth: Int, $endYear: Int, $endMonth: Int) {\n drug(chemblId: $entityId) {\n id\n name\n literatureOcurrences(additionalIds: $additionalIds, startYear: $startYear, startMonth: $startMonth, endYear: $endYear, endMonth: $endMonth) {\n count\n filteredCount\n earliestPubYear\n rows {\n pmid\n pmcid\n publicationDate\n sentences {\n section\n matches {\n mappedId\n matchedLabel\n sectionStart\n sectionEnd\n startInSentence\n endInSentence\n matchedType\n }\n }\n }\n }\n }\n }\n ",
2135
+ "label": [
2136
+ "Publications",
2137
+ "Data Retrieval and Aggregation",
2138
+ "GraphQL",
2139
+ "OpenTarget"
2140
+ ],
2141
+ "type": "OpenTarget"
2142
+ },
2143
+ {
2144
+ "name": "get_target_id_description_by_name",
2145
+ "description": "Get the ensemblId and description based on the target name.",
2146
+ "parameter": {
2147
+ "type": "object",
2148
+ "properties": {
2149
+ "targetName": {
2150
+ "type": "string",
2151
+ "description": "The name of the target for which the ID is required.",
2152
+ "required": true
2153
+ }
2154
+ }
2155
+ },
2156
+ "query_schema": "\n query getTargetIdByName($targetName: String!) {\n search(queryString: $targetName, entityNames: [\"target\"]) {\n hits {\n id\n name\n description\n }\n }\n }\n ",
2157
+ "label": [
2158
+ "Search",
2159
+ "Name",
2160
+ "Target",
2161
+ "OpenTarget",
2162
+ "GraphQL"
2163
+ ],
2164
+ "type": "OpenTarget"
2165
+ }
2166
+ ]
utils.py CHANGED
@@ -9,20 +9,9 @@ from oauth2client.service_account import ServiceAccountCredentials
9
  import pandas as pd
10
  import json
11
  import gradio as gr
 
12
 
13
- GSERVICE_ACCOUNT_INFO = {
14
- "type": "service_account",
15
- "project_id": "txagent",
16
- "private_key_id": "cc1a12e427917244a93faf6f19e72b589a685e65",
17
- "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDPEoNWIhiMdXA+\ncuwLgo06WUS5Jqe5dTAUJXZ6r5rLvSIqkuTt8xHQZJ1p5Itg8ywjONz/0R04jbHx\nalTlg0fgIu+6AU+oMb7HNZ9twG0O/A+M/NdGJKb8asj5jaEoSlWBT6lpSUvaZn+T\nulsyW147g0H5EtXBeh40zs7m2Q3kv1TzeCBuUlRRHx66EAeDwGwWiBXoxcanOINa\nrlZTFTGofhAGoz2Qm/L0hTIrjP/7DBg87Y5Z7eWbSjR944Ni5Fp0rfShuO+QZRrL\n+Cy9h11fKmuNfjWA3YlUfxmsERK2U867bXDGU8jJ3HTZ7/9D/kDunDJKF3xkJj+L\ng8mpsPGfAgMBAAECggEAOdQ7Po5GGc/gWWhh2HMMuutcQHL1q1r5Yt71gBzTl6uJ\nw6cDbRqRcofu2Dhd3mT7Ahkqyvyc8wLLW5bs/63SoFtRZLpiAyBlXZ/xlsaDDojB\nVQf1nN62jc7Ksrrlc2mTCIp1TvSLzQIMBfco6d7PacJl5cfnT2Gp1uicqqaadTOj\nLEr61ttO7eQ5g30hQvXnRwY5yXulKROOU5Zl6tESYRJZGAaV/KBKjnQgq3v+SV5o\n33q+g8IdKJtRqJIK66L04G916xOz0QhehToNHHC12K9XNCztNFI+CGnzZ3PKBZk9\naZUVVx3VGr7G9qqJzk4xmo6kY5rdlOjlKPqnls738QKBgQDw2lcfRMRqa1ag9wx6\nsez3oS+JPne/+NMGQn90V9seQb0Bp9jjYX9W4nICg5jtsZs9YKPsH0LhuVjPjQi0\nOLdZY0Ux9fJSeAB1GEffD3T5qUdJ5qCZn8QRuadBxkVm2mygIRsuiMSwxBiuwzed\no81aQ8/QlQqOUuKDDwhi3WjS0QKBgQDcGFDGnUZqDyQbxZCEI6toBlnKO9srJIWg\nIVsGsdRSzZzOXBwAjSS/ZEn1STywYPGKWE9lgP5hOtTn3oPGNeC2BXr+p4dvZVyl\nWAlsxgb/+8dI2cGQ+tYrhskozPyVtHSiUGf+8ghqVfuWLTDKSznccGYGPeIiNS1M\nxccATr05bwKBgQDc/EhBjVP2HIRAbkwJ62R0FHVMJH+1KPVd4feVZOLMER78/OcY\nQaWXr29R9TKErJe2KgxdIpW4C9p7nHhm+z7nChk77OCoYChzR5LyC/mU9IdPPAcQ\nzTEV3lSjGeslorVV+uo4uQ5W7aWD++P0hI1vC5cKVyV3Tn88JrfYFjQOcQKBgQCG\nlqfujIZenNurz+hLpbRPbHLD5E5l13OPNFaBhYUdDXbyCgllnOn3z9AaGqruAJoz\ny0TiATuNIXjIQZ27O38qT7eiubdsO0OoKGm7Bm2JY+G9fsuLaJhHDak9NfzPXwZj\nq1+s2zyiKeorL39CdTXwwxrgfj8mQ/ZrmBXU7lFwKQKBgQDUNzNXQlsLwuYqpKJr\nxYI6qo+3T4fRFsS02aqwvciHcg1b0iKb2sKnH1nwf/RAoCffRDic1J5i6BtsYmpa\nUMiXog8hgbeTALnQar+8Nq7vvpyORxmCCFY5bzxngy/T1GNdAuhaTv7n0iH3VXtk\nfpM1DKwTfLNCX6kQbLOoRR8j7w==\n-----END PRIVATE KEY-----\n",
18
- "client_email": "[email protected]",
19
- "client_id": "108950722202634464257",
20
- "auth_uri": "https://accounts.google.com/o/oauth2/auth",
21
- "token_uri": "https://oauth2.googleapis.com/token",
22
- "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
23
- "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/shanghua%40txagent.iam.gserviceaccount.com",
24
- "universe_domain": "googleapis.com"
25
- }
26
 
27
  # Optionally, get the sheet name from environment (or use a default)
28
  # GSHEET_NAME = os.environ.get("GSHEET_NAME", "Your Google Sheet Name")
@@ -173,7 +162,7 @@ def append_to_sheet(user_data=None, custom_row_dict=None, custom_sheet_name=None
173
  # Append the custom or default row to the sheet
174
  sheet.append_row(custom_row)
175
 
176
- def format_chat(response):
177
  chat_history = []
178
  # Keep track of the last assistant message's tool_calls
179
  last_tool_calls = []
@@ -195,10 +184,16 @@ def format_chat(response):
195
  args = tool_call.get("arguments", {})
196
 
197
  # Determine icon + title
 
198
  if name == "Tool_RAG":
199
  title = "🧰 Tool RAG"
200
  else:
201
  title = f"🛠️ {name}"
 
 
 
 
 
202
 
203
  # Parse and pretty-print the tool response content
204
  raw = msg.get("content", "")
@@ -214,7 +209,7 @@ def format_chat(response):
214
  chat_history.append(
215
  gr.ChatMessage(
216
  role="assistant",
217
- content=f"Input: {json.dumps(args)}\n\nResponse:\n{pretty}",
218
  metadata={
219
  "title": title
220
  }
 
9
  import pandas as pd
10
  import json
11
  import gradio as gr
12
+ import os
13
 
14
+ GSERVICE_ACCOUNT_INFO = os.environ.get("GSERVICE_ACCOUNT_INFO")
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  # Optionally, get the sheet name from environment (or use a default)
17
  # GSHEET_NAME = os.environ.get("GSHEET_NAME", "Your Google Sheet Name")
 
162
  # Append the custom or default row to the sheet
163
  sheet.append_row(custom_row)
164
 
165
+ def format_chat(response, tool_database_labels):
166
  chat_history = []
167
  # Keep track of the last assistant message's tool_calls
168
  last_tool_calls = []
 
184
  args = tool_call.get("arguments", {})
185
 
186
  # Determine icon + title
187
+ database_label = ""
188
  if name == "Tool_RAG":
189
  title = "🧰 Tool RAG"
190
  else:
191
  title = f"🛠️ {name}"
192
+ for db_label, tool_list in tool_database_labels.items():
193
+ if name in tool_list:
194
+ title = f"🛠️ {name} (**retrieves** {db_label})"
195
+ database_label = " (" + db_label + ")"
196
+ break
197
 
198
  # Parse and pretty-print the tool response content
199
  raw = msg.get("content", "")
 
209
  chat_history.append(
210
  gr.ChatMessage(
211
  role="assistant",
212
+ content=f"Input: {json.dumps(args)}\n\nResponse{database_label}:\n{pretty}",
213
  metadata={
214
  "title": title
215
  }