aiagents4pharma 1.43.0__py3-none-any.whl → 1.45.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. aiagents4pharma/__init__.py +2 -2
  2. aiagents4pharma/talk2aiagents4pharma/.dockerignore +13 -0
  3. aiagents4pharma/talk2aiagents4pharma/Dockerfile +105 -0
  4. aiagents4pharma/talk2aiagents4pharma/README.md +1 -0
  5. aiagents4pharma/talk2aiagents4pharma/__init__.py +4 -5
  6. aiagents4pharma/talk2aiagents4pharma/agents/__init__.py +3 -2
  7. aiagents4pharma/talk2aiagents4pharma/agents/main_agent.py +24 -23
  8. aiagents4pharma/talk2aiagents4pharma/configs/__init__.py +2 -2
  9. aiagents4pharma/talk2aiagents4pharma/configs/agents/__init__.py +2 -2
  10. aiagents4pharma/talk2aiagents4pharma/configs/agents/main_agent/default.yaml +2 -2
  11. aiagents4pharma/talk2aiagents4pharma/configs/config.yaml +1 -1
  12. aiagents4pharma/talk2aiagents4pharma/docker-compose/cpu/.env.example +23 -0
  13. aiagents4pharma/talk2aiagents4pharma/docker-compose/cpu/docker-compose.yml +93 -0
  14. aiagents4pharma/talk2aiagents4pharma/docker-compose/gpu/.env.example +23 -0
  15. aiagents4pharma/talk2aiagents4pharma/docker-compose/gpu/docker-compose.yml +108 -0
  16. aiagents4pharma/talk2aiagents4pharma/install.md +127 -0
  17. aiagents4pharma/talk2aiagents4pharma/states/__init__.py +3 -2
  18. aiagents4pharma/talk2aiagents4pharma/states/state_talk2aiagents4pharma.py +5 -3
  19. aiagents4pharma/talk2aiagents4pharma/tests/__init__.py +2 -2
  20. aiagents4pharma/talk2aiagents4pharma/tests/test_main_agent.py +72 -50
  21. aiagents4pharma/talk2biomodels/.dockerignore +13 -0
  22. aiagents4pharma/talk2biomodels/Dockerfile +104 -0
  23. aiagents4pharma/talk2biomodels/README.md +1 -0
  24. aiagents4pharma/talk2biomodels/__init__.py +4 -8
  25. aiagents4pharma/talk2biomodels/agents/__init__.py +3 -2
  26. aiagents4pharma/talk2biomodels/agents/t2b_agent.py +47 -42
  27. aiagents4pharma/talk2biomodels/api/__init__.py +4 -5
  28. aiagents4pharma/talk2biomodels/api/kegg.py +14 -10
  29. aiagents4pharma/talk2biomodels/api/ols.py +13 -10
  30. aiagents4pharma/talk2biomodels/api/uniprot.py +7 -6
  31. aiagents4pharma/talk2biomodels/configs/__init__.py +3 -4
  32. aiagents4pharma/talk2biomodels/configs/agents/__init__.py +2 -2
  33. aiagents4pharma/talk2biomodels/configs/agents/t2b_agent/__init__.py +2 -2
  34. aiagents4pharma/talk2biomodels/configs/agents/t2b_agent/default.yaml +1 -1
  35. aiagents4pharma/talk2biomodels/configs/config.yaml +1 -1
  36. aiagents4pharma/talk2biomodels/configs/tools/__init__.py +4 -5
  37. aiagents4pharma/talk2biomodels/configs/tools/ask_question/__init__.py +2 -2
  38. aiagents4pharma/talk2biomodels/configs/tools/ask_question/default.yaml +1 -2
  39. aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/__init__.py +2 -2
  40. aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/default.yaml +1 -1
  41. aiagents4pharma/talk2biomodels/configs/tools/get_annotation/__init__.py +2 -2
  42. aiagents4pharma/talk2biomodels/configs/tools/get_annotation/default.yaml +1 -1
  43. aiagents4pharma/talk2biomodels/install.md +63 -0
  44. aiagents4pharma/talk2biomodels/models/__init__.py +4 -4
  45. aiagents4pharma/talk2biomodels/models/basico_model.py +36 -28
  46. aiagents4pharma/talk2biomodels/models/sys_bio_model.py +13 -10
  47. aiagents4pharma/talk2biomodels/states/__init__.py +3 -2
  48. aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py +12 -8
  49. aiagents4pharma/talk2biomodels/tests/BIOMD0000000449_url.xml +1585 -0
  50. aiagents4pharma/talk2biomodels/tests/__init__.py +2 -2
  51. aiagents4pharma/talk2biomodels/tests/article_on_model_537.pdf +0 -0
  52. aiagents4pharma/talk2biomodels/tests/test_api.py +18 -14
  53. aiagents4pharma/talk2biomodels/tests/test_ask_question.py +8 -9
  54. aiagents4pharma/talk2biomodels/tests/test_basico_model.py +15 -9
  55. aiagents4pharma/talk2biomodels/tests/test_get_annotation.py +54 -55
  56. aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py +28 -27
  57. aiagents4pharma/talk2biomodels/tests/test_integration.py +21 -33
  58. aiagents4pharma/talk2biomodels/tests/test_load_biomodel.py +14 -11
  59. aiagents4pharma/talk2biomodels/tests/test_param_scan.py +21 -20
  60. aiagents4pharma/talk2biomodels/tests/test_query_article.py +129 -29
  61. aiagents4pharma/talk2biomodels/tests/test_search_models.py +9 -13
  62. aiagents4pharma/talk2biomodels/tests/test_simulate_model.py +16 -15
  63. aiagents4pharma/talk2biomodels/tests/test_steady_state.py +12 -22
  64. aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py +33 -29
  65. aiagents4pharma/talk2biomodels/tools/__init__.py +15 -12
  66. aiagents4pharma/talk2biomodels/tools/ask_question.py +42 -32
  67. aiagents4pharma/talk2biomodels/tools/custom_plotter.py +51 -43
  68. aiagents4pharma/talk2biomodels/tools/get_annotation.py +99 -75
  69. aiagents4pharma/talk2biomodels/tools/get_modelinfo.py +57 -51
  70. aiagents4pharma/talk2biomodels/tools/load_arguments.py +52 -32
  71. aiagents4pharma/talk2biomodels/tools/load_biomodel.py +8 -2
  72. aiagents4pharma/talk2biomodels/tools/parameter_scan.py +107 -90
  73. aiagents4pharma/talk2biomodels/tools/query_article.py +14 -13
  74. aiagents4pharma/talk2biomodels/tools/search_models.py +37 -26
  75. aiagents4pharma/talk2biomodels/tools/simulate_model.py +47 -37
  76. aiagents4pharma/talk2biomodels/tools/steady_state.py +76 -58
  77. aiagents4pharma/talk2biomodels/tools/utils.py +4 -3
  78. aiagents4pharma/talk2cells/README.md +1 -0
  79. aiagents4pharma/talk2cells/__init__.py +4 -5
  80. aiagents4pharma/talk2cells/agents/__init__.py +3 -2
  81. aiagents4pharma/talk2cells/agents/scp_agent.py +21 -19
  82. aiagents4pharma/talk2cells/states/__init__.py +3 -2
  83. aiagents4pharma/talk2cells/states/state_talk2cells.py +4 -2
  84. aiagents4pharma/talk2cells/tests/scp_agent/test_scp_agent.py +8 -9
  85. aiagents4pharma/talk2cells/tools/__init__.py +3 -2
  86. aiagents4pharma/talk2cells/tools/scp_agent/__init__.py +4 -4
  87. aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py +5 -3
  88. aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py +21 -22
  89. aiagents4pharma/talk2knowledgegraphs/.dockerignore +13 -0
  90. aiagents4pharma/talk2knowledgegraphs/Dockerfile +103 -0
  91. aiagents4pharma/talk2knowledgegraphs/README.md +1 -0
  92. aiagents4pharma/talk2knowledgegraphs/__init__.py +4 -7
  93. aiagents4pharma/talk2knowledgegraphs/agents/__init__.py +3 -2
  94. aiagents4pharma/talk2knowledgegraphs/agents/t2kg_agent.py +40 -30
  95. aiagents4pharma/talk2knowledgegraphs/configs/__init__.py +3 -6
  96. aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent/__init__.py +2 -2
  97. aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent/default.yaml +8 -8
  98. aiagents4pharma/talk2knowledgegraphs/configs/app/__init__.py +3 -2
  99. aiagents4pharma/talk2knowledgegraphs/configs/app/frontend/__init__.py +2 -2
  100. aiagents4pharma/talk2knowledgegraphs/configs/app/frontend/default.yaml +1 -1
  101. aiagents4pharma/talk2knowledgegraphs/configs/config.yaml +1 -1
  102. aiagents4pharma/talk2knowledgegraphs/configs/tools/__init__.py +4 -5
  103. aiagents4pharma/talk2knowledgegraphs/configs/tools/graphrag_reasoning/__init__.py +2 -2
  104. aiagents4pharma/talk2knowledgegraphs/configs/tools/graphrag_reasoning/default.yaml +1 -1
  105. aiagents4pharma/talk2knowledgegraphs/configs/tools/multimodal_subgraph_extraction/default.yaml +17 -2
  106. aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_extraction/__init__.py +2 -2
  107. aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_extraction/default.yaml +1 -1
  108. aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_summarization/__init__.py +2 -2
  109. aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_summarization/default.yaml +1 -1
  110. aiagents4pharma/talk2knowledgegraphs/configs/utils/enrichments/ols_terms/default.yaml +1 -1
  111. aiagents4pharma/talk2knowledgegraphs/configs/utils/enrichments/reactome_pathways/default.yaml +1 -1
  112. aiagents4pharma/talk2knowledgegraphs/configs/utils/enrichments/uniprot_proteins/default.yaml +1 -1
  113. aiagents4pharma/talk2knowledgegraphs/configs/utils/pubchem_utils/default.yaml +1 -1
  114. aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py +4 -6
  115. aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py +115 -67
  116. aiagents4pharma/talk2knowledgegraphs/datasets/dataset.py +2 -0
  117. aiagents4pharma/talk2knowledgegraphs/datasets/primekg.py +35 -24
  118. aiagents4pharma/talk2knowledgegraphs/datasets/starkqa_primekg.py +29 -21
  119. aiagents4pharma/talk2knowledgegraphs/docker-compose/cpu/.env.example +23 -0
  120. aiagents4pharma/talk2knowledgegraphs/docker-compose/cpu/docker-compose.yml +93 -0
  121. aiagents4pharma/talk2knowledgegraphs/docker-compose/gpu/.env.example +23 -0
  122. aiagents4pharma/talk2knowledgegraphs/docker-compose/gpu/docker-compose.yml +108 -0
  123. aiagents4pharma/talk2knowledgegraphs/entrypoint.sh +190 -0
  124. aiagents4pharma/talk2knowledgegraphs/install.md +140 -0
  125. aiagents4pharma/talk2knowledgegraphs/milvus_data_dump.py +31 -65
  126. aiagents4pharma/talk2knowledgegraphs/states/__init__.py +3 -2
  127. aiagents4pharma/talk2knowledgegraphs/states/state_talk2knowledgegraphs.py +1 -0
  128. aiagents4pharma/talk2knowledgegraphs/tests/test_agents_t2kg_agent.py +65 -40
  129. aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_biobridge_primekg.py +54 -48
  130. aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_dataset.py +4 -0
  131. aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_primekg.py +17 -4
  132. aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_starkqa_primekg.py +33 -24
  133. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_graphrag_reasoning.py +116 -69
  134. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_milvus_multimodal_subgraph_extraction.py +736 -413
  135. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_multimodal_subgraph_extraction.py +22 -15
  136. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_subgraph_extraction.py +19 -12
  137. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_subgraph_summarization.py +95 -48
  138. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py +4 -0
  139. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py +5 -0
  140. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_nim_molmim.py +13 -18
  141. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_ollama.py +10 -3
  142. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_enrichments.py +4 -3
  143. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ollama.py +3 -2
  144. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ols.py +1 -0
  145. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_pubchem.py +9 -4
  146. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_reactome.py +6 -6
  147. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_uniprot.py +4 -0
  148. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_extractions_milvus_multimodal_pcst.py +442 -42
  149. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_kg_utils.py +3 -4
  150. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_pubchem_utils.py +10 -6
  151. aiagents4pharma/talk2knowledgegraphs/tools/__init__.py +10 -7
  152. aiagents4pharma/talk2knowledgegraphs/tools/graphrag_reasoning.py +15 -20
  153. aiagents4pharma/talk2knowledgegraphs/tools/milvus_multimodal_subgraph_extraction.py +245 -205
  154. aiagents4pharma/talk2knowledgegraphs/tools/multimodal_subgraph_extraction.py +92 -90
  155. aiagents4pharma/talk2knowledgegraphs/tools/subgraph_extraction.py +25 -37
  156. aiagents4pharma/talk2knowledgegraphs/tools/subgraph_summarization.py +10 -13
  157. aiagents4pharma/talk2knowledgegraphs/utils/__init__.py +4 -7
  158. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py +4 -7
  159. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py +4 -0
  160. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py +11 -14
  161. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/nim_molmim.py +7 -7
  162. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/ollama.py +12 -6
  163. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py +8 -6
  164. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/__init__.py +9 -6
  165. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/enrichments.py +1 -0
  166. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/ollama.py +15 -9
  167. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/ols_terms.py +23 -20
  168. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/pubchem_strings.py +12 -10
  169. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/reactome_pathways.py +16 -10
  170. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/uniprot_proteins.py +26 -18
  171. aiagents4pharma/talk2knowledgegraphs/utils/extractions/__init__.py +4 -5
  172. aiagents4pharma/talk2knowledgegraphs/utils/extractions/milvus_multimodal_pcst.py +218 -81
  173. aiagents4pharma/talk2knowledgegraphs/utils/extractions/multimodal_pcst.py +53 -47
  174. aiagents4pharma/talk2knowledgegraphs/utils/extractions/pcst.py +18 -14
  175. aiagents4pharma/talk2knowledgegraphs/utils/kg_utils.py +22 -23
  176. aiagents4pharma/talk2knowledgegraphs/utils/pubchem_utils.py +11 -10
  177. aiagents4pharma/talk2scholars/.dockerignore +13 -0
  178. aiagents4pharma/talk2scholars/Dockerfile +104 -0
  179. aiagents4pharma/talk2scholars/README.md +1 -0
  180. aiagents4pharma/talk2scholars/agents/__init__.py +1 -5
  181. aiagents4pharma/talk2scholars/agents/main_agent.py +6 -4
  182. aiagents4pharma/talk2scholars/agents/paper_download_agent.py +5 -4
  183. aiagents4pharma/talk2scholars/agents/pdf_agent.py +4 -2
  184. aiagents4pharma/talk2scholars/agents/s2_agent.py +2 -2
  185. aiagents4pharma/talk2scholars/agents/zotero_agent.py +10 -11
  186. aiagents4pharma/talk2scholars/configs/__init__.py +1 -3
  187. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/__init__.py +1 -4
  188. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/default.yaml +1 -1
  189. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/pdf_agent/default.yaml +1 -1
  190. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/default.yaml +8 -8
  191. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/zotero_agent/default.yaml +7 -7
  192. aiagents4pharma/talk2scholars/configs/tools/__init__.py +8 -6
  193. aiagents4pharma/talk2scholars/docker-compose/cpu/.env.example +21 -0
  194. aiagents4pharma/talk2scholars/docker-compose/cpu/docker-compose.yml +90 -0
  195. aiagents4pharma/talk2scholars/docker-compose/gpu/.env.example +21 -0
  196. aiagents4pharma/talk2scholars/docker-compose/gpu/docker-compose.yml +105 -0
  197. aiagents4pharma/talk2scholars/install.md +122 -0
  198. aiagents4pharma/talk2scholars/state/state_talk2scholars.py +8 -8
  199. aiagents4pharma/talk2scholars/tests/{test_main_agent.py → test_agents_main_agent.py} +41 -23
  200. aiagents4pharma/talk2scholars/tests/{test_paper_download_agent.py → test_agents_paper_agents_download_agent.py} +10 -16
  201. aiagents4pharma/talk2scholars/tests/{test_pdf_agent.py → test_agents_pdf_agent.py} +6 -10
  202. aiagents4pharma/talk2scholars/tests/{test_s2_agent.py → test_agents_s2_agent.py} +8 -16
  203. aiagents4pharma/talk2scholars/tests/{test_zotero_agent.py → test_agents_zotero_agent.py} +5 -7
  204. aiagents4pharma/talk2scholars/tests/{test_s2_display_dataframe.py → test_s2_tools_display_dataframe.py} +6 -7
  205. aiagents4pharma/talk2scholars/tests/{test_s2_query_dataframe.py → test_s2_tools_query_dataframe.py} +5 -15
  206. aiagents4pharma/talk2scholars/tests/{test_paper_downloader.py → test_tools_paper_downloader.py} +25 -63
  207. aiagents4pharma/talk2scholars/tests/{test_question_and_answer_tool.py → test_tools_question_and_answer_tool.py} +2 -6
  208. aiagents4pharma/talk2scholars/tests/{test_s2_multi.py → test_tools_s2_multi.py} +5 -5
  209. aiagents4pharma/talk2scholars/tests/{test_s2_retrieve.py → test_tools_s2_retrieve.py} +2 -1
  210. aiagents4pharma/talk2scholars/tests/{test_s2_search.py → test_tools_s2_search.py} +5 -5
  211. aiagents4pharma/talk2scholars/tests/{test_s2_single.py → test_tools_s2_single.py} +5 -5
  212. aiagents4pharma/talk2scholars/tests/{test_arxiv_downloader.py → test_utils_arxiv_downloader.py} +16 -25
  213. aiagents4pharma/talk2scholars/tests/{test_base_paper_downloader.py → test_utils_base_paper_downloader.py} +25 -47
  214. aiagents4pharma/talk2scholars/tests/{test_biorxiv_downloader.py → test_utils_biorxiv_downloader.py} +14 -42
  215. aiagents4pharma/talk2scholars/tests/{test_medrxiv_downloader.py → test_utils_medrxiv_downloader.py} +15 -49
  216. aiagents4pharma/talk2scholars/tests/{test_nvidia_nim_reranker.py → test_utils_nvidia_nim_reranker.py} +6 -16
  217. aiagents4pharma/talk2scholars/tests/{test_pdf_answer_formatter.py → test_utils_pdf_answer_formatter.py} +1 -0
  218. aiagents4pharma/talk2scholars/tests/{test_pdf_batch_processor.py → test_utils_pdf_batch_processor.py} +6 -15
  219. aiagents4pharma/talk2scholars/tests/{test_pdf_collection_manager.py → test_utils_pdf_collection_manager.py} +34 -11
  220. aiagents4pharma/talk2scholars/tests/{test_pdf_document_processor.py → test_utils_pdf_document_processor.py} +2 -3
  221. aiagents4pharma/talk2scholars/tests/{test_pdf_generate_answer.py → test_utils_pdf_generate_answer.py} +3 -6
  222. aiagents4pharma/talk2scholars/tests/{test_pdf_gpu_detection.py → test_utils_pdf_gpu_detection.py} +5 -16
  223. aiagents4pharma/talk2scholars/tests/{test_pdf_rag_pipeline.py → test_utils_pdf_rag_pipeline.py} +7 -17
  224. aiagents4pharma/talk2scholars/tests/{test_pdf_retrieve_chunks.py → test_utils_pdf_retrieve_chunks.py} +4 -11
  225. aiagents4pharma/talk2scholars/tests/{test_pdf_singleton_manager.py → test_utils_pdf_singleton_manager.py} +26 -23
  226. aiagents4pharma/talk2scholars/tests/{test_pdf_vector_normalization.py → test_utils_pdf_vector_normalization.py} +1 -1
  227. aiagents4pharma/talk2scholars/tests/{test_pdf_vector_store.py → test_utils_pdf_vector_store.py} +27 -55
  228. aiagents4pharma/talk2scholars/tests/{test_pubmed_downloader.py → test_utils_pubmed_downloader.py} +31 -91
  229. aiagents4pharma/talk2scholars/tests/{test_read_helper_utils.py → test_utils_read_helper_utils.py} +2 -6
  230. aiagents4pharma/talk2scholars/tests/{test_s2_utils_ext_ids.py → test_utils_s2_utils_ext_ids.py} +5 -15
  231. aiagents4pharma/talk2scholars/tests/{test_zotero_human_in_the_loop.py → test_utils_zotero_human_in_the_loop.py} +6 -13
  232. aiagents4pharma/talk2scholars/tests/{test_zotero_path.py → test_utils_zotero_path.py} +53 -45
  233. aiagents4pharma/talk2scholars/tests/{test_zotero_read.py → test_utils_zotero_read.py} +30 -91
  234. aiagents4pharma/talk2scholars/tests/{test_zotero_write.py → test_utils_zotero_write.py} +6 -16
  235. aiagents4pharma/talk2scholars/tools/__init__.py +1 -4
  236. aiagents4pharma/talk2scholars/tools/paper_download/paper_downloader.py +20 -35
  237. aiagents4pharma/talk2scholars/tools/paper_download/utils/__init__.py +7 -5
  238. aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py +9 -11
  239. aiagents4pharma/talk2scholars/tools/paper_download/utils/base_paper_downloader.py +14 -21
  240. aiagents4pharma/talk2scholars/tools/paper_download/utils/biorxiv_downloader.py +14 -22
  241. aiagents4pharma/talk2scholars/tools/paper_download/utils/medrxiv_downloader.py +11 -13
  242. aiagents4pharma/talk2scholars/tools/paper_download/utils/pubmed_downloader.py +14 -28
  243. aiagents4pharma/talk2scholars/tools/pdf/question_and_answer.py +4 -8
  244. aiagents4pharma/talk2scholars/tools/pdf/utils/__init__.py +16 -14
  245. aiagents4pharma/talk2scholars/tools/pdf/utils/answer_formatter.py +4 -4
  246. aiagents4pharma/talk2scholars/tools/pdf/utils/batch_processor.py +15 -17
  247. aiagents4pharma/talk2scholars/tools/pdf/utils/collection_manager.py +2 -2
  248. aiagents4pharma/talk2scholars/tools/pdf/utils/document_processor.py +5 -5
  249. aiagents4pharma/talk2scholars/tools/pdf/utils/generate_answer.py +4 -4
  250. aiagents4pharma/talk2scholars/tools/pdf/utils/get_vectorstore.py +2 -6
  251. aiagents4pharma/talk2scholars/tools/pdf/utils/gpu_detection.py +5 -9
  252. aiagents4pharma/talk2scholars/tools/pdf/utils/nvidia_nim_reranker.py +4 -4
  253. aiagents4pharma/talk2scholars/tools/pdf/utils/paper_loader.py +2 -2
  254. aiagents4pharma/talk2scholars/tools/pdf/utils/rag_pipeline.py +6 -15
  255. aiagents4pharma/talk2scholars/tools/pdf/utils/retrieve_chunks.py +7 -15
  256. aiagents4pharma/talk2scholars/tools/pdf/utils/singleton_manager.py +2 -2
  257. aiagents4pharma/talk2scholars/tools/pdf/utils/tool_helper.py +3 -4
  258. aiagents4pharma/talk2scholars/tools/pdf/utils/vector_normalization.py +8 -17
  259. aiagents4pharma/talk2scholars/tools/pdf/utils/vector_store.py +17 -33
  260. aiagents4pharma/talk2scholars/tools/s2/__init__.py +8 -6
  261. aiagents4pharma/talk2scholars/tools/s2/display_dataframe.py +3 -7
  262. aiagents4pharma/talk2scholars/tools/s2/multi_paper_rec.py +7 -6
  263. aiagents4pharma/talk2scholars/tools/s2/query_dataframe.py +5 -12
  264. aiagents4pharma/talk2scholars/tools/s2/retrieve_semantic_scholar_paper_id.py +2 -4
  265. aiagents4pharma/talk2scholars/tools/s2/search.py +6 -6
  266. aiagents4pharma/talk2scholars/tools/s2/single_paper_rec.py +5 -3
  267. aiagents4pharma/talk2scholars/tools/s2/utils/__init__.py +1 -3
  268. aiagents4pharma/talk2scholars/tools/s2/utils/multi_helper.py +12 -18
  269. aiagents4pharma/talk2scholars/tools/s2/utils/search_helper.py +11 -18
  270. aiagents4pharma/talk2scholars/tools/s2/utils/single_helper.py +11 -16
  271. aiagents4pharma/talk2scholars/tools/zotero/__init__.py +1 -4
  272. aiagents4pharma/talk2scholars/tools/zotero/utils/__init__.py +1 -4
  273. aiagents4pharma/talk2scholars/tools/zotero/utils/read_helper.py +21 -39
  274. aiagents4pharma/talk2scholars/tools/zotero/utils/review_helper.py +2 -6
  275. aiagents4pharma/talk2scholars/tools/zotero/utils/write_helper.py +8 -11
  276. aiagents4pharma/talk2scholars/tools/zotero/utils/zotero_path.py +4 -12
  277. aiagents4pharma/talk2scholars/tools/zotero/utils/zotero_pdf_downloader.py +13 -27
  278. aiagents4pharma/talk2scholars/tools/zotero/zotero_read.py +4 -7
  279. aiagents4pharma/talk2scholars/tools/zotero/zotero_review.py +8 -10
  280. aiagents4pharma/talk2scholars/tools/zotero/zotero_write.py +3 -2
  281. {aiagents4pharma-1.43.0.dist-info → aiagents4pharma-1.45.0.dist-info}/METADATA +115 -50
  282. aiagents4pharma-1.45.0.dist-info/RECORD +324 -0
  283. {aiagents4pharma-1.43.0.dist-info → aiagents4pharma-1.45.0.dist-info}/WHEEL +1 -2
  284. aiagents4pharma-1.43.0.dist-info/RECORD +0 -293
  285. aiagents4pharma-1.43.0.dist-info/top_level.txt +0 -1
  286. /aiagents4pharma/talk2scholars/tests/{test_state.py → test_states_state.py} +0 -0
  287. /aiagents4pharma/talk2scholars/tests/{test_pdf_paper_loader.py → test_utils_pdf_paper_loader.py} +0 -0
  288. /aiagents4pharma/talk2scholars/tests/{test_tool_helper_utils.py → test_utils_tool_helper_utils.py} +0 -0
  289. /aiagents4pharma/talk2scholars/tests/{test_zotero_pdf_downloader_utils.py → test_utils_zotero_pdf_downloader_utils.py} +0 -0
  290. {aiagents4pharma-1.43.0.dist-info → aiagents4pharma-1.45.0.dist-info}/licenses/LICENSE +0 -0
