aiagents4pharma 1.22.0__tar.gz → 1.22.2__tar.gz

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 (179) hide show
  1. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/PKG-INFO +1 -1
  2. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/configs/config.yaml +2 -1
  3. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/configs/tools/__init__.py +1 -0
  4. aiagents4pharma-1.22.2/aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/default.yaml +8 -0
  5. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/models/basico_model.py +9 -3
  6. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_basico_model.py +7 -0
  7. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py +31 -0
  8. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_integration.py +4 -4
  9. aiagents4pharma-1.22.2/aiagents4pharma/talk2biomodels/tests/test_load_biomodel.py +32 -0
  10. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_search_models.py +13 -7
  11. aiagents4pharma-1.22.2/aiagents4pharma/talk2biomodels/tools/custom_plotter.py +157 -0
  12. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tools/get_modelinfo.py +2 -0
  13. aiagents4pharma-1.22.2/aiagents4pharma/talk2biomodels/tools/load_biomodel.py +38 -0
  14. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tools/parameter_scan.py +8 -2
  15. aiagents4pharma-1.22.2/aiagents4pharma/talk2biomodels/tools/search_models.py +85 -0
  16. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tools/simulate_model.py +3 -1
  17. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tools/steady_state.py +3 -1
  18. aiagents4pharma-1.22.2/aiagents4pharma/talk2biomodels/tools/utils.py +22 -0
  19. aiagents4pharma-1.22.2/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_summarization/__init__.py +3 -0
  20. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma.egg-info/PKG-INFO +1 -1
  21. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma.egg-info/SOURCES.txt +4 -0
  22. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/pyproject.toml +1 -0
  23. aiagents4pharma-1.22.2/release_version.txt +1 -0
  24. aiagents4pharma-1.22.0/aiagents4pharma/talk2biomodels/tools/custom_plotter.py +0 -113
  25. aiagents4pharma-1.22.0/aiagents4pharma/talk2biomodels/tools/load_biomodel.py +0 -28
  26. aiagents4pharma-1.22.0/aiagents4pharma/talk2biomodels/tools/search_models.py +0 -80
  27. aiagents4pharma-1.22.0/release_version.txt +0 -1
  28. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/LICENSE +0 -0
  29. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/README.md +0 -0
  30. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/__init__.py +0 -0
  31. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/__init__.py +0 -0
  32. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/agents/__init__.py +0 -0
  33. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/agents/t2b_agent.py +0 -0
  34. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/api/__init__.py +0 -0
  35. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/api/kegg.py +0 -0
  36. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/api/ols.py +0 -0
  37. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/api/uniprot.py +0 -0
  38. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/configs/__init__.py +0 -0
  39. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/configs/agents/__init__.py +0 -0
  40. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/configs/agents/t2b_agent/__init__.py +0 -0
  41. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/configs/agents/t2b_agent/default.yaml +0 -0
  42. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/configs/tools/ask_question/__init__.py +0 -0
  43. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/configs/tools/ask_question/default.yaml +0 -0
  44. {aiagents4pharma-1.22.0/aiagents4pharma/talk2biomodels/configs/tools/get_annotation → aiagents4pharma-1.22.2/aiagents4pharma/talk2biomodels/configs/tools/custom_plotter}/__init__.py +0 -0
  45. {aiagents4pharma-1.22.0/aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent → aiagents4pharma-1.22.2/aiagents4pharma/talk2biomodels/configs/tools/get_annotation}/__init__.py +0 -0
  46. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/configs/tools/get_annotation/default.yaml +0 -0
  47. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/models/__init__.py +0 -0
  48. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/models/sys_bio_model.py +0 -0
  49. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/states/__init__.py +0 -0
  50. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py +0 -0
  51. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/__init__.py +0 -0
  52. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_api.py +0 -0
  53. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_ask_question.py +0 -0
  54. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_get_annotation.py +0 -0
  55. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_param_scan.py +0 -0
  56. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_query_article.py +0 -0
  57. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_simulate_model.py +0 -0
  58. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_steady_state.py +0 -0
  59. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py +0 -0
  60. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tools/__init__.py +0 -0
  61. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tools/ask_question.py +0 -0
  62. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tools/get_annotation.py +0 -0
  63. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tools/load_arguments.py +0 -0
  64. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2biomodels/tools/query_article.py +0 -0
  65. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/__init__.py +0 -0
  66. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/agents/__init__.py +0 -0
  67. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/agents/scp_agent.py +0 -0
  68. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/states/__init__.py +0 -0
  69. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/states/state_talk2cells.py +0 -0
  70. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/tests/scp_agent/test_scp_agent.py +0 -0
  71. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/tools/__init__.py +0 -0
  72. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/tools/scp_agent/__init__.py +0 -0
  73. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py +0 -0
  74. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py +0 -0
  75. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/__init__.py +0 -0
  76. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/agents/__init__.py +0 -0
  77. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/agents/t2kg_agent.py +0 -0
  78. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/configs/__init__.py +0 -0
  79. {aiagents4pharma-1.22.0/aiagents4pharma/talk2knowledgegraphs/configs/app/frontend → aiagents4pharma-1.22.2/aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent}/__init__.py +0 -0
  80. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent/default.yaml +0 -0
  81. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/configs/app/__init__.py +0 -0
  82. {aiagents4pharma-1.22.0/aiagents4pharma/talk2knowledgegraphs/configs/tools/graphrag_reasoning → aiagents4pharma-1.22.2/aiagents4pharma/talk2knowledgegraphs/configs/app/frontend}/__init__.py +0 -0
  83. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/configs/app/frontend/default.yaml +0 -0
  84. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/configs/config.yaml +0 -0
  85. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/configs/tools/__init__.py +0 -0
  86. {aiagents4pharma-1.22.0/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_extraction → aiagents4pharma-1.22.2/aiagents4pharma/talk2knowledgegraphs/configs/tools/graphrag_reasoning}/__init__.py +0 -0
  87. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/configs/tools/graphrag_reasoning/default.yaml +0 -0
  88. {aiagents4pharma-1.22.0/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_summarization → aiagents4pharma-1.22.2/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_extraction}/__init__.py +0 -0
  89. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_extraction/default.yaml +0 -0
  90. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_summarization/default.yaml +0 -0
  91. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py +0 -0
  92. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py +0 -0
  93. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/datasets/dataset.py +0 -0
  94. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/datasets/primekg.py +0 -0
  95. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/datasets/starkqa_primekg.py +0 -0
  96. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/states/__init__.py +0 -0
  97. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/states/state_talk2knowledgegraphs.py +0 -0
  98. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/__init__.py +0 -0
  99. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_agents_t2kg_agent.py +0 -0
  100. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_biobridge_primekg.py +0 -0
  101. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_dataset.py +0 -0
  102. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_primekg.py +0 -0
  103. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_starkqa_primekg.py +0 -0
  104. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_tools_graphrag_reasoning.py +0 -0
  105. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_tools_subgraph_extraction.py +0 -0
  106. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_tools_subgraph_summarization.py +0 -0
  107. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py +0 -0
  108. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py +0 -0
  109. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_nim_molmim.py +0 -0
  110. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_ollama.py +0 -0
  111. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py +0 -0
  112. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_enrichments.py +0 -0
  113. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ollama.py +0 -0
  114. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_pubchem.py +0 -0
  115. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_kg_utils.py +0 -0
  116. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_pubchem_utils.py +0 -0
  117. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tools/__init__.py +0 -0
  118. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tools/graphrag_reasoning.py +0 -0
  119. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tools/load_arguments.py +0 -0
  120. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tools/subgraph_extraction.py +0 -0
  121. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/tools/subgraph_summarization.py +0 -0
  122. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/__init__.py +0 -0
  123. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py +0 -0
  124. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py +0 -0
  125. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py +0 -0
  126. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/nim_molmim.py +0 -0
  127. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/ollama.py +0 -0
  128. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py +0 -0
  129. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/__init__.py +0 -0
  130. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/enrichments.py +0 -0
  131. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/ollama.py +0 -0
  132. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/pubchem_strings.py +0 -0
  133. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/extractions/__init__.py +0 -0
  134. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/extractions/pcst.py +0 -0
  135. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/kg_utils.py +0 -0
  136. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2knowledgegraphs/utils/pubchem_utils.py +0 -0
  137. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/__init__.py +0 -0
  138. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/agents/__init__.py +0 -0
  139. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/agents/main_agent.py +0 -0
  140. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/agents/s2_agent.py +0 -0
  141. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/__init__.py +0 -0
  142. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/agents/__init__.py +0 -0
  143. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/__init__.py +0 -0
  144. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/__init__.py +0 -0
  145. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/default.yaml +0 -0
  146. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/__init__.py +0 -0
  147. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/default.yaml +0 -0
  148. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/app/__init__.py +0 -0
  149. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/app/frontend/__init__.py +0 -0
  150. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/app/frontend/default.yaml +0 -0
  151. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/config.yaml +0 -0
  152. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/tools/__init__.py +0 -0
  153. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation/__init__.py +0 -0
  154. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation/default.yaml +0 -0
  155. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/tools/retrieve_semantic_scholar_paper_id/__init__.py +0 -0
  156. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/tools/search/__init__.py +0 -0
  157. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/tools/search/default.yaml +0 -0
  158. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/__init__.py +0 -0
  159. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/default.yaml +0 -0
  160. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/state/__init__.py +0 -0
  161. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/state/state_talk2scholars.py +0 -0
  162. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tests/__init__.py +0 -0
  163. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tests/test_llm_main_integration.py +0 -0
  164. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tests/test_main_agent.py +0 -0
  165. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tests/test_s2_agent.py +0 -0
  166. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tests/test_s2_tools.py +0 -0
  167. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tests/test_state.py +0 -0
  168. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tools/__init__.py +0 -0
  169. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tools/s2/__init__.py +0 -0
  170. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tools/s2/display_results.py +0 -0
  171. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tools/s2/multi_paper_rec.py +0 -0
  172. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tools/s2/query_results.py +0 -0
  173. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tools/s2/retrieve_semantic_scholar_paper_id.py +0 -0
  174. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tools/s2/search.py +0 -0
  175. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma/talk2scholars/tools/s2/single_paper_rec.py +0 -0
  176. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma.egg-info/dependency_links.txt +0 -0
  177. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma.egg-info/requires.txt +0 -0
  178. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/aiagents4pharma.egg-info/top_level.txt +0 -0
  179. {aiagents4pharma-1.22.0 → aiagents4pharma-1.22.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: aiagents4pharma
3
- Version: 1.22.0
3
+ Version: 1.22.2
4
4
  Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D.
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -2,4 +2,5 @@ defaults:
2
2
  - _self_
3
3
  - agents/t2b_agent: default
4
4
  - tools/ask_question: default
5
- - tools/get_annotation: default
5
+ - tools/get_annotation: default
6
+ - tools/custom_plotter: default
@@ -3,3 +3,4 @@ Import all the modules in the package
3
3
  '''
4
4
  from . import ask_question
5
5
  from . import get_annotation
6
+ from . import custom_plotter
@@ -0,0 +1,8 @@
1
+ system_prompt_custom_header: >
2
+ You are custom plotter tool. You can extract species from the given
3
+ list of species names based on user question. If no species is relevant,
4
+ set the attribute `relevant_species` to None.
5
+ If the user asks for very specific species (for example, using the
6
+ keyword `only` or `exactly` in the question), set this attribute to
7
+ correspond strictly to the species available in the simulation results,
8
+ otherwise set it to None.
@@ -21,7 +21,8 @@ class BasicoModel(SysBioModel):
21
21
  Model that loads and simulates SBML models using the basico package.
22
22
  Can load models from an SBML file or download them using a BioModels biomodel_id.
23
23
  """
24
- biomodel_id: Optional[int] = Field(None, description="BioModels model ID to download and load")
24
+ biomodel_id: Optional[Union[int, str]] = Field(None,
25
+ description="BioModels model ID to download and load")
25
26
  sbml_file_path: Optional[str] = Field(None, description="Path to an SBML file to load")
26
27
  simulation_results: Optional[str] = None
27
28
  name: Optional[str] = Field("", description="Name of the model")
@@ -57,19 +58,24 @@ class BasicoModel(SysBioModel):
57
58
  # check if the param_name is not None
58
59
  if param_name is None:
59
60
  continue
60
- # if param is a kinetic parameter
61
+ # Extract all parameters and species from the model
61
62
  df_all_params = basico.model_info.get_parameters(model=self.copasi_model)
63
+ df_all_species = basico.model_info.get_species(model=self.copasi_model)
64
+ # if param is a kinetic parameter
62
65
  if param_name in df_all_params.index.tolist():
63
66
  basico.model_info.set_parameters(name=param_name,
64
67
  exact=True,
65
68
  initial_value=param_value,
66
69
  model=self.copasi_model)
67
70
  # if param is a species
68
- else:
71
+ elif param_name in df_all_species.index.tolist():
69
72
  basico.model_info.set_species(name=param_name,
70
73
  exact=True,
71
74
  initial_concentration=param_value,
72
75
  model=self.copasi_model)
76
+ else:
77
+ logger.error("Parameter/Species %s not found in the model.", param_name)
78
+ raise ValueError(f"Parameter/Species {param_name} not found in the model.")
73
79
 
74
80
  def simulate(self, duration: Union[int, float] = 10, interval: int = 10) -> pd.DataFrame:
75
81
  """
@@ -26,8 +26,15 @@ def test_with_biomodel_id(model):
26
26
  assert df_parameters.loc['KmPFKF6P', 'initial_value'] == 1.5
27
27
  # check if the simulation results are a pandas DataFrame object
28
28
  assert isinstance(model.simulate(duration=2, interval=2), pd.DataFrame)
29
+ # Pass a None value to the update_parameters method
30
+ # and it should not raise an error
29
31
  model.update_parameters(parameters={None: None})
32
+ # check if the model description is updated
30
33
  assert model.description == basico.biomodels.get_model_info(model.biomodel_id)["description"]
34
+ # check if an error is raised if an invalid species/parameter (`Pyruv`)
35
+ # is passed and it should raise a ValueError
36
+ with pytest.raises(ValueError):
37
+ model.update_parameters(parameters={'Pyruv': 0.5})
31
38
 
32
39
  def test_with_sbml_file():
33
40
  """
@@ -55,3 +55,34 @@ def test_model_with_no_species():
55
55
  test_condition = True
56
56
  break
57
57
  assert test_condition
58
+
59
+ def test_model_with_no_parameters():
60
+ '''
61
+ Test the get_modelinfo tool with a model that does not
62
+ return any parameters.
63
+
64
+ This should raise a tool error.
65
+ '''
66
+ unique_id = 12345
67
+ app = get_app(unique_id)
68
+ config = {"configurable": {"thread_id": unique_id}}
69
+ prompt = "Extract all parameters from model 10"
70
+ # Test the tool get_modelinfo
71
+ app.invoke(
72
+ {"messages": [HumanMessage(content=prompt)]},
73
+ config=config
74
+ )
75
+ current_state = app.get_state(config)
76
+ reversed_messages = current_state.values["messages"][::-1]
77
+ # Loop through the reversed messages until a
78
+ # ToolMessage is found.
79
+ test_condition = False
80
+ for msg in reversed_messages:
81
+ # Check if the message is a ToolMessage from the get_modelinfo tool
82
+ if isinstance(msg, ToolMessage) and msg.name == "get_modelinfo":
83
+ # Check if the message is an error message
84
+ if (msg.status == "error" and
85
+ "ValueError('Unable to extract parameters from the model.')" in msg.content):
86
+ test_condition = True
87
+ break
88
+ assert test_condition
@@ -20,7 +20,7 @@ def test_integration():
20
20
  # ##########################################
21
21
  # ## Test simulate_model tool
22
22
  # ##########################################
23
- prompt = '''Simulate the model 537 for 100 hours and time intervals
23
+ prompt = '''Simulate the model BIOMD0000000537 for 100 hours and time intervals
24
24
  100 with an initial concentration of `DoseQ2W` set to 300 and `Dose`
25
25
  set to 0. Reset the concentration of `Ab{serum}` to 100 every 25 hours.'''
26
26
  # Test the tool get_modelinfo
@@ -51,12 +51,12 @@ def test_integration():
51
51
  assert '211' in assistant_msg
52
52
 
53
53
  ##########################################
54
- # Test custom_plotter tool when the
54
+ # Test the custom_plotter tool when the
55
55
  # simulation results are available but
56
56
  # the species is not available
57
57
  ##########################################
58
58
  prompt = """Call the custom_plotter tool to make a plot
59
- showing only species `TP53` and `Pyruvate`. Let me
59
+ showing only species 'Infected cases'. Let me
60
60
  know if these species were not found. Do not
61
61
  invoke any other tool."""
62
62
  # Update state
@@ -117,7 +117,7 @@ def test_integration():
117
117
  # These may contain additional visuals that
118
118
  # need to be displayed to the user.
119
119
  if msg.name == "custom_plotter":
120
- predicted_artifact = msg.artifact
120
+ predicted_artifact = msg.artifact['dic_data']
121
121
  break
122
122
  # Convert the artifact into a pandas dataframe
123
123
  # for easy comparison
@@ -0,0 +1,32 @@
1
+ '''
2
+ Test cases for Talk2Biomodels.
3
+ '''
4
+
5
+ import pytest
6
+ from ..tools.load_biomodel import ModelData
7
+
8
+ def test_model_data_valid_biomodel_id():
9
+ '''
10
+ Test the ModelData class with valid
11
+ biomodel
12
+ '''
13
+ # Test with string biomodel_id starting with 'BIOMD'
14
+ model_data = ModelData(biomodel_id='BIOMD0000000537')
15
+ assert model_data.biomodel_id == 'BIOMD0000000537'
16
+
17
+ # Test with string biomodel_id starting with 'MODEL'
18
+ model_data = ModelData(biomodel_id='MODEL0000000537')
19
+ assert model_data.biomodel_id == 'MODEL0000000537'
20
+
21
+ def test_model_data_invalid_biomodel_id():
22
+ '''
23
+ Test the ModelData class with invalid
24
+ biomodel
25
+ '''
26
+ # Test with invalid string biomodel_id
27
+ with pytest.raises(ValueError):
28
+ ModelData(biomodel_id='12345')
29
+
30
+ # Test with float biomodel_id
31
+ with pytest.raises(ValueError):
32
+ ModelData(biomodel_id=123.45)
@@ -2,7 +2,7 @@
2
2
  Test cases for Talk2Biomodels search models tool.
3
3
  '''
4
4
 
5
- from langchain_core.messages import HumanMessage
5
+ from langchain_core.messages import HumanMessage, ToolMessage
6
6
  from langchain_nvidia_ai_endpoints import ChatNVIDIA
7
7
  from ..agents.t2b_agent import get_app
8
8
 
@@ -22,9 +22,15 @@ def test_search_models_tool():
22
22
  {"messages": [HumanMessage(content=prompt)]},
23
23
  config=config
24
24
  )
25
- assistant_msg = response["messages"][-1].content
26
- # Check if the assistant message is a string
27
- assert isinstance(assistant_msg, str)
28
- # Check if the assistant message contains the
29
- # biomodel id BIO0000000537
30
- assert "BIOMD0000000537" in assistant_msg
25
+ # Extract the assistant artifact which contains
26
+ # all the search results
27
+ found_model_537 = False
28
+ for msg in response["messages"]:
29
+ if isinstance(msg, ToolMessage) and msg.name == "search_models":
30
+ msg_artifact = msg.artifact
31
+ for model in msg_artifact["dic_data"]:
32
+ if model["id"] == "BIOMD0000000537":
33
+ found_model_537 = True
34
+ break
35
+ # Check if the model BIOMD0000000537 is found
36
+ assert found_model_537
@@ -0,0 +1,157 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """
4
+ Tool for plotting a custom y-axis of a simulation plot.
5
+ """
6
+
7
+ import logging
8
+ from typing import Type, Annotated, List, Tuple, Union, Literal
9
+ from pydantic import BaseModel, Field
10
+ import hydra
11
+ import pandas as pd
12
+ from langchain_core.tools import BaseTool
13
+ from langchain_core.prompts import ChatPromptTemplate
14
+ from langgraph.prebuilt import InjectedState
15
+ from .load_biomodel import ModelData, load_biomodel
16
+ from .utils import get_model_units
17
+
18
+ # Initialize logger
19
+ logging.basicConfig(level=logging.INFO)
20
+ logger = logging.getLogger(__name__)
21
+
22
+ def extract_relevant_species(question, species_names, state):
23
+ """
24
+ Extract the relevant species from the user question.
25
+
26
+ Args:
27
+ question (str): The user question.
28
+ species_names (list): The species names available in the simulation results.
29
+ state (dict): The state of the graph.
30
+
31
+ Returns:
32
+ CustomHeader: The relevant species
33
+ """
34
+ # In the following code, we extract the species
35
+ # from the user question. We use Literal to restrict
36
+ # the species names to the ones available in the
37
+ # simulation results.
38
+ class CustomHeader(BaseModel):
39
+ """
40
+ A list of species based on user question.
41
+
42
+ This is a Pydantic model that restricts the species
43
+ names to the ones available in the simulation results.
44
+
45
+ If no species is relevant, set the attribute
46
+ `relevant_species` to None.
47
+ """
48
+ relevant_species: Union[None, List[Literal[*species_names]]] = Field(
49
+ description="This is a list of species based on the user question."
50
+ "It is restricted to the species available in the simulation results."
51
+ "If no species is relevant, set this attribute to None."
52
+ "If the user asks for very specific species (for example, using the"
53
+ "keyword `only` in the question), set this attribute to correspond "
54
+ "to the species available in the simulation results, otherwise set it to None."
55
+ )
56
+ # Load hydra configuration
57
+ with hydra.initialize(version_base=None, config_path="../configs"):
58
+ cfg = hydra.compose(config_name='config',
59
+ overrides=['tools/custom_plotter=default'])
60
+ cfg = cfg.tools.custom_plotter
61
+ # Get the system prompt
62
+ system_prompt = cfg.system_prompt_custom_header
63
+ # Create an instance of the LLM model
64
+ logging.log(logging.INFO, "LLM model: %s", state['llm_model'])
65
+ llm = state['llm_model']
66
+ llm_with_structured_output = llm.with_structured_output(CustomHeader)
67
+ prompt = ChatPromptTemplate.from_messages([("system", system_prompt),
68
+ ("human", "{input}")])
69
+ few_shot_structured_llm = prompt | llm_with_structured_output
70
+ return few_shot_structured_llm.invoke(question)
71
+
72
+ class CustomPlotterInput(BaseModel):
73
+ """
74
+ Input schema for the custom plotter tool.
75
+ """
76
+ question: str = Field(description="Description of the plot")
77
+ sys_bio_model: ModelData = Field(description="model data",
78
+ default=None)
79
+ simulation_name: str = Field(description="Name assigned to the simulation")
80
+ state: Annotated[dict, InjectedState]
81
+
82
+ # Note: It's important that every field has type hints.
83
+ # BaseTool is a Pydantic class and not having type hints
84
+ # can lead to unexpected behavior.
85
+ # Note: It's important that every field has type hints.
86
+ # BaseTool is a Pydantic class and not having type hints
87
+ # can lead to unexpected behavior.
88
+ class CustomPlotterTool(BaseTool):
89
+ """
90
+ Tool for custom plotting the y-axis of a plot.
91
+ """
92
+ name: str = "custom_plotter"
93
+ description: str = '''A visualization tool designed to extract and display a subset
94
+ of the larger simulation plot generated by the simulate_model tool.
95
+ It allows users to specify particular species for the y-axis,
96
+ providing a more targeted view of key species without the clutter
97
+ of the full plot.'''
98
+ args_schema: Type[BaseModel] = CustomPlotterInput
99
+ response_format: str = "content_and_artifact"
100
+
101
+ def _run(self,
102
+ question: str,
103
+ sys_bio_model: ModelData,
104
+ simulation_name: str,
105
+ state: Annotated[dict, InjectedState]
106
+ ) -> Tuple[str, Union[None, List[str]]]:
107
+ """
108
+ Run the tool.
109
+
110
+ Args:
111
+ question (str): The question about the custom plot.
112
+ sys_bio_model (ModelData): The model data.
113
+ simulation_name (str): The name assigned to the simulation.
114
+ state (dict): The state of the graph.
115
+
116
+ Returns:
117
+ str: The answer to the question
118
+ """
119
+ logger.log(logging.INFO, "Calling custom_plotter tool %s, %s", question, sys_bio_model)
120
+ # Load the model
121
+ sbml_file_path = state['sbml_file_path'][-1] if len(state['sbml_file_path']) > 0 else None
122
+ model_object = load_biomodel(sys_bio_model, sbml_file_path=sbml_file_path)
123
+ dic_simulated_data = {}
124
+ for data in state["dic_simulated_data"]:
125
+ for key in data:
126
+ if key not in dic_simulated_data:
127
+ dic_simulated_data[key] = []
128
+ dic_simulated_data[key] += [data[key]]
129
+ # Create a pandas dataframe from the dictionary
130
+ df = pd.DataFrame.from_dict(dic_simulated_data)
131
+ # Get the simulated data for the current tool call
132
+ df = pd.DataFrame(
133
+ df[df['name'] == simulation_name]['data'].iloc[0]
134
+ )
135
+ # df = pd.DataFrame.from_dict(state['dic_simulated_data'])
136
+ species_names = df.columns.tolist()
137
+ # Exclude the time column
138
+ species_names.remove('Time')
139
+ logging.log(logging.INFO, "Species names: %s", species_names)
140
+ # Extract the relevant species from the user question
141
+ results = extract_relevant_species(question, species_names, state)
142
+ print (results)
143
+ if results.relevant_species is None:
144
+ raise ValueError("No species found in the simulation results \
145
+ that matches the user prompt.")
146
+ extracted_species = []
147
+ # Extract the species from the results
148
+ # that are available in the simulation results
149
+ for species in results.relevant_species:
150
+ if species in species_names:
151
+ extracted_species.append(species)
152
+ logging.info("Extracted species: %s", extracted_species)
153
+ # Include the time column
154
+ extracted_species.insert(0, 'Time')
155
+ return f"Custom plot {simulation_name}",{
156
+ 'dic_data': df[extracted_species].to_dict(orient='records')
157
+ }| get_model_units(model_object)
@@ -100,6 +100,8 @@ class GetModelInfoTool(BaseTool):
100
100
  # Extract parameters from the model
101
101
  if requested_model_info.parameters:
102
102
  df_parameters = basico.model_info.get_parameters(model=model_obj.copasi_model)
103
+ if df_parameters is None:
104
+ raise ValueError("Unable to extract parameters from the model.")
103
105
  # Convert index into a column
104
106
  df_parameters.reset_index(inplace=True)
105
107
  dic_results['Parameters'] = df_parameters[
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """
4
+ Function for loading the BioModel.
5
+ """
6
+
7
+ from typing import Annotated, Any, Union
8
+ from pydantic import BaseModel, BeforeValidator
9
+ from ..models.basico_model import BasicoModel
10
+
11
+ def ensure_biomodel_id(value: Any) -> Any:
12
+ """
13
+ Ensure that the biomodel_id is an integer or a string starting with 'BIOMD' or 'MODEL'.
14
+ """
15
+ if isinstance(value, int):
16
+ return value
17
+ if isinstance(value, str) and (value.startswith("BIOMD") or value.startswith("MODEL")):
18
+ return value
19
+ raise ValueError("biomodel_id must be an integer or a string starting with 'BIOMD' or 'MODEL'.")
20
+
21
+ class ModelData(BaseModel):
22
+ """
23
+ Base model for the model data.
24
+ """
25
+ biomodel_id: Annotated[Union[int, str], BeforeValidator(ensure_biomodel_id)] = None
26
+ # sbml_file_path: Optional[str] = None
27
+ use_uploaded_sbml_file: bool = False
28
+
29
+ def load_biomodel(sys_bio_model, sbml_file_path=None):
30
+ """
31
+ Load the BioModel.
32
+ """
33
+ model_object = None
34
+ if sys_bio_model.biomodel_id:
35
+ model_object = BasicoModel(biomodel_id=sys_bio_model.biomodel_id)
36
+ elif sbml_file_path:
37
+ model_object = BasicoModel(sbml_file_path=sbml_file_path)
38
+ return model_object
@@ -17,6 +17,7 @@ from langchain_core.messages import ToolMessage
17
17
  from langchain_core.tools.base import InjectedToolCallId
18
18
  from .load_biomodel import ModelData, load_biomodel
19
19
  from .load_arguments import TimeData, SpeciesInitialData
20
+ from .utils import get_model_units
20
21
 
21
22
  # Initialize logger
22
23
  logging.basicConfig(level=logging.INFO)
@@ -119,7 +120,11 @@ def run_parameter_scan(model_object,
119
120
  """
120
121
  # Extract all parameter names from the model
121
122
  df_all_parameters = basico.model_info.get_parameters(model=model_object.copasi_model)
122
- all_parameters = df_all_parameters.index.tolist()
123
+ all_parameters = []
124
+ if df_all_parameters is not None:
125
+ # For example model 10 in the BioModels database
126
+ # has no parameters
127
+ all_parameters = df_all_parameters.index.tolist()
123
128
 
124
129
  # Extract all species name from the model
125
130
  df_all_species = basico.model_info.get_species(model=model_object.copasi_model)
@@ -280,7 +285,8 @@ class ParameterScanTool(BaseTool):
280
285
  "messages": [
281
286
  ToolMessage(
282
287
  content=f"Parameter scan results of {arg_data.experiment_name}",
283
- tool_call_id=tool_call_id
288
+ tool_call_id=tool_call_id,
289
+ artifact=get_model_units(model_object)
284
290
  )
285
291
  ],
286
292
  }
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """
4
+ Tool for searching models based on search query.
5
+ """
6
+
7
+ from typing import Type, Annotated
8
+ import logging
9
+ from pydantic import BaseModel, Field
10
+ import pandas as pd
11
+ from basico import biomodels
12
+ from langgraph.types import Command
13
+ from langchain_core.tools import BaseTool
14
+ from langchain_core.messages import ToolMessage
15
+ from langchain_core.tools.base import InjectedToolCallId
16
+
17
+ # Initialize logger
18
+ logging.basicConfig(level=logging.INFO)
19
+ logger = logging.getLogger(__name__)
20
+
21
+ class SearchModelsInput(BaseModel):
22
+ """
23
+ Input schema for the search models tool.
24
+ """
25
+ query: str = Field(description="Search models query", default=None)
26
+ num_query: int = Field(description="Top number of models to search",
27
+ default=10,
28
+ le=100)
29
+ tool_call_id: Annotated[str, InjectedToolCallId]
30
+
31
+ # Note: It's important that every field has type hints. BaseTool is a
32
+ # Pydantic class and not having type hints can lead to unexpected behavior.
33
+ class SearchModelsTool(BaseTool):
34
+ """
35
+ Tool for returning the search results based on the search query.
36
+ """
37
+ name: str = "search_models"
38
+ description: str = "Search for only manually curated models in "
39
+ "the BioMmodels database based on keywords."
40
+ args_schema: Type[BaseModel] = SearchModelsInput
41
+ return_direct: bool = False
42
+
43
+ def _run(self,
44
+ tool_call_id: Annotated[str, InjectedToolCallId],
45
+ query: str = None,
46
+ num_query: int = 10) -> dict:
47
+ """
48
+ Run the tool.
49
+
50
+ Args:
51
+ query (str): The search query.
52
+ num_query (int): The number of models to search.
53
+ tool_call_id (str): The tool call ID.
54
+
55
+ Returns:
56
+ dict: The answer to the question in the form of a dictionary.
57
+ """
58
+ logger.log(logging.INFO, "Searching models with the query and number %s, %s",
59
+ query, num_query)
60
+ # Search for models based on the query
61
+ search_results = biomodels.search_for_model(query, num_results=num_query)
62
+ # Convert the search results to a pandas DataFrame
63
+ df = pd.DataFrame(search_results)
64
+ # Prepare a message to return
65
+ first_n = min(3, len(search_results))
66
+ content = f"Found {len(search_results)} manually curated models"
67
+ content += f" for the query: {query}."
68
+ # Pass the first 3 models to the LLM
69
+ # to avoid hallucinations
70
+ content += f" Here is the summary of the first {first_n} models:"
71
+ for i in range(first_n):
72
+ content += f"\nModel {i+1}: {search_results[i]['name']} (ID: {search_results[i]['id']})"
73
+ # Return the updated state of the tool
74
+ return Command(
75
+ update={
76
+ # update the message history
77
+ "messages": [
78
+ ToolMessage(
79
+ content=content,
80
+ tool_call_id=tool_call_id,
81
+ artifact={'dic_data': df.to_dict(orient='records')}
82
+ )
83
+ ],
84
+ }
85
+ )
@@ -14,6 +14,7 @@ from langchain_core.messages import ToolMessage
14
14
  from langchain_core.tools.base import InjectedToolCallId
15
15
  from .load_biomodel import ModelData, load_biomodel
16
16
  from .load_arguments import ArgumentData, add_rec_events
17
+ from .utils import get_model_units
17
18
 
18
19
  # Initialize logger
19
20
  logging.basicConfig(level=logging.INFO)
@@ -116,7 +117,8 @@ class SimulateModelTool(BaseTool):
116
117
  "messages": [
117
118
  ToolMessage(
118
119
  content=f"Simulation results of {arg_data.experiment_name}",
119
- tool_call_id=tool_call_id
120
+ tool_call_id=tool_call_id,
121
+ artifact=get_model_units(model_object)
120
122
  )
121
123
  ],
122
124
  }
@@ -134,6 +134,7 @@ class SteadyStateTool(BaseTool):
134
134
  # Run the parameter scan
135
135
  df_steady_state = run_steady_state(model_object,
136
136
  dic_species_to_be_analyzed_before_experiment)
137
+ print (df_steady_state)
137
138
  # Prepare the dictionary of scanned data
138
139
  # that will be passed to the state of the graph
139
140
  dic_steady_state_data = {
@@ -160,7 +161,8 @@ class SteadyStateTool(BaseTool):
160
161
  content=f"Steady state analysis of"
161
162
  f" {arg_data.experiment_name}"
162
163
  " was successful.",
163
- tool_call_id=tool_call_id
164
+ tool_call_id=tool_call_id,
165
+ artifact={'dic_data': df_steady_state.to_dict(orient='records')}
164
166
  )
165
167
  ],
166
168
  }
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """
4
+ Utility functions for T2B tools.
5
+ """
6
+
7
+ import basico
8
+
9
+ def get_model_units(model_object):
10
+ """
11
+ Get the units of the model.
12
+
13
+ Args:
14
+ model_object: The model object.
15
+
16
+ Returns:
17
+ dict: The units of the model.
18
+ """
19
+ model_units = basico.model_info.get_model_units(model=model_object.copasi_model)
20
+ model_units_y = model_units['quantity_unit']
21
+ model_units_x = model_units['time_unit']
22
+ return {'y_axis_label': model_units_y, 'x_axis_label': model_units_x}
@@ -0,0 +1,3 @@
1
+ '''
2
+ Import all the modules in the package
3
+ '''
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: aiagents4pharma
3
- Version: 1.22.0
3
+ Version: 1.22.2
4
4
  Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D.
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -23,6 +23,8 @@ aiagents4pharma/talk2biomodels/configs/agents/t2b_agent/default.yaml
23
23
  aiagents4pharma/talk2biomodels/configs/tools/__init__.py
24
24
  aiagents4pharma/talk2biomodels/configs/tools/ask_question/__init__.py
25
25
  aiagents4pharma/talk2biomodels/configs/tools/ask_question/default.yaml
26
+ aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/__init__.py
27
+ aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/default.yaml
26
28
  aiagents4pharma/talk2biomodels/configs/tools/get_annotation/__init__.py
27
29
  aiagents4pharma/talk2biomodels/configs/tools/get_annotation/default.yaml
28
30
  aiagents4pharma/talk2biomodels/models/__init__.py
@@ -37,6 +39,7 @@ aiagents4pharma/talk2biomodels/tests/test_basico_model.py
37
39
  aiagents4pharma/talk2biomodels/tests/test_get_annotation.py
38
40
  aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py
39
41
  aiagents4pharma/talk2biomodels/tests/test_integration.py
42
+ aiagents4pharma/talk2biomodels/tests/test_load_biomodel.py
40
43
  aiagents4pharma/talk2biomodels/tests/test_param_scan.py
41
44
  aiagents4pharma/talk2biomodels/tests/test_query_article.py
42
45
  aiagents4pharma/talk2biomodels/tests/test_search_models.py
@@ -55,6 +58,7 @@ aiagents4pharma/talk2biomodels/tools/query_article.py
55
58
  aiagents4pharma/talk2biomodels/tools/search_models.py
56
59
  aiagents4pharma/talk2biomodels/tools/simulate_model.py
57
60
  aiagents4pharma/talk2biomodels/tools/steady_state.py
61
+ aiagents4pharma/talk2biomodels/tools/utils.py
58
62
  aiagents4pharma/talk2cells/__init__.py
59
63
  aiagents4pharma/talk2cells/agents/__init__.py
60
64
  aiagents4pharma/talk2cells/agents/scp_agent.py
@@ -75,6 +75,7 @@ aiagents4pharma = [
75
75
  "talk2biomodels/configs/agents/t2b_agent/*",
76
76
  "talk2biomodels/configs/tools/ask_question/*",
77
77
  "talk2biomodels/configs/tools/get_annotation/*",
78
+ "talk2biomodels/configs/tools/custom_plotter/*",
78
79
  "talk2knowledgegraphs/configs/*",
79
80
  "talk2knowledgegraphs/configs/agents/t2kg_agent/*",
80
81
  "talk2knowledgegraphs/configs/app/frontend/*",
@@ -0,0 +1 @@
1
+ v1.22.2