aiagents4pharma 1.8.3__tar.gz → 1.10.0__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.8.3 → aiagents4pharma-1.10.0}/PKG-INFO +37 -18
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/README.md +35 -16
- aiagents4pharma-1.10.0/aiagents4pharma/__init__.py +11 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/talk2biomodels/agents/t2b_agent/default.yaml +3 -1
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/__init__.py +1 -1
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py +1 -1
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tests/test_langgraph.py +71 -20
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/ask_question.py +16 -7
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/custom_plotter.py +20 -14
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/get_modelinfo.py +6 -6
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/simulate_model.py +26 -12
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/__init__.py +5 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/agents/__init__.py +6 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/agents/main_agent.py +130 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/agents/s2_agent.py +75 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/config/__init__.py +5 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/config/config.py +110 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/state/__init__.py +5 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/state/state_talk2competitors.py +32 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tests/__init__.py +3 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tests/test_langgraph.py +274 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/__init__.py +7 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/__init__.py +8 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/display_results.py +25 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/multi_paper_rec.py +132 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/search.py +119 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/single_paper_rec.py +141 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/PKG-INFO +37 -18
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/SOURCES.txt +15 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/pyproject.toml +1 -1
- aiagents4pharma-1.10.0/release_version.txt +1 -0
- aiagents4pharma-1.8.3/aiagents4pharma/__init__.py +0 -8
- aiagents4pharma-1.8.3/aiagents4pharma/talk2knowledgegraphs/utils/__init__.py +0 -0
- aiagents4pharma-1.8.3/release_version.txt +0 -1
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/LICENSE +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/config.yaml +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/talk2biomodels/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/talk2biomodels/agents/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/talk2biomodels/agents/t2b_agent/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/agents/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/agents/t2b_agent.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/models/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/models/basico_model.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/models/sys_bio_model.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/states/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tests/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tests/test_basico_model.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/load_biomodel.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/search_models.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/agents/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/agents/scp_agent.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/states/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/states/state_talk2cells.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tests/scp_agent/test_scp_agent.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tools/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tools/scp_agent/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/dataset.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/primekg.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/starkqa_primekg.py +0 -0
- {aiagents4pharma-1.8.3/aiagents4pharma/talk2competitors → aiagents4pharma-1.10.0/aiagents4pharma/talk2knowledgegraphs/tests}/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_biobridge_primekg.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_dataset.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_primekg.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_starkqa_primekg.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py +0 -0
- {aiagents4pharma-1.8.3/aiagents4pharma/talk2knowledgegraphs/tests → aiagents4pharma-1.10.0/aiagents4pharma/talk2knowledgegraphs/utils}/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/kg_utils.py +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/dependency_links.txt +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/requires.txt +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/top_level.txt +0 -0
- {aiagents4pharma-1.8.3 → aiagents4pharma-1.10.0}/setup.cfg +0 -0
@@ -1,11 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: aiagents4pharma
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.10.0
|
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
|
7
7
|
Classifier: Operating System :: OS Independent
|
8
|
-
Requires-Python: >=3.
|
8
|
+
Requires-Python: >=3.12
|
9
9
|
Description-Content-Type: text/markdown
|
10
10
|
License-File: LICENSE
|
11
11
|
Requires-Dist: copasi_basico==0.78
|
@@ -48,6 +48,9 @@ Requires-Dist: streamlit-feedback
|
|
48
48
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
|
49
49
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
|
50
50
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2competitors.yml)
|
51
|
+

|
52
|
+