@@ -4,16 +4,19 @@ Test cases for datasets/dataset.py
4
4
 
5
5
  from ..datasets.dataset import Dataset
6
6
 
7
+
7
8
  class MockDataset(Dataset):
8
9
  """
9
10
  Mock dataset class for testing purposes.
10
11
  """
12
+
11
13
  def setup(self):
12
14
  pass
13
15
 
14
16
  def load_data(self):
15
17
  pass
16
18
 
19
+
17
20
  def test_dataset_setup():
18
21
  """
19
22
  Test the setup method of the Dataset class.
@@ -21,6 +24,7 @@ def test_dataset_setup():
21
24
  dataset = MockDataset()
22
25
  assert dataset.setup() is None
23
26
 
27
+
24
28
  def test_dataset_load_data():
25
29
  """
26
30
  Test the load_data method of the Dataset class.
@@ -4,13 +4,16 @@ Test cases for datasets/primekg_loader.py
4
4
 
5
5
  import os
6
6
  import shutil
7
+
7
8
  import pytest
9
+
8
10
  from ..datasets.primekg import PrimeKG
9
11
 
10
12
  # Remove the data folder for testing if it exists
11
13
  LOCAL_DIR = "../data/primekg_test/"
12
14
  shutil.rmtree(LOCAL_DIR, ignore_errors=True)
