aiagents4pharma 1.16.0__tar.gz → 1.17.1__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.
- aiagents4pharma-1.17.1/PKG-INFO +150 -0
- aiagents4pharma-1.17.1/README.md +101 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/__init__.py +0 -1
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/__init__.py +1 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/agents/t2b_agent.py +3 -3
- {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/agents/t2b_agent/default.yaml +1 -1
- {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/ask_question/default.yaml +1 -1
- {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/get_annotation/default.yaml +1 -1
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/ask_question.py +5 -4
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/get_annotation.py +3 -3
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/search_models.py +1 -1
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/__init__.py +1 -1
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/agents/main_agent.py +36 -15
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/agents/s2_agent.py +38 -29
- {aiagents4pharma-1.16.0/aiagents4pharma/talk2scholars/config → aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs}/__init__.py +3 -1
- {aiagents4pharma-1.16.0/aiagents4pharma/configs → aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents}/__init__.py +3 -3
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/__init__.py +6 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/__init__.py +3 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/default.yaml +39 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/__init__.py +3 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/default.yaml +68 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/app/__init__.py +5 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/app/frontend/__init__.py +3 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/app/frontend/default.yaml +33 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/config.yaml +8 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/__init__.py +7 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation/__init__.py +3 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation/default.yaml +19 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/search/__init__.py +3 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/search/default.yaml +19 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/__init__.py +3 -0
- aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/default.yaml +20 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tests/test_langgraph.py +71 -54
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/multi_paper_rec.py +13 -5
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/search.py +9 -3
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/single_paper_rec.py +13 -7
- aiagents4pharma-1.17.1/aiagents4pharma.egg-info/PKG-INFO +150 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma.egg-info/SOURCES.txt +27 -13
- aiagents4pharma-1.17.1/pyproject.toml +86 -0
- aiagents4pharma-1.17.1/release_version.txt +1 -0
- aiagents4pharma-1.16.0/PKG-INFO +0 -212
- aiagents4pharma-1.16.0/README.md +0 -163
- aiagents4pharma-1.16.0/aiagents4pharma/configs/config.yaml +0 -5
- aiagents4pharma-1.16.0/aiagents4pharma/talk2scholars/config/config.py +0 -110
- aiagents4pharma-1.16.0/aiagents4pharma.egg-info/PKG-INFO +0 -212
- aiagents4pharma-1.16.0/pyproject.toml +0 -76
- aiagents4pharma-1.16.0/release_version.txt +0 -1
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/LICENSE +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/agents/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/api/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/api/kegg.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/api/ols.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/api/uniprot.py +0 -0
- {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/__init__.py +0 -0
- {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/agents/__init__.py +0 -0
- {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/agents/t2b_agent/__init__.py +0 -0
- {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/__init__.py +0 -0
- {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/ask_question/__init__.py +0 -0
- {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/get_annotation/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/models/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/models/basico_model.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/models/sys_bio_model.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/states/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_api.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_ask_question.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_basico_model.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_get_annotation.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_integration.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_param_scan.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_query_article.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_search_models.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_simulate_model.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_steady_state.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/custom_plotter.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/get_modelinfo.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/load_arguments.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/load_biomodel.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/parameter_scan.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/query_article.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/simulate_model.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/steady_state.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/agents/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/agents/scp_agent.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/states/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/states/state_talk2cells.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tests/scp_agent/test_scp_agent.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tools/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tools/scp_agent/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/dataset.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/primekg.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/starkqa_primekg.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_biobridge_primekg.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_dataset.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_primekg.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_starkqa_primekg.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_enrichments.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ollama.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/enrichments.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/ollama.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/kg_utils.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/agents/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/state/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/state/state_talk2scholars.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tests/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/__init__.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/display_results.py +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma.egg-info/dependency_links.txt +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma.egg-info/requires.txt +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma.egg-info/top_level.txt +0 -0
- {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/setup.cfg +0 -0
@@ -0,0 +1,150 @@
|
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: aiagents4pharma
|
3
|
+
Version: 1.17.1
|
4
|
+
Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D
|
5
|
+
Classifier: Programming Language :: Python :: 3
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
7
|
+
Classifier: Operating System :: OS Independent
|
8
|
+
Requires-Python: >=3.12
|
9
|
+
Description-Content-Type: text/markdown
|
10
|
+
License-File: LICENSE
|
11
|
+
Requires-Dist: copasi_basico==0.78
|
12
|
+
Requires-Dist: coverage==7.6.4
|
13
|
+
Requires-Dist: einops==0.8.0
|
14
|
+
Requires-Dist: gdown==5.2.0
|
15
|
+
Requires-Dist: huggingface_hub==0.26.5
|
16
|
+
Requires-Dist: hydra-core==1.3.2
|
17
|
+
Requires-Dist: joblib==1.4.2
|
18
|
+
Requires-Dist: langchain==0.3.7
|
19
|
+
Requires-Dist: langchain-community==0.3.5
|
20
|
+
Requires-Dist: langchain-core==0.3.31
|
21
|
+
Requires-Dist: langchain-experimental==0.3.3
|
22
|
+
Requires-Dist: langchain-openai==0.2.5
|
23
|
+
Requires-Dist: langchain_ollama==0.2.2
|
24
|
+
Requires-Dist: langgraph==0.2.66
|
25
|
+
Requires-Dist: matplotlib==3.9.2
|
26
|
+
Requires-Dist: openai==1.59.4
|
27
|
+
Requires-Dist: ollama==0.4.6
|
28
|
+
Requires-Dist: pandas==2.2.3
|
29
|
+
Requires-Dist: plotly==5.24.1
|
30
|
+
Requires-Dist: pydantic==2.9.2
|
31
|
+
Requires-Dist: pylint==3.3.1
|
32
|
+
Requires-Dist: pypdf==5.2.0
|
33
|
+
Requires-Dist: pytest==8.3.3
|
34
|
+
Requires-Dist: pytest-asyncio==0.25.2
|
35
|
+
Requires-Dist: streamlit==1.39.0
|
36
|
+
Requires-Dist: sentence_transformers==3.3.1
|
37
|
+
Requires-Dist: tabulate==0.9.0
|
38
|
+
Requires-Dist: torch==2.2.2
|
39
|
+
Requires-Dist: torch_geometric==2.6.1
|
40
|
+
Requires-Dist: tqdm==4.66.6
|
41
|
+
Requires-Dist: transformers==4.48.0
|
42
|
+
Requires-Dist: mkdocs==1.6.1
|
43
|
+
Requires-Dist: mkdocs-jupyter==0.25.1
|
44
|
+
Requires-Dist: mkdocs-material==9.5.47
|
45
|
+
Requires-Dist: mkdocstrings-python==1.12.2
|
46
|
+
Requires-Dist: mkdocs-include-markdown-plugin==7.1.2
|
47
|
+
Requires-Dist: mkdocstrings==0.27.0
|
48
|
+
Requires-Dist: streamlit-feedback
|
49
|
+
|
50
|
+
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2biomodels.yml)
|
51
|
+
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
|
52
|
+
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
|
53
|
+
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2scholars.yml)
|
54
|
+

|
55
|
+

|
56
|
+
|
57
|
+
|
58
|
+
## Introduction
|
59
|
+
|
60
|
+
Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://github.com/VirtualPatientEngine) that brings together AI-driven tools to help researchers and pharma interact seamlessly with complex biological data.
|
61
|
+
|
62
|
+
Our toolkit currently consists of the following agents:
|
63
|
+
|
64
|
+
- **Talk2BioModels** _(v1 released; v2 in progress)_: Engage directly with mathematical models in systems biology.
|
65
|
+
- **Talk2KnowledgeGraphs** _(v1 in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
66
|
+
- **Talk2Scholars** _(v1 in progress)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
67
|
+
- **Talk2Cells** _(v1 in progress)_: Query and analyze sequencing data with ease.
|
68
|
+
|
69
|
+

|
70
|
+
|
71
|
+
## Getting Started
|
72
|
+
|
73
|
+

|
74
|
+
|
75
|
+
### Installation
|
76
|
+
|
77
|
+
#### Option 1: PyPI
|
78
|
+
|
79
|
+
```bash
|
80
|
+
pip install aiagents4pharma
|
81
|
+
```
|
82
|
+
|
83
|
+
Check out the tutorials on each agent for detailed instrcutions.
|
84
|
+
|
85
|
+
#### Option 2: git
|
86
|
+
|
87
|
+
1. **Clone the repository:**
|
88
|
+
```bash
|
89
|
+
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
90
|
+
cd AIAgents4Pharma
|
91
|
+
```
|
92
|
+
2. **Install dependencies:**
|
93
|
+
```bash
|
94
|
+
pip install .
|
95
|
+
```
|
96
|
+
3. **Initialize OPENAI_API_KEY**
|
97
|
+
```bash
|
98
|
+
export OPENAI_API_KEY=....
|
99
|
+
```
|
100
|
+
4. **[Optional] Initialize LANGSMITH_API_KEY**
|
101
|
+
```bash
|
102
|
+
export LANGCHAIN_TRACING_V2=true
|
103
|
+
export LANGCHAIN_API_KEY=<your-api-key>
|
104
|
+
```
|
105
|
+
_Please note that this will create a new tracing project in your Langsmith
|
106
|
+
account with the name `T2X-xxxx`, where `X` can be `B` (Biomodels), `S` (Scholars),
|
107
|
+
`KG` (KnowledgeGraphs), or `C` (Cells). If you skip the previous step, it will
|
108
|
+
default to the name `default`. `xxxx` will be the 4-digit ID created for the
|
109
|
+
session._
|
110
|
+
|
111
|
+
5. **Launch the app:**
|
112
|
+
```bash
|
113
|
+
streamlit run app/frontend/streamlit_app_<agent>.py
|
114
|
+
```
|
115
|
+
_Replace <agent> with the agent name you are interested to launch._
|
116
|
+
|
117
|
+
For detailed instructions on each agent, please refer to their respective modules.
|
118
|
+
|
119
|
+
---
|
120
|
+
|
121
|
+
## Contributing
|
122
|
+
|
123
|
+
We welcome contributions to AIAgents4Pharma! Here’s how you can help:
|
124
|
+
|
125
|
+
1. **Fork the repository**
|
126
|
+
2. **Create a new branch** for your feature (`git checkout -b feat/feature-name`)
|
127
|
+
3. **Commit your changes** (`git commit -m 'feat: Add new feature'`)
|
128
|
+
4. **Push to the branch** (`git push origin feat/feature-name`)
|
129
|
+
5. **Open a pull request** and reach out to any one of us below via Discussions:
|
130
|
+
|
131
|
+
_Note: We welcome all contributions, not just programming-related ones. Feel free to open bug reports, suggest new features, or participate as a beta tester. Your support is greatly appreciated!_
|
132
|
+
|
133
|
+
- **Talk2Biomodels/Talk2Cells**: [@gurdeep330](https://github.com/gurdeep330) [@lilijap](https://github.com/lilijap) [@dmccloskey](https://github.com/dmccloskey)
|
134
|
+
- **Talk2KnowledgeGraphs**: [@awmulyadi](https://github.com/awmulyadi) [@dmccloskey](https://github.com/dmccloskey)
|
135
|
+
- **Talk2Scholars**: [@ansh-info](https://github.com/ansh-info) [@gurdeep330](https://github.com/gurdeep330) [@dmccloskey](https://github.com/dmccloskey)
|
136
|
+
|
137
|
+
### Current Needs
|
138
|
+
|
139
|
+
- **Beta testers** for Talk2BioModels and Talk2Scholars.
|
140
|
+
- **Developers** with experience in Python and Bioinformatics and/or knowledge graphs for contributions to AIAgents4Pharma.
|
141
|
+
|
142
|
+
Feel free to reach out to us via Discussions.
|
143
|
+
|
144
|
+
Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
145
|
+
|
146
|
+
---
|
147
|
+
|
148
|
+
## Feedback
|
149
|
+
|
150
|
+
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use `Isssues` or `Discussions` 😀
|
@@ -0,0 +1,101 @@
|
|
1
|
+
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2biomodels.yml)
|
2
|
+
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
|
3
|
+
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
|
4
|
+
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2scholars.yml)
|
5
|
+

|
6
|
+

|
7
|
+
|
8
|
+
|
9
|
+
## Introduction
|
10
|
+
|
11
|
+
Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://github.com/VirtualPatientEngine) that brings together AI-driven tools to help researchers and pharma interact seamlessly with complex biological data.
|
12
|
+
|
13
|
+
Our toolkit currently consists of the following agents:
|
14
|
+
|
15
|
+
- **Talk2BioModels** _(v1 released; v2 in progress)_: Engage directly with mathematical models in systems biology.
|
16
|
+
- **Talk2KnowledgeGraphs** _(v1 in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
17
|
+
- **Talk2Scholars** _(v1 in progress)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
18
|
+
- **Talk2Cells** _(v1 in progress)_: Query and analyze sequencing data with ease.
|
19
|
+
|
20
|
+

|
21
|
+
|
22
|
+
## Getting Started
|
23
|
+
|
24
|
+

|
25
|
+
|
26
|
+
### Installation
|
27
|
+
|
28
|
+
#### Option 1: PyPI
|
29
|
+
|
30
|
+
```bash
|
31
|
+
pip install aiagents4pharma
|
32
|
+
```
|
33
|
+
|
34
|
+
Check out the tutorials on each agent for detailed instrcutions.
|
35
|
+
|
36
|
+
#### Option 2: git
|
37
|
+
|
38
|
+
1. **Clone the repository:**
|
39
|
+
```bash
|
40
|
+
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
41
|
+
cd AIAgents4Pharma
|
42
|
+
```
|
43
|
+
2. **Install dependencies:**
|
44
|
+
```bash
|
45
|
+
pip install .
|
46
|
+
```
|
47
|
+
3. **Initialize OPENAI_API_KEY**
|
48
|
+
```bash
|
49
|
+
export OPENAI_API_KEY=....
|
50
|
+
```
|
51
|
+
4. **[Optional] Initialize LANGSMITH_API_KEY**
|
52
|
+
```bash
|
53
|
+
export LANGCHAIN_TRACING_V2=true
|
54
|
+
export LANGCHAIN_API_KEY=<your-api-key>
|
55
|
+
```
|
56
|
+
_Please note that this will create a new tracing project in your Langsmith
|
57
|
+
account with the name `T2X-xxxx`, where `X` can be `B` (Biomodels), `S` (Scholars),
|
58
|
+
`KG` (KnowledgeGraphs), or `C` (Cells). If you skip the previous step, it will
|
59
|
+
default to the name `default`. `xxxx` will be the 4-digit ID created for the
|
60
|
+
session._
|
61
|
+
|
62
|
+
5. **Launch the app:**
|
63
|
+
```bash
|
64
|
+
streamlit run app/frontend/streamlit_app_<agent>.py
|
65
|
+
```
|
66
|
+
_Replace <agent> with the agent name you are interested to launch._
|
67
|
+
|
68
|
+
For detailed instructions on each agent, please refer to their respective modules.
|
69
|
+
|
70
|
+
---
|
71
|
+
|
72
|
+
## Contributing
|
73
|
+
|
74
|
+
We welcome contributions to AIAgents4Pharma! Here’s how you can help:
|
75
|
+
|
76
|
+
1. **Fork the repository**
|
77
|
+
2. **Create a new branch** for your feature (`git checkout -b feat/feature-name`)
|
78
|
+
3. **Commit your changes** (`git commit -m 'feat: Add new feature'`)
|
79
|
+
4. **Push to the branch** (`git push origin feat/feature-name`)
|
80
|
+
5. **Open a pull request** and reach out to any one of us below via Discussions:
|
81
|
+
|
82
|
+
_Note: We welcome all contributions, not just programming-related ones. Feel free to open bug reports, suggest new features, or participate as a beta tester. Your support is greatly appreciated!_
|
83
|
+
|
84
|
+
- **Talk2Biomodels/Talk2Cells**: [@gurdeep330](https://github.com/gurdeep330) [@lilijap](https://github.com/lilijap) [@dmccloskey](https://github.com/dmccloskey)
|
85
|
+
- **Talk2KnowledgeGraphs**: [@awmulyadi](https://github.com/awmulyadi) [@dmccloskey](https://github.com/dmccloskey)
|
86
|
+
- **Talk2Scholars**: [@ansh-info](https://github.com/ansh-info) [@gurdeep330](https://github.com/gurdeep330) [@dmccloskey](https://github.com/dmccloskey)
|
87
|
+
|
88
|
+
### Current Needs
|
89
|
+
|
90
|
+
- **Beta testers** for Talk2BioModels and Talk2Scholars.
|
91
|
+
- **Developers** with experience in Python and Bioinformatics and/or knowledge graphs for contributions to AIAgents4Pharma.
|
92
|
+
|
93
|
+
Feel free to reach out to us via Discussions.
|
94
|
+
|
95
|
+
Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
96
|
+
|
97
|
+
---
|
98
|
+
|
99
|
+
## Feedback
|
100
|
+
|
101
|
+
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use `Isssues` or `Discussions` 😀
|
{aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/agents/t2b_agent.py
RENAMED
@@ -55,10 +55,10 @@ def get_app(uniq_id, llm_model='gpt-4o-mini'):
|
|
55
55
|
llm = ChatOpenAI(model=llm_model, temperature=0)
|
56
56
|
# Load hydra configuration
|
57
57
|
logger.log(logging.INFO, "Load Hydra configuration for Talk2BioModels agent.")
|
58
|
-
with hydra.initialize(version_base=None, config_path="
|
58
|
+
with hydra.initialize(version_base=None, config_path="../configs"):
|
59
59
|
cfg = hydra.compose(config_name='config',
|
60
|
-
overrides=['
|
61
|
-
cfg = cfg.
|
60
|
+
overrides=['agents/t2b_agent=default'])
|
61
|
+
cfg = cfg.agents.t2b_agent
|
62
62
|
logger.log(logging.INFO, "state_modifier: %s", cfg.state_modifier)
|
63
63
|
# Create the agent
|
64
64
|
model = create_react_agent(
|
@@ -66,10 +66,10 @@ class AskQuestionTool(BaseTool):
|
|
66
66
|
question_context,
|
67
67
|
experiment_name)
|
68
68
|
# Load hydra configuration
|
69
|
-
with hydra.initialize(version_base=None, config_path="
|
69
|
+
with hydra.initialize(version_base=None, config_path="../configs"):
|
70
70
|
cfg = hydra.compose(config_name='config',
|
71
|
-
overrides=['
|
72
|
-
cfg = cfg.
|
71
|
+
overrides=['tools/ask_question=default'])
|
72
|
+
cfg = cfg.tools.ask_question
|
73
73
|
# Get the context of the question
|
74
74
|
# and based on the context, get the data
|
75
75
|
# and prompt content to ask the question
|
@@ -111,5 +111,6 @@ class AskQuestionTool(BaseTool):
|
|
111
111
|
verbose=True,
|
112
112
|
prefix=prompt_content)
|
113
113
|
# Invoke the agent with the question
|
114
|
-
llm_result = df_agent.invoke(question)
|
114
|
+
llm_result = df_agent.invoke(question, stream_mode=None)
|
115
|
+
# print (llm_result)
|
115
116
|
return llm_result["output"]
|
@@ -34,10 +34,10 @@ def extract_relevant_species_names(model_object, arg_data, state):
|
|
34
34
|
Extract relevant species names based on the user question.
|
35
35
|
"""
|
36
36
|
# Load hydra configuration
|
37
|
-
with hydra.initialize(version_base=None, config_path="
|
37
|
+
with hydra.initialize(version_base=None, config_path="../configs"):
|
38
38
|
cfg = hydra.compose(config_name='config',
|
39
|
-
overrides=['
|
40
|
-
cfg = cfg.
|
39
|
+
overrides=['tools/get_annotation=default'])
|
40
|
+
cfg = cfg.tools.get_annotation
|
41
41
|
logger.info("Loaded the following system prompt for the LLM"
|
42
42
|
" to get a structured output: %s", cfg.prompt)
|
43
43
|
|
@@ -29,7 +29,7 @@ class SearchModelsTool(BaseTool):
|
|
29
29
|
name: str = "search_models"
|
30
30
|
description: str = "Search models in the BioMmodels database based on keywords."
|
31
31
|
args_schema: Type[BaseModel] = SearchModelsInput
|
32
|
-
return_direct: bool =
|
32
|
+
return_direct: bool = False
|
33
33
|
|
34
34
|
def _run(self,
|
35
35
|
query: str,
|
{aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/agents/main_agent.py
RENAMED
@@ -5,8 +5,8 @@ Main agent for the talk2scholars app.
|
|
5
5
|
"""
|
6
6
|
|
7
7
|
import logging
|
8
|
-
from typing import Literal
|
9
|
-
|
8
|
+
from typing import Literal, Any
|
9
|
+
import hydra
|
10
10
|
from langchain_core.language_models.chat_models import BaseChatModel
|
11
11
|
from langchain_core.messages import AIMessage
|
12
12
|
from langchain_openai import ChatOpenAI
|
@@ -14,27 +14,26 @@ from langgraph.checkpoint.memory import MemorySaver
|
|
14
14
|
from langgraph.graph import END, START, StateGraph
|
15
15
|
from langgraph.types import Command
|
16
16
|
from ..agents import s2_agent
|
17
|
-
from ..config.config import config
|
18
17
|
from ..state.state_talk2scholars import Talk2Scholars
|
19
18
|
|
20
19
|
logging.basicConfig(level=logging.INFO)
|
21
20
|
logger = logging.getLogger(__name__)
|
22
21
|
|
23
|
-
load_dotenv()
|
24
22
|
|
25
|
-
def make_supervisor_node(llm: BaseChatModel) -> str:
|
23
|
+
def make_supervisor_node(llm: BaseChatModel, cfg: Any) -> str:
|
26
24
|
"""
|
27
25
|
Creates a supervisor node following LangGraph patterns.
|
28
26
|
|
29
27
|
Args:
|
30
28
|
llm (BaseChatModel): The language model to use for generating responses.
|
29
|
+
cfg (Any): The configuration object.
|
31
30
|
|
32
31
|
Returns:
|
33
32
|
str: The supervisor node function.
|
34
33
|
"""
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
def supervisor_node(
|
35
|
+
state: Talk2Scholars,
|
36
|
+
) -> Command[Literal["s2_agent", "__end__"]]:
|
38
37
|
"""
|
39
38
|
Supervisor node that routes to appropriate sub-agents.
|
40
39
|
|
@@ -44,9 +43,13 @@ def make_supervisor_node(llm: BaseChatModel) -> str:
|
|
44
43
|
Returns:
|
45
44
|
Command[Literal["s2_agent", "__end__"]]: The command to execute next.
|
46
45
|
"""
|
47
|
-
logger.info(
|
46
|
+
logger.info(
|
47
|
+
"Supervisor node called - Messages count: %d, Current Agent: %s",
|
48
|
+
len(state["messages"]),
|
49
|
+
state.get("current_agent", "None"),
|
50
|
+
)
|
48
51
|
|
49
|
-
messages = [{"role": "system", "content":
|
52
|
+
messages = [{"role": "system", "content": cfg.state_modifier}] + state[
|
50
53
|
"messages"
|
51
54
|
]
|
52
55
|
response = llm.invoke(messages)
|
@@ -81,7 +84,8 @@ def make_supervisor_node(llm: BaseChatModel) -> str:
|
|
81
84
|
|
82
85
|
return supervisor_node
|
83
86
|
|
84
|
-
|
87
|
+
|
88
|
+
def get_app(thread_id: str, llm_model="gpt-4o-mini") -> StateGraph:
|
85
89
|
"""
|
86
90
|
Returns the langraph app with hierarchical structure.
|
87
91
|
|
@@ -91,6 +95,16 @@ def get_app(thread_id: str, llm_model ='gpt-4o-mini') -> StateGraph:
|
|
91
95
|
Returns:
|
92
96
|
The compiled langraph app.
|
93
97
|
"""
|
98
|
+
|
99
|
+
# Load hydra configuration
|
100
|
+
logger.log(logging.INFO, "Load Hydra configuration for Talk2Scholars main agent.")
|
101
|
+
with hydra.initialize(version_base=None, config_path="../../configs"):
|
102
|
+
cfg = hydra.compose(
|
103
|
+
config_name="config", overrides=["agents/talk2scholars/main_agent=default"]
|
104
|
+
)
|
105
|
+
cfg = cfg.agents.talk2scholars.main_agent
|
106
|
+
logger.info("Hydra configuration loaded with values: %s", cfg)
|
107
|
+
|
94
108
|
def call_s2_agent(state: Talk2Scholars) -> Command[Literal["__end__"]]:
|
95
109
|
"""
|
96
110
|
Node for calling the S2 agent.
|
@@ -101,10 +115,10 @@ def get_app(thread_id: str, llm_model ='gpt-4o-mini') -> StateGraph:
|
|
101
115
|
Returns:
|
102
116
|
Command[Literal["__end__"]]: The command to execute next.
|
103
117
|
"""
|
104
|
-
logger.info("Calling S2 agent")
|
118
|
+
logger.info("Calling S2 agent with state: %s", state)
|
105
119
|
app = s2_agent.get_app(thread_id, llm_model)
|
106
120
|
response = app.invoke(state)
|
107
|
-
logger.info("S2 agent completed")
|
121
|
+
logger.info("S2 agent completed with response: %s", response)
|
108
122
|
return Command(
|
109
123
|
goto=END,
|
110
124
|
update={
|
@@ -114,10 +128,17 @@ def get_app(thread_id: str, llm_model ='gpt-4o-mini') -> StateGraph:
|
|
114
128
|
"current_agent": "s2_agent",
|
115
129
|
},
|
116
130
|
)
|
117
|
-
|
131
|
+
|
132
|
+
logger.log(
|
133
|
+
logging.INFO,
|
134
|
+
"Using OpenAI model %s with temperature %s",
|
135
|
+
llm_model,
|
136
|
+
cfg.temperature
|
137
|
+
)
|
138
|
+
llm = ChatOpenAI(model=llm_model, temperature=cfg.temperature)
|
118
139
|
workflow = StateGraph(Talk2Scholars)
|
119
140
|
|
120
|
-
supervisor = make_supervisor_node(llm)
|
141
|
+
supervisor = make_supervisor_node(llm, cfg)
|
121
142
|
workflow.add_node("supervisor", supervisor)
|
122
143
|
workflow.add_node("s2_agent", call_s2_agent)
|
123
144
|
|
{aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/agents/s2_agent.py
RENAMED
@@ -1,56 +1,65 @@
|
|
1
|
-
|
1
|
+
# /usr/bin/env python3
|
2
2
|
|
3
|
-
|
3
|
+
"""
|
4
4
|
Agent for interacting with Semantic Scholar
|
5
|
-
|
5
|
+
"""
|
6
6
|
|
7
7
|
import logging
|
8
|
-
|
8
|
+
import hydra
|
9
9
|
from langchain_openai import ChatOpenAI
|
10
10
|
from langgraph.graph import START, StateGraph
|
11
|
-
from langgraph.prebuilt import create_react_agent
|
11
|
+
from langgraph.prebuilt import create_react_agent, ToolNode
|
12
12
|
from langgraph.checkpoint.memory import MemorySaver
|
13
|
-
from ..config.config import config
|
14
13
|
from ..state.state_talk2scholars import Talk2Scholars
|
15
|
-
|
16
|
-
from ..tools.s2.
|
17
|
-
from ..tools.s2.
|
18
|
-
|
19
|
-
|
14
|
+
from ..tools.s2.search import search_tool as s2_search
|
15
|
+
from ..tools.s2.display_results import display_results as s2_display
|
16
|
+
from ..tools.s2.single_paper_rec import (
|
17
|
+
get_single_paper_recommendations as s2_single_rec,
|
18
|
+
)
|
19
|
+
from ..tools.s2.multi_paper_rec import get_multi_paper_recommendations as s2_multi_rec
|
20
20
|
|
21
|
-
load_dotenv()
|
22
21
|
|
23
22
|
# Initialize logger
|
24
23
|
logging.basicConfig(level=logging.INFO)
|
25
24
|
logger = logging.getLogger(__name__)
|
26
25
|
|
27
|
-
|
28
|
-
|
26
|
+
|
27
|
+
def get_app(uniq_id, llm_model="gpt-4o-mini"):
|
28
|
+
"""
|
29
29
|
This function returns the langraph app.
|
30
|
-
|
30
|
+
"""
|
31
|
+
|
31
32
|
def agent_s2_node(state: Talk2Scholars):
|
32
|
-
|
33
|
+
"""
|
33
34
|
This function calls the model.
|
34
|
-
|
35
|
+
"""
|
35
36
|
logger.log(logging.INFO, "Creating Agent_S2 node with thread_id %s", uniq_id)
|
36
37
|
response = model.invoke(state, {"configurable": {"thread_id": uniq_id}})
|
37
38
|
return response
|
38
39
|
|
40
|
+
# Load hydra configuration
|
41
|
+
logger.log(logging.INFO, "Load Hydra configuration for Talk2Scholars S2 agent.")
|
42
|
+
with hydra.initialize(version_base=None, config_path="../../configs"):
|
43
|
+
cfg = hydra.compose(
|
44
|
+
config_name="config", overrides=["agents/talk2scholars/s2_agent=default"]
|
45
|
+
)
|
46
|
+
cfg = cfg.agents.talk2scholars.s2_agent
|
47
|
+
|
39
48
|
# Define the tools
|
40
|
-
tools = [
|
41
|
-
|
42
|
-
|
43
|
-
|
49
|
+
tools = ToolNode([s2_search, s2_display, s2_single_rec, s2_multi_rec])
|
50
|
+
|
51
|
+
# Define the model
|
52
|
+
logger.log(logging.INFO, "Using OpenAI model %s", llm_model)
|
53
|
+
llm = ChatOpenAI(model=llm_model, temperature=cfg.temperature)
|
44
54
|
|
45
|
-
# Create the
|
46
|
-
llm = ChatOpenAI(model=llm_model, temperature=0)
|
55
|
+
# Create the agent
|
47
56
|
model = create_react_agent(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
57
|
+
llm,
|
58
|
+
tools=tools,
|
59
|
+
state_schema=Talk2Scholars,
|
60
|
+
state_modifier=cfg.s2_agent,
|
61
|
+
checkpointer=MemorySaver(),
|
62
|
+
)
|
54
63
|
|
55
64
|
# Define a new graph
|
56
65
|
workflow = StateGraph(Talk2Scholars)
|
@@ -0,0 +1,39 @@
|
|
1
|
+
_target_: agents.main_agent.get_app
|
2
|
+
openai_api_key: ${oc.env:OPENAI_API_KEY}
|
3
|
+
openai_llms:
|
4
|
+
- "gpt-4o-mini"
|
5
|
+
- "gpt-4-turbo"
|
6
|
+
- "gpt-3.5-turbo"
|
7
|
+
temperature: 0
|
8
|
+
main_agent: >
|
9
|
+
"You are a supervisory AI agent that routes user queries to specialized tools.\n"
|
10
|
+
"Your task is to select the most appropriate tool based on the user's request.\n\n"
|
11
|
+
"Available tools and their capabilities:\n\n"
|
12
|
+
"1. semantic_scholar_agent:\n"
|
13
|
+
" - Search for academic papers and research\n"
|
14
|
+
" - Get paper recommendations\n"
|
15
|
+
" - Find similar papers\n"
|
16
|
+
" USE FOR: Any queries about finding papers, academic research, "
|
17
|
+
"or getting paper recommendations\n\n"
|
18
|
+
"ROUTING GUIDELINES:\n\n"
|
19
|
+
"ALWAYS route to semantic_scholar_agent for:\n"
|
20
|
+
"- Finding academic papers\n"
|
21
|
+
"- Searching research topics\n"
|
22
|
+
"- Getting paper recommendations\n"
|
23
|
+
"- Finding similar papers\n"
|
24
|
+
"- Any query about academic literature\n\n"
|
25
|
+
"Approach:\n"
|
26
|
+
"1. Identify the core need in the user's query\n"
|
27
|
+
"2. Select the most appropriate tool based on the guidelines above\n"
|
28
|
+
"3. If unclear, ask for clarification\n"
|
29
|
+
"4. For multi-step tasks, focus on the immediate next step\n\n"
|
30
|
+
"Remember:\n"
|
31
|
+
"- Be decisive in your tool selection\n"
|
32
|
+
"- Focus on the immediate task\n"
|
33
|
+
"- Default to semantic_scholar_agent for any paper-finding tasks\n"
|
34
|
+
"- Ask for clarification if the request is ambiguous\n\n"
|
35
|
+
"When presenting paper search results, always use this exact format:\n\n"
|
36
|
+
"Remember to:\n"
|
37
|
+
"- To always add the url\n"
|
38
|
+
"- Put URLs on the title line itself as markdown\n"
|
39
|
+
"- Maintain consistent spacing and formatting"
|