aiagents4pharma 1.3.3__tar.gz → 1.4.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.3.3 → aiagents4pharma-1.4.1}/PKG-INFO +36 -3
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/README.md +35 -3
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/model_description.py +4 -5
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/simulate_model.py +37 -34
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma.egg-info/PKG-INFO +36 -3
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma.egg-info/requires.txt +1 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/pyproject.toml +2 -1
- aiagents4pharma-1.4.1/release_version.txt +1 -0
- aiagents4pharma-1.3.3/release_version.txt +0 -1
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/LICENSE +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/__init__.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/__init__.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/models/__init__.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/models/basico_model.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/models/sys_bio_model.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/__init__.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/ask_question.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/custom_plotter.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/fetch_parameters.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/plot_figure.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/search_models.py +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma.egg-info/SOURCES.txt +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma.egg-info/dependency_links.txt +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma.egg-info/top_level.txt +0 -0
- {aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: aiagents4pharma
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.4.1
|
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
|
@@ -31,6 +31,7 @@ Requires-Dist: mkdocs-material==9.5.47
|
|
31
31
|
Requires-Dist: mkdocstrings-python==1.12.2
|
32
32
|
Requires-Dist: mkdocs-include-markdown-plugin==7.1.2
|
33
33
|
Requires-Dist: mkdocstrings==0.27.0
|
34
|
+
Requires-Dist: streamlit-feedback
|
34
35
|
|
35
36
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests.yml)
|
36
37
|
|
@@ -73,7 +74,14 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
73
74
|
- Required libraries specified in `requirements.txt`
|
74
75
|
|
75
76
|
### Installation
|
77
|
+
#### Option 1: PyPI
|
78
|
+
```bash
|
79
|
+
pip install aiagents4pharma
|
80
|
+
```
|
76
81
|
|
82
|
+
Check out the tutorials on each agent for detailed instrcutions.
|
83
|
+
|
84
|
+
#### Option 2: git
|
77
85
|
1. **Clone the repository:**
|
78
86
|
```bash
|
79
87
|
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
@@ -90,8 +98,28 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
90
98
|
export OPENAI_API_KEY = ....
|
91
99
|
```
|
92
100
|
|
93
|
-
4. **
|
94
|
-
|
101
|
+
4. **[Optional] Set up login credentials**
|
102
|
+
```bash
|
103
|
+
vi .streamlit/secrets.toml
|
104
|
+
```
|
105
|
+
and enter
|
106
|
+
```
|
107
|
+
password='XXX'
|
108
|
+
```
|
109
|
+
Please note that the passowrd will be same for all the users.
|
110
|
+
|
111
|
+
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
112
|
+
```bash
|
113
|
+
export LANGCHAIN_TRACING_V2=true
|
114
|
+
export LANGCHAIN_API_KEY=<your-api-key>
|
115
|
+
```
|
116
|
+
Please note that this will create a new tracing project in your Langsmith
|
117
|
+
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
118
|
+
you provided in the previous step. If you skip the previous step, it will
|
119
|
+
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
120
|
+
session.
|
121
|
+
|
122
|
+
6. **Launch the app:**
|
95
123
|
```bash
|
96
124
|
streamlit run app/frontend/streamlit_app.py
|
97
125
|
```
|
@@ -139,3 +167,8 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
139
167
|
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
168
|
|
141
169
|
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
170
|
+
|
171
|
+
---
|
172
|
+
|
173
|
+
## Feedback
|
174
|
+
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
@@ -39,7 +39,14 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
39
39
|
- Required libraries specified in `requirements.txt`
|
40
40
|
|
41
41
|
### Installation
|
42
|
+
#### Option 1: PyPI
|
43
|
+
```bash
|
44
|
+
pip install aiagents4pharma
|
45
|
+
```
|
42
46
|
|
47
|
+
Check out the tutorials on each agent for detailed instrcutions.
|
48
|
+
|
49
|
+
#### Option 2: git
|
43
50
|
1. **Clone the repository:**
|
44
51
|
```bash
|
45
52
|
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
@@ -56,8 +63,28 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
56
63
|
export OPENAI_API_KEY = ....
|
57
64
|
```
|
58
65
|
|
59
|
-
4. **
|
60
|
-
|
66
|
+
4. **[Optional] Set up login credentials**
|
67
|
+
```bash
|
68
|
+
vi .streamlit/secrets.toml
|
69
|
+
```
|
70
|
+
and enter
|
71
|
+
```
|
72
|
+
password='XXX'
|
73
|
+
```
|
74
|
+
Please note that the passowrd will be same for all the users.
|
75
|
+
|
76
|
+
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
77
|
+
```bash
|
78
|
+
export LANGCHAIN_TRACING_V2=true
|
79
|
+
export LANGCHAIN_API_KEY=<your-api-key>
|
80
|
+
```
|
81
|
+
Please note that this will create a new tracing project in your Langsmith
|
82
|
+
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
83
|
+
you provided in the previous step. If you skip the previous step, it will
|
84
|
+
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
85
|
+
session.
|
86
|
+
|
87
|
+
6. **Launch the app:**
|
61
88
|
```bash
|
62
89
|
streamlit run app/frontend/streamlit_app.py
|
63
90
|
```
|
@@ -104,4 +131,9 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
104
131
|
|
105
132
|
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.
|
106
133
|
|
107
|
-
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
134
|
+
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
135
|
+
|
136
|
+
---
|
137
|
+
|
138
|
+
## Feedback
|
139
|
+
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
@@ -20,7 +20,7 @@ class ModelData:
|
|
20
20
|
"""
|
21
21
|
Dataclass for storing the model data.
|
22
22
|
"""
|
23
|
-
|
23
|
+
model_id: Optional[int] = None
|
24
24
|
sbml_file_path: Optional[str] = None
|
25
25
|
model_object: Optional[BasicoModel] = None
|
26
26
|
|
@@ -73,12 +73,11 @@ class ModelDescriptionTool(BaseTool):
|
|
73
73
|
str: The answer to the question.
|
74
74
|
"""
|
75
75
|
st_session_key = self.st_session_key
|
76
|
-
print (st_session_key, 'st_session_key')
|
77
76
|
# Check if sys_bio_model is provided in the input schema
|
78
|
-
if sys_bio_model.
|
77
|
+
if sys_bio_model.model_id or sys_bio_model.sbml_file_path \
|
79
78
|
or sys_bio_model.model_object not in [None, "", {}]:
|
80
|
-
if sys_bio_model.
|
81
|
-
model_object = BasicoModel(model_id=sys_bio_model.
|
79
|
+
if sys_bio_model.model_id:
|
80
|
+
model_object = BasicoModel(model_id=sys_bio_model.model_id)
|
82
81
|
elif sys_bio_model.sbml_file_path:
|
83
82
|
model_object = BasicoModel(sbml_file_path=sys_bio_model.sbml_file_path)
|
84
83
|
else:
|
@@ -4,13 +4,13 @@
|
|
4
4
|
Tool for simulating a model.
|
5
5
|
"""
|
6
6
|
|
7
|
-
from typing import Type, Union, List, Optional
|
8
|
-
import basico
|
7
|
+
from typing import Type, Union, List, Optional
|
9
8
|
from dataclasses import dataclass
|
9
|
+
import basico
|
10
10
|
from pydantic import BaseModel, Field
|
11
11
|
from langchain_core.tools import BaseTool
|
12
12
|
import streamlit as st
|
13
|
-
import plotly.express as px
|
13
|
+
# import plotly.express as px
|
14
14
|
from ..models.basico_model import BasicoModel
|
15
15
|
|
16
16
|
@dataclass
|
@@ -91,33 +91,36 @@ class SimulateModelTool(BaseTool):
|
|
91
91
|
Returns:
|
92
92
|
str: The result of the simulation.
|
93
93
|
"""
|
94
|
-
st_session_key = self.st_session_key
|
94
|
+
# st_session_key = self.st_session_key
|
95
95
|
# Retrieve the model ID, duration, and interval
|
96
96
|
modelid = model_data.modelid if model_data is not None else None
|
97
|
-
duration = time_data.duration if time_data is not None else 100.0
|
98
|
-
interval = time_data.interval if time_data is not None else 10
|
97
|
+
# duration = time_data.duration if time_data is not None else 100.0
|
98
|
+
# interval = time_data.interval if time_data is not None else 10
|
99
99
|
# Prepare the dictionary of species data
|
100
100
|
# that will be passed to the simulate method
|
101
101
|
# of the BasicoModel class
|
102
|
-
dic_species_data = None
|
103
|
-
if species_data is not None:
|
104
|
-
|
105
|
-
|
102
|
+
# dic_species_data = None
|
103
|
+
# if species_data is not None:
|
104
|
+
# dic_species_data = dict(zip(species_data.species_name,
|
105
|
+
# species_data.species_concentration))
|
106
|
+
dic_species_data = dict(zip(species_data.species_name, \
|
107
|
+
species_data.species_concentration)) \
|
108
|
+
if species_data is not None else None
|
106
109
|
# Retrieve the SBML file path from the Streamlit session state
|
107
110
|
# otherwise retrieve it from the model_data object if the user
|
108
111
|
# has provided it.
|
109
112
|
sbml_file_path = model_data.sbml_file_path if model_data is not None else None
|
110
|
-
if st_session_key:
|
111
|
-
if st_session_key not in st.session_state:
|
112
|
-
return f"Session key {st_session_key} not found in Streamlit session state."
|
113
|
+
if self.st_session_key:
|
114
|
+
if self.st_session_key not in st.session_state:
|
115
|
+
return f"Session key {self.st_session_key} not found in Streamlit session state."
|
113
116
|
if 'sbml_file_path' in st.session_state:
|
114
117
|
sbml_file_path = st.session_state.sbml_file_path
|
115
118
|
# Check if both modelid and sbml_file_path are None
|
116
119
|
if modelid is None and sbml_file_path is None:
|
117
120
|
# Then load the model from the Streamlit session state
|
118
121
|
# if the streamlit session exists
|
119
|
-
if st_session_key:
|
120
|
-
model_object = st.session_state[st_session_key]
|
122
|
+
if self.st_session_key:
|
123
|
+
model_object = st.session_state[self.st_session_key]
|
121
124
|
# If this model object is None, then return an error message
|
122
125
|
if model_object is None:
|
123
126
|
return "Please provide a BioModels ID or an SBML file path for simulation."
|
@@ -131,13 +134,13 @@ class SimulateModelTool(BaseTool):
|
|
131
134
|
# model_object = BasicoModel(model_id=modelid)
|
132
135
|
model_object = BasicoModel(model_id=modelid)
|
133
136
|
# Save the model object in the Streamlit session state
|
134
|
-
st.session_state[st_session_key] = model_object
|
137
|
+
st.session_state[self.st_session_key] = model_object
|
135
138
|
elif sbml_file_path:
|
136
139
|
# Create a BasicoModel object with the SBML file path
|
137
140
|
model_object = BasicoModel(sbml_file_path=sbml_file_path)
|
138
141
|
modelid = model_object.model_id
|
139
142
|
# Save the model object in the Streamlit session state
|
140
|
-
st.session_state[st_session_key] = model_object
|
143
|
+
st.session_state[self.st_session_key] = model_object
|
141
144
|
# Add recurring events (if any) to the model
|
142
145
|
if recurring_data is not None:
|
143
146
|
for row in recurring_data.data:
|
@@ -149,29 +152,30 @@ class SimulateModelTool(BaseTool):
|
|
149
152
|
# print (f'Added event {sn}_{tp} at time {tp} \
|
150
153
|
# for species {sn} with concentration {sc}')
|
151
154
|
# Simulate the model
|
152
|
-
df = model_object.simulate(
|
153
|
-
|
154
|
-
|
155
|
+
df = model_object.simulate(
|
156
|
+
parameters=dic_species_data,
|
157
|
+
duration=time_data.duration if time_data is not None else 100.0,
|
158
|
+
interval=time_data.interval if time_data is not None else 10)
|
155
159
|
# Convert the DataFrame to long format for plotting
|
156
160
|
# and ignore the index column
|
157
161
|
df = df.melt(id_vars='Time',
|
158
162
|
var_name='Species',
|
159
163
|
value_name='Concentration')
|
160
164
|
# Plot the simulation results using Plotly
|
161
|
-
fig = px.line(df,
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
)
|
165
|
+
# fig = px.line(df,
|
166
|
+
# x='Time',
|
167
|
+
# y='Concentration',
|
168
|
+
# color='Species',
|
169
|
+
# title=f"Concentration of Species over Time in the model {modelid}",
|
170
|
+
# height=600,
|
171
|
+
# width=800
|
172
|
+
# )
|
169
173
|
# Display the plot in Streamlit
|
170
174
|
# st.plotly_chart(fig, use_container_width = False)
|
171
|
-
if modelid is None:
|
172
|
-
|
173
|
-
|
174
|
-
return
|
175
|
+
# if modelid is None:
|
176
|
+
# modelid = "internal"
|
177
|
+
# return f"Simulation results for the model {modelid}."
|
178
|
+
return "Simulation results for the model."
|
175
179
|
|
176
180
|
def get_metadata(self):
|
177
181
|
"""
|
@@ -182,6 +186,5 @@ class SimulateModelTool(BaseTool):
|
|
182
186
|
"""
|
183
187
|
return {
|
184
188
|
"name": self.name,
|
185
|
-
"description": self.description
|
186
|
-
"return_direct": self.return_direct,
|
189
|
+
"description": self.description
|
187
190
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: aiagents4pharma
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.4.1
|
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
|
@@ -31,6 +31,7 @@ Requires-Dist: mkdocs-material==9.5.47
|
|
31
31
|
Requires-Dist: mkdocstrings-python==1.12.2
|
32
32
|
Requires-Dist: mkdocs-include-markdown-plugin==7.1.2
|
33
33
|
Requires-Dist: mkdocstrings==0.27.0
|
34
|
+
Requires-Dist: streamlit-feedback
|
34
35
|
|
35
36
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests.yml)
|
36
37
|
|
@@ -73,7 +74,14 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
73
74
|
- Required libraries specified in `requirements.txt`
|
74
75
|
|
75
76
|
### Installation
|
77
|
+
#### Option 1: PyPI
|
78
|
+
```bash
|
79
|
+
pip install aiagents4pharma
|
80
|
+
```
|
76
81
|
|
82
|
+
Check out the tutorials on each agent for detailed instrcutions.
|
83
|
+
|
84
|
+
#### Option 2: git
|
77
85
|
1. **Clone the repository:**
|
78
86
|
```bash
|
79
87
|
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
@@ -90,8 +98,28 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
90
98
|
export OPENAI_API_KEY = ....
|
91
99
|
```
|
92
100
|
|
93
|
-
4. **
|
94
|
-
|
101
|
+
4. **[Optional] Set up login credentials**
|
102
|
+
```bash
|
103
|
+
vi .streamlit/secrets.toml
|
104
|
+
```
|
105
|
+
and enter
|
106
|
+
```
|
107
|
+
password='XXX'
|
108
|
+
```
|
109
|
+
Please note that the passowrd will be same for all the users.
|
110
|
+
|
111
|
+
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
112
|
+
```bash
|
113
|
+
export LANGCHAIN_TRACING_V2=true
|
114
|
+
export LANGCHAIN_API_KEY=<your-api-key>
|
115
|
+
```
|
116
|
+
Please note that this will create a new tracing project in your Langsmith
|
117
|
+
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
118
|
+
you provided in the previous step. If you skip the previous step, it will
|
119
|
+
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
120
|
+
session.
|
121
|
+
|
122
|
+
6. **Launch the app:**
|
95
123
|
```bash
|
96
124
|
streamlit run app/frontend/streamlit_app.py
|
97
125
|
```
|
@@ -139,3 +167,8 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
139
167
|
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
168
|
|
141
169
|
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
170
|
+
|
171
|
+
---
|
172
|
+
|
173
|
+
## Feedback
|
174
|
+
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
@@ -0,0 +1 @@
|
|
1
|
+
v1.4.1
|
@@ -1 +0,0 @@
|
|
1
|
-
v1.3.3
|
File without changes
|
File without changes
|
File without changes
|
{aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/models/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/__init__.py
RENAMED
File without changes
|
{aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/ask_question.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma/talk2biomodels/tools/plot_figure.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{aiagents4pharma-1.3.3 → aiagents4pharma-1.4.1}/aiagents4pharma.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|