13
15
 
16
+
14
17
  @pytest.fixture(name="primekg")
15
18
  def primekg_fixture():
16
19
  """
@@ -18,6 +21,7 @@ def primekg_fixture():
18
21
  """
19
22
  return PrimeKG(local_dir=LOCAL_DIR)
20
23
 
24
+
21
25
  def test_download_primekg(primekg):
22
26
  """
23
27
  Test the loading method of the PrimeKG class by downloading PrimeKG from server.
@@ -30,8 +34,12 @@ def test_download_primekg(primekg):
30
34
  # Check if the local directory exists
31
35
  assert os.path.exists(primekg.local_dir)
32
36
  # Check if downloaded and processed files exist
33
- files = ["nodes.tab", f"{primekg.name}_nodes.tsv.gz",
34
- "edges.csv", f"{primekg.name}_edges.tsv.gz"]
37
+ files = [
38
+ "nodes.tab",
39
+ f"{primekg.name}_nodes.tsv.gz",
40
+ "edges.csv",
41
+ f"{primekg.name}_edges.tsv.gz",
42
+ ]
35
43
  for file in files:
36
44
  path = f"{primekg.local_dir}/{file}"
37
45
  assert os.path.exists(path)
@@ -45,6 +53,7 @@ def test_download_primekg(primekg):
45
53
  assert len(primekg_edges) > 0
46
54
  assert primekg_edges.shape[0] == 8100498
47
55
 
56
+
48
57
  def test_load_existing_primekg(primekg):
49
58
  """