|
53
|
+
|
51
54
|
|
52
55
|
<h1 align="center" style="border-bottom: none;">🤖 AIAgents4Pharma</h1>
|
53
56
|
|
@@ -56,9 +59,9 @@ Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://
|
|
56
59
|
Our toolkit currently consists of three intelligent agents, each designed to simplify and enhance access to specialized data in biology:
|
57
60
|
|
58
61
|
- **Talk2BioModels**: Engage directly with mathematical models in systems biology.
|
59
|
-
- **Talk2Cells**
|
60
|
-
- **Talk2KnowledgeGraphs**
|
61
|
-
- **Talk2Competitors**
|
62
|
+
- **Talk2Cells** _(Work in progress)_: Query and analyze sequencing data with ease.
|
63
|
+
- **Talk2KnowledgeGraphs** _(Work in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
64
|
+
- **Talk2Competitors** _(Coming soon)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
62
65
|
|
63
66
|
---
|
64
67
|
|
@@ -72,15 +75,15 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
72
75
|
- Adjust parameters within the model to simulate different conditions.
|
73
76
|
- Query simulation results.
|
74
77
|
|
75
|
-
### 2. Talk2Cells
|
78
|
+
### 2. Talk2Cells _(Work in Progress)_
|
76
79
|
|
77
80
|
**Talk2Cells** is being developed to provide direct access to and analysis of sequencing data, such as RNA-Seq or DNA-Seq, using natural language.
|
78
81
|
|
79
|
-
### 3. Talk2KnowledgeGraphs
|
82
|
+
### 3. Talk2KnowledgeGraphs _(Work in Progress)_
|
80
83
|
|
81
84
|
**Talk2KnowledgeGraphs** is an agent designed to enable interaction with biological knowledge graphs (KGs). KGs integrate vast amounts of structured biological data into a format that highlights relationships between entities, such as proteins, genes, and diseases.
|
82
85
|
|
83
|
-
### 4.
|
86
|
+
### 4. Talk2Competitors _(Coming soon)_
|
84
87
|
|
85
88
|
## Getting Started
|
86
89
|
|
@@ -91,48 +94,60 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
91
94
|
- Required libraries specified in `requirements.txt`
|
92
95
|
|
93
96
|
### Installation
|
97
|
+
|
94
98
|
#### Option 1: PyPI
|
95
|
-
|
96
|
-
|
97
|
-
|
99
|
+
|
100
|
+
```bash
|
101
|
+
pip install aiagents4pharma
|
102
|
+
```
|
98
103
|
|
99
104
|
Check out the tutorials on each agent for detailed instrcutions.
|
100
105
|
|
101
106
|
#### Option 2: git
|
107
|
+
|
102
108
|
1. **Clone the repository:**
|
109
|
+
|
103
110
|
```bash
|
104
111
|
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
105
112
|
cd AIAgents4Pharma
|
106
113
|
```
|
107
114
|
|
108
115
|
2. **Install dependencies:**
|
116
|
+
|
109
117
|
```bash
|
110
118
|
pip install .
|
111
119
|
```
|
112
120
|
|
113
121
|
3. **Initialize OPENAI_API_KEY**
|
122
|
+
|
114
123
|
```bash
|
115
|
-
export OPENAI_API_KEY
|
124
|
+
export OPENAI_API_KEY=....
|
116
125
|
```
|
117
126
|
|
118
127
|
4. **[Optional] Set up login credentials**
|
128
|
+
|
119
129
|
```bash
|
120
130
|
vi .streamlit/secrets.toml
|
121
131
|
```
|
132
|
+
|
122
133
|
and enter
|
134
|
+
|
123
135
|
```
|
124
136
|
password='XXX'
|
125
137
|
```
|
126
|
-
|
138
|
+
|
139
|
+
Please note that the passoword will be same for all the users.
|
127
140
|
|
128
141
|
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
142
|
+
|
129
143
|
```bash
|
130
144
|
export LANGCHAIN_TRACING_V2=true
|
131
145
|
export LANGCHAIN_API_KEY=<your-api-key>
|
132
146
|
```
|
133
|
-
|
134
|
-
|
135
|
-
|
147
|
+
|
148
|
+
Please note that this will create a new tracing project in your Langsmith
|
149
|
+
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
150
|
+
you provided in the previous step. If you skip the previous step, it will
|
136
151
|
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
137
152
|
session.
|
138
153
|
|
@@ -164,6 +179,7 @@ We welcome contributions to AIAgents4Pharma! Here’s how you can help:
|
|
164
179
|
5. **Open a pull request**
|
165
180
|
|
166
181
|
### Current Needs
|
182
|
+
|
167
183
|
- **Beta testers** for Talk2BioModels.
|
168
184
|
- **Developers** with experience in natural language processing, bioinformatics, or knowledge graphs for contributions to AIAgents4Pharma.
|
169
185
|
|
@@ -174,19 +190,22 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
174
190
|
## Roadmap
|
175
191
|
|
176
192
|
### Completed
|
193
|
+
|
177
194
|
- **Talk2BioModels**: Initial release with core capabilities for interacting with systems biology models.
|
178
195
|
|
179
196
|
### Planned
|
197
|
+
|
180
198
|
- **User Interface**: Interactive web UI for all agents.
|
181
199
|
- **Talk2Cells**: Integration of sequencing data analysis tools.
|
182
200
|
- **Talk2KnowledgeGraphs**: Interface for biological knowledge graph interaction.
|
183
|
-
- **Talk2Competitors
|
201
|
+
- **Talk2Competitors**: Interface for exploring articles
|
184
202
|
|
185
|
-
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
203
|
+
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
186
204
|
|
187
205
|
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
188
206
|
|
189
207
|
---
|
190
208
|
|
191
209
|
## Feedback
|
210
|
+
|
192
211
|
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
@@ -2,6 +2,9 @@
|
|
2
2
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
|
3
3
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
|
4
4
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2competitors.yml)
|
5
|
+

