aiagents4pharma 1.6.0__py3-none-any.whl → 1.6.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aiagents4pharma/talk2cells/__init__.py +6 -0
- aiagents4pharma/talk2cells/agents/__init__.py +5 -0
- aiagents4pharma/talk2cells/agents/scp_agent.py +85 -0
- aiagents4pharma/talk2cells/states/__init__.py +5 -0
- aiagents4pharma/talk2cells/states/state_talk2cells.py +13 -0
- aiagents4pharma/talk2cells/tools/__init__.py +5 -0
- {aiagents4pharma-1.6.0.dist-info → aiagents4pharma-1.6.2.dist-info}/METADATA +9 -4
- {aiagents4pharma-1.6.0.dist-info → aiagents4pharma-1.6.2.dist-info}/RECORD +11 -5
- {aiagents4pharma-1.6.0.dist-info → aiagents4pharma-1.6.2.dist-info}/LICENSE +0 -0
- {aiagents4pharma-1.6.0.dist-info → aiagents4pharma-1.6.2.dist-info}/WHEEL +0 -0
- {aiagents4pharma-1.6.0.dist-info → aiagents4pharma-1.6.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,85 @@
|
|
1
|
+
#/usr/bin/env python3
|
2
|
+
|
3
|
+
'''
|
4
|
+
This is the agent file for the Talk2Cells graph.
|
5
|
+
'''
|
6
|
+
|
7
|
+
import logging
|
8
|
+
import os
|
9
|
+
from langchain_openai import ChatOpenAI
|
10
|
+
from langgraph.checkpoint.memory import MemorySaver
|
11
|
+
from langgraph.graph import START, StateGraph
|
12
|
+
from langgraph.prebuilt import create_react_agent, ToolNode
|
13
|
+
from ..tools.scp_agent.search_studies import search_studies
|
14
|
+
from ..tools.scp_agent.display_studies import display_studies
|
15
|
+
from ..states.state_talk2cells import Talk2Cells
|
16
|
+
|
17
|
+
# Initialize logger
|
18
|
+
logging.basicConfig(level=logging.INFO)
|
19
|
+
logger = logging.getLogger(__name__)
|
20
|
+
|
21
|
+
def get_app(uniq_id):
|
22
|
+
'''
|
23
|
+
This function returns the langraph app.
|
24
|
+
'''
|
25
|
+
def agent_scp_node(state: Talk2Cells):
|
26
|
+
'''
|
27
|
+
This function calls the model.
|
28
|
+
'''
|
29
|
+
logger.log(logging.INFO, "Creating SCP_Agent node with thread_id %s", uniq_id)
|
30
|
+
# Get the messages from the state
|
31
|
+
# messages = state['messages']
|
32
|
+
# Call the model
|
33
|
+
# inputs = {'messages': messages}
|
34
|
+
response = model.invoke(state, {"configurable": {"thread_id": uniq_id}})
|
35
|
+
# The response is a list of messages and may contain `tool calls`
|
36
|
+
# We return a list, because this will get added to the existing list
|
37
|
+
# return {"messages": [response]}
|
38
|
+
return response
|
39
|
+
|
40
|
+
# Define the tools
|
41
|
+
# tools = [search_studies, display_studies]
|
42
|
+
tools = ToolNode([search_studies, display_studies])
|
43
|
+
|
44
|
+
# Create the LLM
|
45
|
+
# And bind the tools to it
|
46
|
+
# model = ChatOpenAI(model="gpt-4o-mini", temperature=0).bind_tools(tools)
|
47
|
+
|
48
|
+
# Create an environment variable to store the LLM model
|
49
|
+
# Check if the environment variable AIAGENTS4PHARMA_LLM_MODEL is set
|
50
|
+
# If not, set it to 'gpt-4o-mini'
|
51
|
+
llm_model = os.getenv('AIAGENTS4PHARMA_LLM_MODEL', 'gpt-4o-mini')
|
52
|
+
# print (f'LLM model: {llm_model}')
|
53
|
+
# llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
|
54
|
+
llm = ChatOpenAI(model=llm_model, temperature=0)
|
55
|
+
model = create_react_agent(
|
56
|
+
llm,
|
57
|
+
tools=tools,
|
58
|
+
state_schema=Talk2Cells,
|
59
|
+
state_modifier=(
|
60
|
+
"You are Talk2Cells agent."
|
61
|
+
),
|
62
|
+
checkpointer=MemorySaver()
|
63
|
+
)
|
64
|
+
|
65
|
+
# Define a new graph
|
66
|
+
workflow = StateGraph(Talk2Cells)
|
67
|
+
|
68
|
+
# Define the two nodes we will cycle between
|
69
|
+
workflow.add_node("agent_scp", agent_scp_node)
|
70
|
+
|
71
|
+
# Set the entrypoint as `agent`
|
72
|
+
# This means that this node is the first one called
|
73
|
+
workflow.add_edge(START, "agent_scp")
|
74
|
+
|
75
|
+
# Initialize memory to persist state between graph runs
|
76
|
+
checkpointer = MemorySaver()
|
77
|
+
|
78
|
+
# Finally, we compile it!
|
79
|
+
# This compiles it into a LangChain Runnable,
|
80
|
+
# meaning you can use it as you would any other runnable.
|
81
|
+
# Note that we're (optionally) passing the memory when compiling the graph
|
82
|
+
app = workflow.compile(checkpointer=checkpointer)
|
83
|
+
logger.log(logging.INFO, "Compiled the graph")
|
84
|
+
|
85
|
+
return app
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
|
3
|
+
'''
|
4
|
+
This is the state file for the Talk2Cells agent.
|
5
|
+
'''
|
6
|
+
|
7
|
+
from langgraph.prebuilt.chat_agent_executor import AgentState
|
8
|
+
|
9
|
+
class Talk2Cells(AgentState):
|
10
|
+
"""
|
11
|
+
The state for the Talk2Cells agent.
|
12
|
+
"""
|
13
|
+
search_table: str
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: aiagents4pharma
|
3
|
-
Version: 1.6.
|
3
|
+
Version: 1.6.2
|
4
4
|
Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
@@ -19,6 +19,7 @@ Requires-Dist: langchain-community==0.3.5
|
|
19
19
|
Requires-Dist: langchain-core==0.3.15
|
20
20
|
Requires-Dist: langchain-experimental==0.3.3
|
21
21
|
Requires-Dist: langchain-openai==0.2.5
|
22
|
+
Requires-Dist: langgraph==0.2.62
|
22
23
|
Requires-Dist: matplotlib==3.9.2
|
23
24
|
Requires-Dist: openai==1.59.4
|
24
25
|
Requires-Dist: pandas==2.2.3
|
@@ -51,8 +52,9 @@ Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://
|
|
51
52
|
Our toolkit currently consists of three intelligent agents, each designed to simplify and enhance access to specialized data in biology:
|
52
53
|
|
53
54
|
- **Talk2BioModels**: Engage directly with mathematical models in systems biology.
|
54
|
-
- **Talk2Cells** *(
|
55
|
-
- **Talk2KnowledgeGraphs** *(
|
55
|
+
- **Talk2Cells** *(Work in progress)*: Query and analyze sequencing data with ease.
|
56
|
+
- **Talk2KnowledgeGraphs** *(Work in progress)*: Access and explore complex biological knowledge graphs for insightful data connections.
|
57
|
+
- **Talk2Competitors** *(Coming soon)*: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
56
58
|
|
57
59
|
---
|
58
60
|
|
@@ -66,7 +68,7 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
66
68
|
- Adjust parameters within the model to simulate different conditions.
|
67
69
|
- Query simulation results.
|
68
70
|
|
69
|
-
### 2. Talk2Cells *(
|
71
|
+
### 2. Talk2Cells *(Work in Progress)*
|
70
72
|
|
71
73
|
**Talk2Cells** is being developed to provide direct access to and analysis of sequencing data, such as RNA-Seq or DNA-Seq, using natural language.
|
72
74
|
|
@@ -74,6 +76,8 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
74
76
|
|
75
77
|
**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.
|
76
78
|
|
79
|
+
### 4. Talk2KnowledgeGraphs *(Coming soon)*
|
80
|
+
|
77
81
|
## Getting Started
|
78
82
|
|
79
83
|
### Prerequisites
|
@@ -172,6 +176,7 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
172
176
|
- **User Interface**: Interactive web UI for all agents.
|
173
177
|
- **Talk2Cells**: Integration of sequencing data analysis tools.
|
174
178
|
- **Talk2KnowledgeGraphs**: Interface for biological knowledge graph interaction.
|
179
|
+
- **Talk2Competitors**
|
175
180
|
|
176
181
|
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.
|
177
182
|
|
@@ -10,6 +10,12 @@ aiagents4pharma/talk2biomodels/tools/fetch_parameters.py,sha256=WdLGPdJi4DwGwYMo
|
|
10
10
|
aiagents4pharma/talk2biomodels/tools/model_description.py,sha256=lcVKVvh50wJ4BmB7xMnTZOtWjCmQUnkh6TQJsX-IjGw,5338
|
11
11
|
aiagents4pharma/talk2biomodels/tools/search_models.py,sha256=cqsK_ApjrAyjEiXWsXTebDpuvEnA5nb6WYiUGayRkW4,3034
|
12
12
|
aiagents4pharma/talk2biomodels/tools/simulate_model.py,sha256=MxlAy62SuonBbEbKmoUz0HcdfTWvk-x9WMSo17dBU9U,7552
|
13
|
+
aiagents4pharma/talk2cells/__init__.py,sha256=zmOP5RAhabgKIQP-W4P4qKME2tG3fhAXM3MeO5_H8kE,120
|
14
|
+
aiagents4pharma/talk2cells/agents/__init__.py,sha256=38nK2a_lEFRjO3qD6Fo9a3983ZCYat6hmJKWY61y2Mo,128
|
15
|
+
aiagents4pharma/talk2cells/agents/scp_agent.py,sha256=gDMfhUNWHa_XWOqm1Ql6yLAdI_7bnIk5sRYn43H2sYk,3090
|
16
|
+
aiagents4pharma/talk2cells/states/__init__.py,sha256=e4s8pHZaR6UC42DtmsOzCVms5gxp5QEzLE4bG54YYko,135
|
17
|
+
aiagents4pharma/talk2cells/states/state_talk2cells.py,sha256=en5LikmabPZA6lLVpmYXff0Q3Fno0N2PBSMxk3gLWaE,253
|
18
|
+
aiagents4pharma/talk2cells/tools/__init__.py,sha256=38nK2a_lEFRjO3qD6Fo9a3983ZCYat6hmJKWY61y2Mo,128
|
13
19
|
aiagents4pharma/talk2knowledgegraphs/__init__.py,sha256=SW7Ys2A4eXyFtizNPdSw91SHOPVUBGBsrCQ7TqwSUL0,91
|
14
20
|
aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py,sha256=L3gPuHskSegmtXskVrLIYr7FXe_ibKgJ2GGr1_Wok6k,173
|
15
21
|
aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py,sha256=QlzDXmXREoa9MA6-GwzqRjdzndQeGBAF11Td6NFk_9Y,23426
|
@@ -22,8 +28,8 @@ aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py,sha256=xRb0x7S
|
|
22
28
|
aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py,sha256=1nGznrAj-xT0xuSMBGz2dOujJ7M_IwSR84njxtxsy9A,2523
|
23
29
|
aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py,sha256=2vi_elf6EgzfagFAO5QnL3a_aXZyN7B1EBziu44MTfM,3806
|
24
30
|
aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py,sha256=36iKlisOpMtGR5xfTAlSHXWvPqVC_Jbezod8kbBBMVg,2136
|
25
|
-
aiagents4pharma-1.6.
|
26
|
-
aiagents4pharma-1.6.
|
27
|
-
aiagents4pharma-1.6.
|
28
|
-
aiagents4pharma-1.6.
|
29
|
-
aiagents4pharma-1.6.
|
31
|
+
aiagents4pharma-1.6.2.dist-info/LICENSE,sha256=IcIbyB1Hyk5ZDah03VNQvJkbNk2hkBCDqQ8qtnCvB4Q,1077
|
32
|
+
aiagents4pharma-1.6.2.dist-info/METADATA,sha256=Lc-YDFCpxGDo0Y5kudger5uBuvmGP9l6edO6mtLM1BU,7242
|
33
|
+
aiagents4pharma-1.6.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
34
|
+
aiagents4pharma-1.6.2.dist-info/top_level.txt,sha256=-AH8rMmrSnJtq7HaAObS78UU-cTCwvX660dSxeM7a0A,16
|
35
|
+
aiagents4pharma-1.6.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|