50
59
  Test the loading method of the PrimeKG class by loading existing PrimeKG in local.
@@ -57,8 +66,12 @@ def test_load_existing_primekg(primekg):
57
66
  # Check if the local directory exists
58
67
  assert os.path.exists(primekg.local_dir)
59
68
  # Check if downloaded and processed files exist
60
- files = ["nodes.tab", f"{primekg.name}_nodes.tsv.gz",
61
- "edges.csv", f"{primekg.name}_edges.tsv.gz"]
69
+ files = [
70
+ "nodes.tab",
71
+ f"{primekg.name}_nodes.tsv.gz",
72
+ "edges.csv",
73
+ f"{primekg.name}_edges.tsv.gz",
74
+ ]
62
75
  for file in files:
63
76
  path = f"{primekg.local_dir}/{file}"
64
77
  assert os.path.exists(path)
@@ -4,13 +4,16 @@ Test cases for datasets/starkqa_primekg_loader.py
4
4
 
5
5
  import os
6
6
  import shutil
7
+
7
8
  import pytest
9
+
8
10
  from ..datasets.starkqa_primekg import StarkQAPrimeKG
9
11
 
10
12
  # Remove the data folder for testing if it exists
11
13
  LOCAL_DIR = "../data/starkqa_primekg_test/"