|
6
|
+

|
7
|
+
|
5
8
|
|
6
9
|
<h1 align="center" style="border-bottom: none;">🤖 AIAgents4Pharma</h1>
|
7
10
|
|
@@ -10,9 +13,9 @@ Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://
|
|
10
13
|
Our toolkit currently consists of three intelligent agents, each designed to simplify and enhance access to specialized data in biology:
|
11
14
|
|
12
15
|
- **Talk2BioModels**: Engage directly with mathematical models in systems biology.
|
13
|
-
- **Talk2Cells**
|
14
|
-
- **Talk2KnowledgeGraphs**
|
15
|
-
- **Talk2Competitors**
|
16
|
+
- **Talk2Cells** _(Work in progress)_: Query and analyze sequencing data with ease.
|
17
|
+
- **Talk2KnowledgeGraphs** _(Work in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
18
|
+
- **Talk2Competitors** _(Coming soon)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
16
19
|
|
17
20
|
---
|
18
21
|
|
@@ -26,15 +29,15 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
26
29
|
- Adjust parameters within the model to simulate different conditions.
|
27
30
|
- Query simulation results.
|
28
31
|
|
29
|
-
### 2. Talk2Cells
|
32
|
+
### 2. Talk2Cells _(Work in Progress)_
|
30
33
|
|
31
34
|
**Talk2Cells** is being developed to provide direct access to and analysis of sequencing data, such as RNA-Seq or DNA-Seq, using natural language.
|
32
35
|
|
33
|
-
### 3. Talk2KnowledgeGraphs
|
36
|
+
### 3. Talk2KnowledgeGraphs _(Work in Progress)_
|
34
37
|
|
35
38
|
**Talk2KnowledgeGraphs** is an agent designed to enable interaction with biological knowledge graphs (KGs). KGs integrate vast amounts of structured biological data into a format that highlights relationships between entities, such as proteins, genes, and diseases.
|
36
39
|
|
37
|
-
### 4.
|
40
|
+
### 4. Talk2Competitors _(Coming soon)_
|
38
41
|
|
39
42
|
## Getting Started
|
40
43
|
|
@@ -45,48 +48,60 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
45
48
|
- Required libraries specified in `requirements.txt`
|
46
49
|
|
47
50
|
### Installation
|
51
|
+
|
48
52
|
#### Option 1: PyPI
|
49
|
-
|
50
|
-
|
51
|
-
|
53
|
+
|
54
|
+
```bash
|
55
|
+
pip install aiagents4pharma
|
56
|
+
```
|
52
57
|
|
53
58
|
Check out the tutorials on each agent for detailed instrcutions.
|
54
59
|
|
55
60
|
#### Option 2: git
|
61
|
+
|
56
62
|
1. **Clone the repository:**
|
63
|
+
|
57
64
|
```bash
|
58
65
|
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
59
66
|
cd AIAgents4Pharma
|
60
67
|
```
|
61
68
|
|
62
69
|
2. **Install dependencies:**
|
70
|
+
|
63
71
|
```bash
|
64
72
|
pip install .
|
65
73
|
```
|
66
74
|
|
67
75
|
3. **Initialize OPENAI_API_KEY**
|
76
|
+
|
68
77
|
```bash
|
69
|
-
export OPENAI_API_KEY
|
78
|
+
export OPENAI_API_KEY=....
|
70
79
|
```
|
71
80
|
|
72
81
|
4. **[Optional] Set up login credentials**
|
82
|
+
|
73
83
|
```bash
|
74
84
|
vi .streamlit/secrets.toml
|
75
85
|
```
|
86
|
+
|
76
87
|
and enter
|
88
|
+
|
77
89
|
```
|
78
90
|
password='XXX'
|
79
91
|
```
|
80
|
-
|
92
|
+
|
93
|
+
Please note that the passoword will be same for all the users.
|
81
94
|
|
82
95
|
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
96
|
+
|
83
97
|
```bash
|
84
98
|
export LANGCHAIN_TRACING_V2=true
|
85
99
|
export LANGCHAIN_API_KEY=<your-api-key>
|
86
100
|
```
|
87
|
-
|
88
|
-
|
89
|
-
|
101
|
+
|
102
|
+
Please note that this will create a new tracing project in your Langsmith
|
103
|
+
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
104
|
+
you provided in the previous step. If you skip the previous step, it will
|
90
105
|
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
91
106
|
session.
|
92
107
|
|
@@ -118,6 +133,7 @@ We welcome contributions to AIAgents4Pharma! Here’s how you can help:
|
|
118
133
|
5. **Open a pull request**
|
119
134
|
|
120
135
|
### Current Needs
|
136
|
+
|
121
137
|
- **Beta testers** for Talk2BioModels.
|
122
138
|
- **Developers** with experience in natural language processing, bioinformatics, or knowledge graphs for contributions to AIAgents4Pharma.
|
123
139
|
|
@@ -128,19 +144,22 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
128
144
|
## Roadmap
|
129
145
|
|
130
146
|
### Completed
|
147
|
+
|
131
148
|
- **Talk2BioModels**: Initial release with core capabilities for interacting with systems biology models.
|
132
149
|
|
133
150
|
### Planned
|
151
|
+
|
134
152
|
- **User Interface**: Interactive web UI for all agents.
|
135
153
|
- **Talk2Cells**: Integration of sequencing data analysis tools.
|
136
154
|
- **Talk2KnowledgeGraphs**: Interface for biological knowledge graph interaction.
|
137
|
-
- **Talk2Competitors
|
155
|
+
- **Talk2Competitors**: Interface for exploring articles
|
138
156
|
|
139
|
-
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
157
|
+
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
140
158
|
|
141
159
|
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
142
160
|
|
143
161
|
---
|
144
162
|
|
145
163
|
## Feedback
|
164
|
+
|
146
165
|
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
@@ -20,5 +20,5 @@ class Talk2Biomodels(AgentState):
|
|
20
20
|
# the operator for the sbml_file_path field.
|
21
21
|
# https://langchain-ai.github.io/langgraph/troubleshooting/errors/INVALID_CONCURRENT_GRAPH_UPDATE/
|
22
22
|
sbml_file_path: Annotated[list, operator.add]
|
23
|
-
dic_simulated_data: dict
|
23
|
+
dic_simulated_data: Annotated[list[dict], operator.add]
|
24
24
|
llm_model: str
|
@@ -1,7 +1,8 @@
|
|
1
1
|
'''
|
2
|
-
Test cases
|
2
|
+
Test cases for Talk2Biomodels.
|
3
3
|
'''
|
4
4
|
|
5
|
+
import pandas as pd
|
5
6
|
from langchain_core.messages import HumanMessage, ToolMessage
|
6
7
|
from ..agents.t2b_agent import get_app
|
7
8
|
|
@@ -13,7 +14,8 @@ def test_get_modelinfo_tool():
|
|
13
14
|
app = get_app(unique_id)
|
14
15
|
config = {"configurable": {"thread_id": unique_id}}
|
15
16
|
# Update state
|
16
|
-
app.update_state(config,
|
17
|
+
app.update_state(config,
|
18
|
+
{"sbml_file_path": ["aiagents4pharma/talk2biomodels/tests/BIOMD0000000449_url.xml"]})
|
17
19
|
prompt = "Extract all relevant information from the uploaded model."
|
18
20
|
# Test the tool get_modelinfo
|
19
21
|
response = app.invoke(
|
@@ -56,26 +58,70 @@ def test_ask_question_tool():
|
|
56
58
|
|
57
59
|
##########################################
|
58
60
|
# Test ask_question tool when simulation
|
59
|
-
# results are not available
|
61
|
+
# results are not available i.e. the
|
62
|
+
# simulation has not been run. In this
|
63
|
+
# case, the tool should return an error
|
60
64
|
##########################################
|
61
65
|
# Update state
|
62
66
|
app.update_state(config, {"llm_model": "gpt-4o-mini"})
|
67
|
+
# Define the prompt
|
63
68
|
prompt = "Call the ask_question tool to answer the "
|
64
69
|
prompt += "question: What is the concentration of CRP "
|
65
|
-
prompt += "in serum at 1000 hours?"
|
66
|
-
|
67
|
-
#
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
#
|
74
|
-
|
70
|
+
prompt += "in serum at 1000 hours? The simulation name "
|
71
|
+
prompt += "is `simulation_name`."
|
72
|
+
# Invoke the tool
|
73
|
+
app.invoke(
|
74
|
+
{"messages": [HumanMessage(content=prompt)]},
|
75
|
+
config=config
|
76
|
+
)
|
77
|
+
# Get the messages from the current state
|
78
|
+
# and reverse the order
|
79
|
+
current_state = app.get_state(config)
|
80
|
+
reversed_messages = current_state.values["messages"][::-1]
|
81
|
+
# Loop through the reversed messages until a
|
82
|
+
# ToolMessage is found.
|
83
|
+
for msg in reversed_messages:
|
84
|
+
# Assert that the message is a ToolMessage
|
85
|
+
# and its status is "error"
|
86
|
+
if isinstance(msg, ToolMessage):
|
87
|
+
assert msg.status == "error"
|
75
88
|
|
76
89
|
def test_simulate_model_tool():
|
77
90
|
'''
|
78
|
-
Test the simulate_model tool
|
91
|
+
Test the simulate_model tool when simulating
|
92
|
+
multiple models.
|
93
|
+
'''
|
94
|
+
unique_id = 123
|
95
|
+
app = get_app(unique_id)
|
96
|
+
config = {"configurable": {"thread_id": unique_id}}
|
97
|
+
app.update_state(config, {"llm_model": "gpt-4o-mini"})
|
98
|
+
# Upload a model to the state
|
99
|
+
app.update_state(config,
|
100
|
+
{"sbml_file_path": ["aiagents4pharma/talk2biomodels/tests/BIOMD0000000449_url.xml"]})
|
101
|
+
prompt = "Simulate models 64 and the uploaded model"
|
102
|
+
# Invoke the agent
|
103
|
+
app.invoke(
|
104
|
+
{"messages": [HumanMessage(content=prompt)]},
|
105
|
+
config=config
|
106
|
+
)
|
107
|
+
current_state = app.get_state(config)
|
108
|
+
dic_simulated_data = current_state.values["dic_simulated_data"]
|
109
|
+
# Check if the dic_simulated_data is a list
|
110
|
+
assert isinstance(dic_simulated_data, list)
|
111
|
+
# Check if the length of the dic_simulated_data is 2
|
112
|
+
assert len(dic_simulated_data) == 2
|
113
|
+
# Check if the source of the first model is 64
|
114
|
+
assert dic_simulated_data[0]['source'] == 64
|
115
|
+
# Check if the source of the second model is upload
|
116
|
+
assert dic_simulated_data[1]['source'] == "upload"
|
117
|
+
# Check if the data of the first model contains
|
118
|
+
assert '1,3-bisphosphoglycerate' in dic_simulated_data[0]['data']
|
119
|
+
# Check if the data of the second model contains
|
120
|
+
assert 'mTORC2' in dic_simulated_data[1]['data']
|
121
|
+
|
122
|
+
def test_integration():
|
123
|
+
'''
|
124
|
+
Test the integration of the tools.
|
79
125
|
'''
|
80
126
|
unique_id = 123
|
81
127
|
app = get_app(unique_id)
|
@@ -138,9 +184,9 @@ def test_simulate_model_tool():
|
|
138
184
|
reversed_messages = current_state.values["messages"][::-1]
|
139
185
|
# Loop through the reversed messages
|
140
186
|
# until a ToolMessage is found.
|
141
|
-
|
142
|
-
|
143
|
-
|
187
|
+
expected_header = ['Time', 'CRP[serum]', 'CRPExtracellular']
|
188
|
+
expected_header += ['CRP Suppression (%)', 'CRP (% of baseline)']
|
189
|
+
expected_header += ['CRP[liver]']
|
144
190
|
predicted_artifact = []
|
145
191
|
for msg in reversed_messages:
|
146
192
|
if isinstance(msg, ToolMessage):
|
@@ -150,9 +196,14 @@ def test_simulate_model_tool():
|
|
150
196
|
if msg.name == "custom_plotter":
|
151
197
|
predicted_artifact = msg.artifact
|
152
198
|
break
|
153
|
-
#
|
154
|
-
#
|
155
|
-
|
199
|
+
# Convert the artifact into a pandas dataframe
|
200
|
+
# for easy comparison
|
201
|
+
df = pd.DataFrame(predicted_artifact)
|
202
|
+
# Extract the headers from the dataframe
|
203
|
+
predicted_header = df.columns.tolist()
|
204
|
+
# Check if the header is in the expected_header
|
205
|
+
# assert expected_header in predicted_artifact
|
206
|
+
assert set(expected_header).issubset(set(predicted_header))
|
156
207
|
##########################################
|
157
208
|
# Test custom_plotter tool when the
|
158
209
|
# simulation results are available but
|
@@ -23,6 +23,8 @@ class AskQuestionInput(BaseModel):
|
|
23
23
|
Input schema for the AskQuestion tool.
|
24
24
|
"""
|
25
25
|
question: str = Field(description="question about the simulation results")
|
26
|
+
simulation_name: str = Field(description="""Name assigned to the simulation
|
27
|
+
when the tool simulate_model was invoked.""")
|
26
28
|
state: Annotated[dict, InjectedState]
|
27
29
|
|
28
30
|
# Note: It's important that every field has type hints.
|
@@ -39,6 +41,7 @@ class AskQuestionTool(BaseTool):
|
|
39
41
|
|
40
42
|
def _run(self,
|
41
43
|
question: str,
|
44
|
+
simulation_name: str,
|
42
45
|
state: Annotated[dict, InjectedState]) -> str:
|
43
46
|
"""
|
44
47
|
Run the tool.
|
@@ -46,18 +49,24 @@ class AskQuestionTool(BaseTool):
|
|
46
49
|
Args:
|
47
50
|
question (str): The question to ask about the simulation results.
|
48
51
|
state (dict): The state of the graph.
|
49
|
-
|
52
|
+
simulation_name (str): The name assigned to the simulation.
|
50
53
|
|
51
54
|
Returns:
|
52
55
|
str: The answer to the question.
|
53
56
|
"""
|
54
57
|
logger.log(logging.INFO,
|
55
|
-
"Calling ask_question tool %s", question)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
"Calling ask_question tool %s, %s", question, simulation_name)
|
59
|
+
dic_simulated_data = {}
|
60
|
+
for data in state["dic_simulated_data"]:
|
61
|
+
for key in data:
|
62
|
+
if key not in dic_simulated_data:
|
63
|
+
dic_simulated_data[key] = []
|
64
|
+
dic_simulated_data[key] += [data[key]]
|
65
|
+
# print (dic_simulated_data)
|
66
|
+
df_simulated_data = pd.DataFrame.from_dict(dic_simulated_data)
|
67
|
+
df = pd.DataFrame(
|
68
|
+
df_simulated_data[df_simulated_data['name'] == simulation_name]['data'].iloc[0]
|
69
|
+
)
|
61
70
|
prompt_content = None
|
62
71
|
# if run_manager and 'prompt' in run_manager.metadata:
|
63
72
|
# prompt_content = run_manager.metadata['prompt']
|
@@ -6,14 +6,11 @@ Tool for plotting a custom figure.
|
|
6
6
|
|
7
7
|
import logging
|
8
8
|
from typing import Type, List, TypedDict, Annotated, Tuple, Union, Literal
|
9
|
-
from typing import Type, List, TypedDict, Annotated, Tuple, Union, Literal
|
10
9
|
from pydantic import BaseModel, Field
|
11
10
|
import pandas as pd
|
12
|
-
import pandas as pd
|
13
11
|
from langchain_openai import ChatOpenAI
|
14
12
|
from langchain_core.tools import BaseTool
|
15
13
|
from langgraph.prebuilt import InjectedState
|
16
|
-
from langgraph.prebuilt import InjectedState
|
17
14
|
|
18
15
|
# Initialize logger
|
19
16
|
logging.basicConfig(level=logging.INFO)
|
@@ -24,7 +21,7 @@ class CustomPlotterInput(BaseModel):
|
|
24
21
|
Input schema for the PlotImage tool.
|
25
22
|
"""
|
26
23
|
question: str = Field(description="Description of the plot")
|
27
|
-
|
24
|
+
simulation_name: str = Field(description="Name assigned to the simulation")
|
28
25
|
state: Annotated[dict, InjectedState]
|
29
26
|
|
30
27
|
# Note: It's important that every field has type hints.
|
@@ -41,10 +38,10 @@ class CustomPlotterTool(BaseTool):
|
|
41
38
|
description: str = "A tool to make custom plots of the simulation results"
|
42
39
|
args_schema: Type[BaseModel] = CustomPlotterInput
|
43
40
|
response_format: str = "content_and_artifact"
|
44
|
-
response_format: str = "content_and_artifact"
|
45
41
|
|
46
42
|
def _run(self,
|
47
43
|
question: str,
|
44
|
+
simulation_name: str,
|
48
45
|
state: Annotated[dict, InjectedState]
|
49
46
|
) -> Tuple[str, Union[None, List[str]]]:
|
50
47
|
"""
|
@@ -53,17 +50,24 @@ class CustomPlotterTool(BaseTool):
|
|
53
50
|
Args:
|
54
51
|
question (str): The question about the custom plot.
|
55
52
|
state (dict): The state of the graph.
|
56
|
-
question (str): The question about the custom plot.
|
57
|
-
state (dict): The state of the graph.
|
58
53
|
|
59
54
|
Returns:
|
60
55
|
str: The answer to the question
|
61
56
|
"""
|
62
57
|
logger.log(logging.INFO, "Calling custom_plotter tool %s", question)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
58
|
+
dic_simulated_data = {}
|
59
|
+
for data in state["dic_simulated_data"]:
|
60
|
+
for key in data:
|
61
|
+
if key not in dic_simulated_data:
|
62
|
+
dic_simulated_data[key] = []
|
63
|
+
dic_simulated_data[key] += [data[key]]
|
64
|
+
# Create a pandas dataframe from the dictionary
|
65
|
+
df = pd.DataFrame.from_dict(dic_simulated_data)
|
66
|
+
# Get the simulated data for the current tool call
|
67
|
+
df = pd.DataFrame(
|
68
|
+
df[df['name'] == simulation_name]['data'].iloc[0]
|
69
|
+
)
|
70
|
+
# df = pd.DataFrame.from_dict(state['dic_simulated_data'])
|
67
71
|
species_names = df.columns.tolist()
|
68
72
|
# Exclude the time column
|
69
73
|
species_names.remove('Time')
|
@@ -76,7 +80,8 @@ class CustomPlotterTool(BaseTool):
|
|
76
80
|
A list of species based on user question.
|
77
81
|
"""
|
78
82
|
relevant_species: Union[None, List[Literal[*species_names]]] = Field(
|
79
|
-
description="List of species based on user question.
|
83
|
+
description="""List of species based on user question.
|
84
|
+
If no relevant species are found, it will be None.""")
|
80
85
|
# Create an instance of the LLM model
|
81
86
|
llm = ChatOpenAI(model=state['llm_model'], temperature=0)
|
82
87
|
llm_with_structured_output = llm.with_structured_output(CustomHeader)
|
@@ -90,5 +95,6 @@ class CustomPlotterTool(BaseTool):
|
|
90
95
|
logger.info("Extracted species: %s", extracted_species)
|
91
96
|
if len(extracted_species) == 0:
|
92
97
|
return "No species found in the simulation results that matches the user prompt.", None
|
93
|
-
|
94
|
-
|
98
|
+
# Include the time column
|
99
|
+
extracted_species.insert(0, 'Time')
|
100
|
+
return f"Custom plot {simulation_name}", df[extracted_species].to_dict(orient='records')
|
@@ -25,12 +25,12 @@ class RequestedModelInfo:
|
|
25
25
|
"""
|
26
26
|
Dataclass for storing the requested model information.
|
27
27
|
"""
|
28
|
-
species: bool = Field(description="Get species from the model.")
|
29
|
-
parameters: bool = Field(description="Get parameters from the model.")
|
30
|
-
compartments: bool = Field(description="Get compartments from the model.")
|
31
|
-
units: bool = Field(description="Get units from the model.")
|
32
|
-
description: bool = Field(description="Get description from the model.")
|
33
|
-
name: bool = Field(description="Get name from the model.")
|
28
|
+
species: bool = Field(description="Get species from the model.", default=False)
|
29
|
+
parameters: bool = Field(description="Get parameters from the model.", default=False)
|
30
|
+
compartments: bool = Field(description="Get compartments from the model.", default=False)
|
31
|
+
units: bool = Field(description="Get units from the model.", default=False)
|
32
|
+
description: bool = Field(description="Get description from the model.", default=False)
|
33
|
+
name: bool = Field(description="Get name from the model.", default=False)
|
34
34
|
|
35
35
|
class GetModelInfoInput(BaseModel):
|
36
36
|
"""
|