12
14
  shutil.rmtree(LOCAL_DIR, ignore_errors=True)
13
15
 
16
+
14
17
  @pytest.fixture(name="starkqa_primekg")
15
18
  def starkqa_primekg_fixture():
16
19
  """
@@ -18,6 +21,7 @@ def starkqa_primekg_fixture():
18
21
  """
19
22
  return StarkQAPrimeKG(local_dir=LOCAL_DIR)
20
23
 
24
+
21
25
  def test_download_starkqa_primekg(starkqa_primekg):
22
26
  """
23
27
  Test the loading method of the StarkQAPrimeKGLoaderTool class by downloading files
@@ -34,13 +38,15 @@ def test_download_starkqa_primekg(starkqa_primekg):
34
38
  # Check if the local directory exists
35
39
  assert os.path.exists(starkqa_primekg.local_dir)
36
40
  # Check if downloaded files exist in the local directory
37
- files = ['qa/prime/split/test-0.1.index',
38
- 'qa/prime/split/test.index',
39
- 'qa/prime/split/train.index',
40
- 'qa/prime/split/val.index',
41
- 'qa/prime/stark_qa/stark_qa.csv',
42
- 'qa/prime/stark_qa/stark_qa_human_generated_eval.csv',
43
- 'skb/prime/processed.zip']
41
+ files = [
42
+ "qa/prime/split/test-0.1.index",
43
+ "qa/prime/split/test.index",
44
+ "qa/prime/split/train.index",
45
+ "qa/prime/split/val.index",
46
+ "qa/prime/stark_qa/stark_qa.csv",
47
+ "qa/prime/stark_qa/stark_qa_human_generated_eval.csv",
48
+ "skb/prime/processed.zip",
49
+ ]
44
50
  for file in files:
45
51
  path = f"{starkqa_primekg.local_dir}/{file}"
46
52
  assert os.path.exists(path)
@@ -52,11 +58,11 @@ def test_download_starkqa_primekg(starkqa_primekg):
52
58
  assert primekg_node_info is not None
53
59
  assert len(primekg_node_info) == 129375
54
60
  # Check split indices
55
- assert list(split_idx.keys()) == ['train', 'val', 'test', 'test-0.1']
56
- assert len(split_idx['train']) == 6162
57
- assert len(split_idx['val']) == 2241
58
- assert len(split_idx['test']) == 2801
59
- assert len(split_idx['test-0.1']) == 280
61
+ assert list(split_idx.keys()) == ["train", "val", "test", "test-0.1"]
62
+ assert len(split_idx["train"]) == 6162
63
+ assert len(split_idx["val"]) == 2241
64
+ assert len(split_idx["test"]) == 2801
65
+ assert len(split_idx["test-0.1"]) == 280
60
66
  # Check query embeddings
61
67
  assert query_embeddings is not None
62
68
  assert len(query_embeddings) == 11204
@@ -66,6 +72,7 @@ def test_download_starkqa_primekg(starkqa_primekg):
66
72
  assert len(node_embeddings) == 129375
67
73
  assert node_embeddings[0].shape[1] == 1536
68
74
 
75
+
69
76
  def test_load_existing_starkqa_primekg(starkqa_primekg):
70
77
  """
71
78
 
@@ -83,13 +90,15 @@ def test_load_existing_starkqa_primekg(starkqa_primekg):
83
90
  # Check if the local directory exists
84
91
  assert os.path.exists(starkqa_primekg.local_dir)
85
92
  # Check if downloaded and processed files exist
86
- files = ['qa/prime/split/test-0.1.index',
87
- 'qa/prime/split/test.index',
88
- 'qa/prime/split/train.index',
89
- 'qa/prime/split/val.index',
90
- 'qa/prime/stark_qa/stark_qa.csv',
91
- 'qa/prime/stark_qa/stark_qa_human_generated_eval.csv',
92
- 'skb/prime/processed.zip']
93
+ files = [
94
+ "qa/prime/split/test-0.1.index",
95
+ "qa/prime/split/test.index",
96
+ "qa/prime/split/train.index",
97
+ "qa/prime/split/val.index",
98
+ "qa/prime/stark_qa/stark_qa.csv",
99
+ "qa/prime/stark_qa/stark_qa_human_generated_eval.csv",
100
+ "skb/prime/processed.zip",
101
+ ]
93
102
  for file in files:
94
103
  path = f"{starkqa_primekg.local_dir}/{file}"
95
104
  assert os.path.exists(path)
@@ -101,11 +110,11 @@ def test_load_existing_starkqa_primekg(starkqa_primekg):
101
110
  assert primekg_node_info is not None
102
111
  assert len(primekg_node_info) == 129375
103
112
  # Check split indices
104
- assert list(split_idx.keys()) == ['train', 'val', 'test', 'test-0.1']
105
- assert len(split_idx['train']) == 6162
106
- assert len(split_idx['val']) == 2241
107
- assert len(split_idx['test']) == 2801
108
- assert len(split_idx['test-0.1']) == 280
113
+ assert list(split_idx.keys()) == ["train", "val", "test", "test-0.1"]
114
+ assert len(split_idx["train"]) == 6162
115
+ assert len(split_idx["val"]) == 2241
116
+ assert len(split_idx["test"]) == 2801
117
+ assert len(split_idx["test-0.1"]) == 280
109
118
  # Check query embeddings
110
119
  assert query_embeddings is not None
111
120
  assert len(query_embeddings) == 11204
@@ -5,6 +5,7 @@ Test cases for tools/graphrag_reasoning.py
5
5
  import pytest
6
6
  from langchain_core.messages import HumanMessage
7
7
  from langchain_openai import ChatOpenAI, OpenAIEmbeddings
8
+
8
9
  from ..agents.t2kg_agent import get_app
9
10
 
10
11
  # Define the data path
@@ -52,58 +53,104 @@ def input_dict_fixture():
52
53
  "topk_nodes": 3,
53
54
  "topk_edges": 3,
54
55
  "graph_dict": {
55
- 'nodes': [('IFNG_(3495)', {}),
56
- ('IKBKG_(3672)', {}),
57
- ('ATG16L1_(6661)', {}),
58
- ('inflammatory bowel disease_(28158)', {}),
59
- ('Crohn ileitis and jejunitis_(35814)', {}),
60
- ("Crohn's colitis_(83770)", {})],
61
- 'edges': [('IFNG_(3495)', 'inflammatory bowel disease_(28158)',
62
- {'relation': ['gene/protein', 'associated with', 'disease'],
63
- 'label': ['gene/protein', 'associated with', 'disease']}),
64
- ('IFNG_(3495)', "Crohn's colitis_(83770)",
65
- {'relation': ['gene/protein', 'associated with', 'disease'],
66
- 'label': ['gene/protein', 'associated with', 'disease']}),
67
- ('IFNG_(3495)', 'Crohn ileitis and jejunitis_(35814)',
68
- {'relation': ['gene/protein', 'associated with', 'disease'],
69
- 'label': ['gene/protein', 'associated with', 'disease']}),
70
- ('ATG16L1_(6661)', 'IKBKG_(3672)',
71
- {'relation': ['gene/protein', 'ppi', 'gene/protein'],
72
- 'label': ['gene/protein', 'ppi', 'gene/protein']}),
73
- ("Crohn's colitis_(83770)", 'ATG16L1_(6661)',
74
- {'relation': ['disease', 'associated with', 'gene/protein'],
75
- 'label': ['disease', 'associated with', 'gene/protein']})]},
56
+ "nodes": [
57
+ ("IFNG_(3495)", {}),
58
+ ("IKBKG_(3672)", {}),
59
+ ("ATG16L1_(6661)", {}),
60
+ ("inflammatory bowel disease_(28158)", {}),
61
+ ("Crohn ileitis and jejunitis_(35814)", {}),
62
+ ("Crohn's colitis_(83770)", {}),
63
+ ],
64
+ "edges": [
65
+ (
66
+ "IFNG_(3495)",
67
+ "inflammatory bowel disease_(28158)",
68
+ {
69
+ "relation": [
70
+ "gene/protein",
71
+ "associated with",
72
+ "disease",
73
+ ],
74
+ "label": ["gene/protein", "associated with", "disease"],
75
+ },
76
+ ),
77
+ (
78
+ "IFNG_(3495)",
79
+ "Crohn's colitis_(83770)",
80
+ {
81
+ "relation": [
82
+ "gene/protein",
83
+ "associated with",
84
+ "disease",
85
+ ],
86
+ "label": ["gene/protein", "associated with", "disease"],
87
+ },
88
+ ),
89
+ (
90
+ "IFNG_(3495)",
91
+ "Crohn ileitis and jejunitis_(35814)",
92
+ {
93
+ "relation": [
94
+ "gene/protein",
95
+ "associated with",
96
+ "disease",
97
+ ],
98
+ "label": ["gene/protein", "associated with", "disease"],
99
+ },
100
+ ),
101
+ (
102
+ "ATG16L1_(6661)",
103
+ "IKBKG_(3672)",
104
+ {
105
+ "relation": ["gene/protein", "ppi", "gene/protein"],
106
+ "label": ["gene/protein", "ppi", "gene/protein"],
107
+ },
108
+ ),
109
+ (
110
+ "Crohn's colitis_(83770)",
111
+ "ATG16L1_(6661)",
112
+ {
113
+ "relation": [
114
+ "disease",
115
+ "associated with",
116
+ "gene/protein",
117
+ ],
118
+ "label": ["disease", "associated with", "gene/protein"],
119
+ },
120
+ ),
121
+ ],
122
+ },
76
123
  "graph_text": """
77
124
  node_id,node_attr
78
- IFNG_(3495),"IFNG belongs to gene/protein category.
79
- This gene encodes a soluble cytokine that is a member of the type II interferon class.
80
- The encoded protein is secreted by cells of both the innate and adaptive immune systems.
81
- The active protein is a homodimer that binds to the interferon gamma receptor
82
- which triggers a cellular response to viral and microbial infections.
83
- Mutations in this gene are associated with an increased susceptibility to viral,
84
- bacterial and parasitic infections and to several autoimmune diseases.
125
+ IFNG_(3495),"IFNG belongs to gene/protein category.
126
+ This gene encodes a soluble cytokine that is a member of the type II interferon class.
127
+ The encoded protein is secreted by cells of both the innate and adaptive immune systems.
128
+ The active protein is a homodimer that binds to the interferon gamma receptor
129
+ which triggers a cellular response to viral and microbial infections.
130
+ Mutations in this gene are associated with an increased susceptibility to viral,
131
+ bacterial and parasitic infections and to several autoimmune diseases.
85
132
  [provided by RefSeq, Dec 2015]."
86
- IKBKG_(3672),"IKBKG belongs to gene/protein category. This gene encodes the regulatory
87
- subunit of the inhibitor of kappaB kinase (IKK) complex, which activates NF-kappaB
88
- resulting in activation of genes involved in inflammation, immunity, cell survival,
89
- and other pathways. Mutations in this gene result in incontinentia pigmenti,
90
- hypohidrotic ectodermal dysplasia, and several other types of immunodeficiencies.
91
- A pseudogene highly similar to this locus is located in an adjacent region of the
133
+ IKBKG_(3672),"IKBKG belongs to gene/protein category. This gene encodes the regulatory
134
+ subunit of the inhibitor of kappaB kinase (IKK) complex, which activates NF-kappaB
135
+ resulting in activation of genes involved in inflammation, immunity, cell survival,
136
+ and other pathways. Mutations in this gene result in incontinentia pigmenti,
137
+ hypohidrotic ectodermal dysplasia, and several other types of immunodeficiencies.
138
+ A pseudogene highly similar to this locus is located in an adjacent region of the
92
139
  X chromosome. [provided by RefSeq, Mar 2016]."
93
- ATG16L1_(6661),"ATG16L1 belongs to gene/protein category. The protein encoded
94
- by this gene is part of a large protein complex that is necessary for autophagy,
95
- the major process by which intracellular components are targeted to lysosomes
96
- for degradation. Defects in this gene are a cause of susceptibility to inflammatory
97
- bowel disease type 10 (IBD10). Several transcript variants encoding different
140
+ ATG16L1_(6661),"ATG16L1 belongs to gene/protein category. The protein encoded
141
+ by this gene is part of a large protein complex that is necessary for autophagy,
142
+ the major process by which intracellular components are targeted to lysosomes
143
+ for degradation. Defects in this gene are a cause of susceptibility to inflammatory
144
+ bowel disease type 10 (IBD10). Several transcript variants encoding different
98
145
  isoforms have been found for this gene.[provided by RefSeq, Jun 2010]."
99
- inflammatory bowel disease_(28158),inflammatory bowel disease belongs to disease
100
- category. Any inflammatory bowel disease in which the cause of the disease
101
- is a mutation in the NOD2 gene.
102
- Crohn ileitis and jejunitis_(35814),Crohn ileitis and jejunitis belongs to
103
- disease category. An Crohn disease involving a pathogenic inflammatory
104
- response in the ileum.
105
- Crohn's colitis_(83770),Crohn's colitis belongs to disease category.
106
- Crohn's disease affecting the colon.
146
+ inflammatory bowel disease_(28158),inflammatory bowel disease belongs to disease
147
+ category. Any inflammatory bowel disease in which the cause of the disease
148
+ is a mutation in the NOD2 gene.
149
+ Crohn ileitis and jejunitis_(35814),Crohn ileitis and jejunitis belongs to
150
+ disease category. An Crohn disease involving a pathogenic inflammatory
151
+ response in the ileum.
152
+ Crohn's colitis_(83770),Crohn's colitis belongs to disease category.
153
+ Crohn's disease affecting the colon.
107
154
 
108
155
  head_id,edge_type,tail_id
109
156
  Crohn's colitis_(83770),"('disease', 'associated with', 'gene/protein')",
@@ -116,45 +163,45 @@ def input_dict_fixture():
116
163
  Crohn ileitis and jejunitis_(35814)
117
164
  """,
118
165
  "graph_summary": """
119
- The subgraph extracted from `subkg_12345` includes several important genes and
166
+ The subgraph extracted from `subkg_12345` includes several important genes and
120
167
  their associations with inflammatory bowel diseases, particularly Crohn's disease.
121
168
 
122
169
  Key Nodes:
123
- 1. **IFNG (Interferon gamma)**: This gene encodes a cytokine that plays a crucial
124
- role in immune response. It is associated with several diseases, including
125
- inflammatory bowel disease and specifically Crohn's colitis and Crohn ileitis and
126
- jejunitis. Mutations in IFNG can lead to increased susceptibility to infections
170
+ 1. **IFNG (Interferon gamma)**: This gene encodes a cytokine that plays a crucial
171
+ role in immune response. It is associated with several diseases, including
172
+ inflammatory bowel disease and specifically Crohn's colitis and Crohn ileitis and
173
+ jejunitis. Mutations in IFNG can lead to increased susceptibility to infections
127
174
  and autoimmune diseases.
128
175
 
129
- 2. **IKBKG (Inhibitor of kappaB kinase gamma)**: This gene is involved in the
130
- regulation of NF-kappaB, which is critical for inflammation and immune responses.
176
+ 2. **IKBKG (Inhibitor of kappaB kinase gamma)**: This gene is involved in the
177
+ regulation of NF-kappaB, which is critical for inflammation and immune responses.
131
178
  Mutations can lead to immunodeficiencies and other disorders.
132
179
 
133
- 3. **ATG16L1**: This gene is essential for autophagy, a process that helps in
134
- degrading intracellular components. Defects in ATG16L1 are linked to inflammatory
180
+ 3. **ATG16L1**: This gene is essential for autophagy, a process that helps in
181
+ degrading intracellular components. Defects in ATG16L1 are linked to inflammatory
135
182
  bowel disease type 10 (IBD10) and are associated with Crohn's colitis.
136
183
 
137
- 4. **Inflammatory Bowel Disease**: A category of diseases characterized by
138
- chronic inflammation of the gastrointestinal tract, with specific mention of
184
+ 4. **Inflammatory Bowel Disease**: A category of diseases characterized by
185
+ chronic inflammation of the gastrointestinal tract, with specific mention of
139
186
  mutations in the NOD2 gene as a cause.
140
187
 
141
- 5. **Crohn's Colitis**: A specific type of Crohn's disease affecting the colon,
188
+ 5. **Crohn's Colitis**: A specific type of Crohn's disease affecting the colon,
142
189
  indicating a pathogenic inflammatory response.
143
190
 
144
- 6. **Crohn Ileitis and Jejunitis**: Another form of Crohn's disease that involves
191
+ 6. **Crohn Ileitis and Jejunitis**: Another form of Crohn's disease that involves
145
192
  inflammation in the ileum.
146
193
 
147
194
  Key Edges:
148
- - **IFNG is associated with inflammatory bowel disease, Crohn's colitis, and
195
+ - **IFNG is associated with inflammatory bowel disease, Crohn's colitis, and
149
196
  Crohn ileitis and jejunitis**: This highlights the role of IFNG in these diseases.
150
- - **ATG16L1 is associated with Crohn's colitis**: This indicates a direct link
197
+ - **ATG16L1 is associated with Crohn's colitis**: This indicates a direct link
151
198
  between the gene and the disease.
152
- - **ATG16L1 interacts with IKBKG**: This protein-protein interaction suggests a
153
- functional relationship between these two genes in the context of immune response
199
+ - **ATG16L1 interacts with IKBKG**: This protein-protein interaction suggests a
200
+ functional relationship between these two genes in the context of immune response
154
201
  and inflammation.
155
202
 
156
- In summary, the subgraph illustrates the connections between key genes
157
- (IFNG, IKBKG, ATG16L1) and their associations with inflammatory bowel diseases,
203
+ In summary, the subgraph illustrates the connections between key genes
204
+ (IFNG, IKBKG, ATG16L1) and their associations with inflammatory bowel diseases,
158
205
  particularly Crohn's disease, emphasizing the genetic underpinnings of these conditions.
159
206
  """,
160
207
  }
@@ -186,11 +233,11 @@ def test_graphrag_reasoning_openai(input_dict):
186
233
  )
187
234
  prompt = """
188
235
  Without extracting a new subgraph, based on subgraph extracted from `subkg_12345`
189
- perform Graph RAG reasoning to get insights related to nodes of genes
190
- mentioned in the knowledge graph related to Adalimumab.
236
+ perform Graph RAG reasoning to get insights related to nodes of genes
237
+ mentioned in the knowledge graph related to Adalimumab.
191
238
 
192
239
  Here is an additional context:
193
- Adalimumab is a fully human monoclonal antibody (IgG1)
240
+ Adalimumab is a fully human monoclonal antibody (IgG1)
194
241
  that specifically binds to tumor necrosis factor-alpha (TNF-α), a pro-inflammatory cytokine.
195
242
  """
196
243