aiagents4pharma 1.24.1__py3-none-any.whl → 1.25.1__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/__init__.py +1 -0
- aiagents4pharma/talk2aiagents4pharma/__init__.py +6 -0
- aiagents4pharma/talk2aiagents4pharma/agents/__init__.py +5 -0
- aiagents4pharma/talk2aiagents4pharma/agents/main_agent.py +68 -0
- aiagents4pharma/talk2aiagents4pharma/configs/__init__.py +5 -0
- aiagents4pharma/talk2aiagents4pharma/configs/agents/__init__.py +5 -0
- aiagents4pharma/talk2aiagents4pharma/configs/agents/main_agent/default.yaml +12 -0
- aiagents4pharma/talk2aiagents4pharma/configs/config.yaml +3 -0
- aiagents4pharma/talk2aiagents4pharma/states/__init__.py +4 -0
- aiagents4pharma/talk2aiagents4pharma/states/state_talk2aiagents4pharma.py +16 -0
- aiagents4pharma/talk2aiagents4pharma/tests/__init__.py +3 -0
- aiagents4pharma/talk2aiagents4pharma/tests/test_main_agent.py +112 -0
- aiagents4pharma/talk2biomodels/agents/t2b_agent.py +3 -3
- aiagents4pharma/talk2biomodels/tests/test_ask_question.py +1 -4
- aiagents4pharma/talk2biomodels/tests/test_get_annotation.py +7 -4
- aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py +6 -3
- aiagents4pharma/talk2biomodels/tests/test_integration.py +1 -2
- aiagents4pharma/talk2biomodels/tests/test_param_scan.py +4 -2
- aiagents4pharma/talk2biomodels/tests/test_query_article.py +5 -3
- aiagents4pharma/talk2biomodels/tests/test_search_models.py +8 -5
- aiagents4pharma/talk2biomodels/tests/test_simulate_model.py +4 -2
- aiagents4pharma/talk2biomodels/tests/test_steady_state.py +5 -2
- aiagents4pharma/talk2knowledgegraphs/agents/t2kg_agent.py +3 -3
- aiagents4pharma/talk2scholars/agents/main_agent.py +1 -2
- aiagents4pharma/talk2scholars/agents/s2_agent.py +1 -2
- aiagents4pharma/talk2scholars/agents/zotero_agent.py +2 -2
- aiagents4pharma/talk2scholars/tests/test_call_s2.py +3 -2
- aiagents4pharma/talk2scholars/tests/test_call_zotero.py +3 -2
- aiagents4pharma/talk2scholars/tests/test_main_agent.py +2 -1
- aiagents4pharma/talk2scholars/tests/test_s2_agent.py +8 -6
- aiagents4pharma/talk2scholars/tests/test_zotero_agent.py +7 -5
- {aiagents4pharma-1.24.1.dist-info → aiagents4pharma-1.25.1.dist-info}/METADATA +50 -26
- {aiagents4pharma-1.24.1.dist-info → aiagents4pharma-1.25.1.dist-info}/RECORD +36 -25
- {aiagents4pharma-1.24.1.dist-info → aiagents4pharma-1.25.1.dist-info}/LICENSE +0 -0
- {aiagents4pharma-1.24.1.dist-info → aiagents4pharma-1.25.1.dist-info}/WHEEL +0 -0
- {aiagents4pharma-1.24.1.dist-info → aiagents4pharma-1.25.1.dist-info}/top_level.txt +0 -0
aiagents4pharma/__init__.py
CHANGED
@@ -0,0 +1,68 @@
|
|
1
|
+
#/usr/bin/env python3
|
2
|
+
|
3
|
+
'''
|
4
|
+
This is the main agent file for the AIAgents4Pharma.
|
5
|
+
'''
|
6
|
+
|
7
|
+
import logging
|
8
|
+
import hydra
|
9
|
+
from langgraph_supervisor import create_supervisor
|
10
|
+
from langchain_openai import ChatOpenAI
|
11
|
+
from langchain_core.language_models.chat_models import BaseChatModel
|
12
|
+
from langgraph.checkpoint.memory import MemorySaver
|
13
|
+
from ...talk2biomodels.agents.t2b_agent import get_app as get_app_t2b
|
14
|
+
from ...talk2knowledgegraphs.agents.t2kg_agent import get_app as get_app_t2kg
|
15
|
+
from ..states.state_talk2aiagents4pharma import Talk2AIAgents4Pharma
|
16
|
+
|
17
|
+
# Initialize logger
|
18
|
+
logging.basicConfig(level=logging.INFO)
|
19
|
+
logger = logging.getLogger(__name__)
|
20
|
+
|
21
|
+
def get_app(uniq_id, llm_model: BaseChatModel):
|
22
|
+
'''
|
23
|
+
This function returns the langraph app.
|
24
|
+
'''
|
25
|
+
if llm_model.model_name == 'gpt-4o-mini':
|
26
|
+
llm_model = ChatOpenAI(model='gpt-4o-mini',
|
27
|
+
temperature=0,
|
28
|
+
model_kwargs={"parallel_tool_calls": False})
|
29
|
+
# Load hydra configuration
|
30
|
+
logger.log(logging.INFO, "Launching AIAgents4Pharma_Agent with thread_id %s", uniq_id)
|
31
|
+
with hydra.initialize(version_base=None, config_path="../configs"):
|
32
|
+
cfg = hydra.compose(config_name='config',
|
33
|
+
overrides=['agents/main_agent=default'])
|
34
|
+
cfg = cfg.agents.main_agent
|
35
|
+
logger.log(logging.INFO, "System_prompt of T2AA4P: %s", cfg.system_prompt)
|
36
|
+
with hydra.initialize(version_base=None, config_path="../../talk2biomodels/configs"):
|
37
|
+
cfg_t2b = hydra.compose(config_name='config',
|
38
|
+
overrides=['agents/t2b_agent=default'])
|
39
|
+
cfg_t2b = cfg_t2b.agents.t2b_agent
|
40
|
+
with hydra.initialize(version_base=None, config_path="../../talk2knowledgegraphs/configs"):
|
41
|
+
cfg_t2kg = hydra.compose(config_name='config',
|
42
|
+
overrides=['agents/t2kg_agent=default'])
|
43
|
+
cfg_t2kg = cfg_t2kg.agents.t2kg_agent
|
44
|
+
system_prompt = cfg.system_prompt
|
45
|
+
system_prompt += "\n\nHere is the system prompt of T2B agent\n"
|
46
|
+
system_prompt += cfg_t2b.state_modifier
|
47
|
+
system_prompt += "\n\nHere is the system prompt of T2KG agent\n"
|
48
|
+
system_prompt += cfg_t2kg.state_modifier
|
49
|
+
# Create supervisor workflow
|
50
|
+
workflow = create_supervisor(
|
51
|
+
[
|
52
|
+
get_app_t2b(uniq_id, llm_model), # Talk2BioModels
|
53
|
+
get_app_t2kg(uniq_id, llm_model) # Talk2KnowledgeGraphs
|
54
|
+
],
|
55
|
+
model=llm_model,
|
56
|
+
state_schema=Talk2AIAgents4Pharma,
|
57
|
+
# Full history is needed to extract
|
58
|
+
# the tool artifacts
|
59
|
+
output_mode="full_history",
|
60
|
+
add_handoff_back_messages=False,
|
61
|
+
prompt=system_prompt
|
62
|
+
)
|
63
|
+
|
64
|
+
# Compile and run
|
65
|
+
app = workflow.compile(checkpointer=MemorySaver(),
|
66
|
+
name="AIAgents4Pharma_Agent")
|
67
|
+
|
68
|
+
return app
|
@@ -0,0 +1,12 @@
|
|
1
|
+
_target_: agents.main_agent.get_app
|
2
|
+
system_prompt: >
|
3
|
+
You are Talk2AIAgents4Pharma agent.
|
4
|
+
You are managing a team of the following 2 agents:
|
5
|
+
|
6
|
+
1. Talk2Biomodels (T2B) agent: This agent can operate
|
7
|
+
on mathematical models of biological systems. This
|
8
|
+
agent can also query an uploaded document/pdf/article.
|
9
|
+
|
10
|
+
2. Talk2KnowledgeGraphs (T2KG) agent: This agent can
|
11
|
+
reason over a knowledge graph of biological entities
|
12
|
+
and their relationships.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"""
|
2
|
+
This is the state file for the Talk2AIAgents4Pharma agent.
|
3
|
+
"""
|
4
|
+
|
5
|
+
from ...talk2biomodels.states.state_talk2biomodels import Talk2Biomodels
|
6
|
+
from ...talk2knowledgegraphs.states.state_talk2knowledgegraphs import Talk2KnowledgeGraphs
|
7
|
+
|
8
|
+
class Talk2AIAgents4Pharma(Talk2Biomodels,
|
9
|
+
Talk2KnowledgeGraphs):
|
10
|
+
"""
|
11
|
+
The state for the Talk2AIAgents4Pharma agent.
|
12
|
+
|
13
|
+
This class inherits from the classes:
|
14
|
+
1. Talk2Biomodels
|
15
|
+
2. Talk2KnowledgeGraphs
|
16
|
+
"""
|
@@ -0,0 +1,112 @@
|
|
1
|
+
'''
|
2
|
+
Test Talk2AIAgents4Pharma supervisor agent.
|
3
|
+
'''
|
4
|
+
|
5
|
+
import pytest
|
6
|
+
from langchain_core.messages import HumanMessage
|
7
|
+
from langchain_openai import ChatOpenAI, OpenAIEmbeddings
|
8
|
+
from ..agents.main_agent import get_app
|
9
|
+
|
10
|
+
# Define the data path for the test files of Talk2KnowledgeGraphs agent
|
11
|
+
DATA_PATH = "aiagents4pharma/talk2knowledgegraphs/tests/files"
|
12
|
+
LLM_MODEL = ChatOpenAI(model="gpt-4o-mini", temperature=0.0)
|
13
|
+
|
14
|
+
@pytest.fixture(name="input_dict")
|
15
|
+
def input_dict_fixture():
|
16
|
+
"""
|
17
|
+
Input dictionary fixture for Talk2AIAgents4Pharma agent,
|
18
|
+
which is partly inherited from the Talk2KnowledgeGraphs agent.
|
19
|
+
"""
|
20
|
+
input_dict = {
|
21
|
+
"topk_nodes": 3,
|
22
|
+
"topk_edges": 3,
|
23
|
+
"uploaded_files": [],
|
24
|
+
"dic_source_graph": [
|
25
|
+
{
|
26
|
+
"name": "PrimeKG",
|
27
|
+
"kg_pyg_path": f"{DATA_PATH}/primekg_ibd_pyg_graph.pkl",
|
28
|
+
"kg_text_path": f"{DATA_PATH}/primekg_ibd_text_graph.pkl",
|
29
|
+
}
|
30
|
+
],
|
31
|
+
"dic_extracted_graph": []
|
32
|
+
}
|
33
|
+
|
34
|
+
return input_dict
|
35
|
+
|
36
|
+
def test_main_agent_invokes_t2kg(input_dict):
|
37
|
+
"""
|
38
|
+
In the following test, we will ask the main agent (supervisor)
|
39
|
+
to list drugs that target the gene Interleukin-6. We will check
|
40
|
+
if the Talk2KnowledgeGraphs agent is invoked. We will do so by
|
41
|
+
checking the state of the Talk2AIAgents4Pharma agent, which is
|
42
|
+
partly inherited from the Talk2KnowledgeGraphs agent
|
43
|
+
|
44
|
+
Args:
|
45
|
+
input_dict: Input dictionary
|
46
|
+
"""
|
47
|
+
# Prepare LLM and embedding model
|
48
|
+
input_dict["llm_model"] = LLM_MODEL
|
49
|
+
input_dict["embedding_model"] = OpenAIEmbeddings(model="text-embedding-3-small")
|
50
|
+
|
51
|
+
# Setup the app
|
52
|
+
unique_id = 12345
|
53
|
+
app = get_app(unique_id, llm_model=input_dict["llm_model"])
|
54
|
+
config = {"configurable": {"thread_id": unique_id}}
|
55
|
+
# Update state
|
56
|
+
app.update_state(
|
57
|
+
config,
|
58
|
+
input_dict,
|
59
|
+
)
|
60
|
+
prompt = "List drugs that target the gene Interleukin-6"
|
61
|
+
|
62
|
+
# Invoke the agent
|
63
|
+
response = app.invoke({"messages": [HumanMessage(content=prompt)]}, config=config)
|
64
|
+
|
65
|
+
# Check assistant message
|
66
|
+
assistant_msg = response["messages"][-1].content
|
67
|
+
assert isinstance(assistant_msg, str)
|
68
|
+
|
69
|
+
# Check extracted subgraph dictionary
|
70
|
+
current_state = app.get_state(config)
|
71
|
+
dic_extracted_graph = current_state.values["dic_extracted_graph"][0]
|
72
|
+
assert isinstance(dic_extracted_graph, dict)
|
73
|
+
assert dic_extracted_graph["graph_source"] == "PrimeKG"
|
74
|
+
assert dic_extracted_graph["topk_nodes"] == 3
|
75
|
+
assert dic_extracted_graph["topk_edges"] == 3
|
76
|
+
assert isinstance(dic_extracted_graph["graph_dict"], dict)
|
77
|
+
assert len(dic_extracted_graph["graph_dict"]["nodes"]) > 0
|
78
|
+
assert len(dic_extracted_graph["graph_dict"]["edges"]) > 0
|
79
|
+
assert isinstance(dic_extracted_graph["graph_text"], str)
|
80
|
+
# Check summarized subgraph
|
81
|
+
assert isinstance(dic_extracted_graph["graph_summary"], str)
|
82
|
+
|
83
|
+
def test_main_agent_invokes_t2b():
|
84
|
+
'''
|
85
|
+
In the following test, we will ask the main agent (supervisor)
|
86
|
+
to simulate a model. And we will check if the Talk2BioModels
|
87
|
+
agent is invoked. We will do so by checking the state of the
|
88
|
+
Talk2AIAgents4Pharma agent, which is partly inherited from the
|
89
|
+
Talk2BioModels agent.
|
90
|
+
'''
|
91
|
+
unique_id = 123
|
92
|
+
app = get_app(unique_id, llm_model=LLM_MODEL)
|
93
|
+
config = {"configurable": {"thread_id": unique_id}}
|
94
|
+
prompt = "Simulate model 64"
|
95
|
+
# Invoke the agent
|
96
|
+
app.invoke(
|
97
|
+
{"messages": [HumanMessage(content=prompt)]},
|
98
|
+
config=config
|
99
|
+
)
|
100
|
+
# Get the state of the Talk2AIAgents4Pharma agent
|
101
|
+
current_state = app.get_state(config)
|
102
|
+
# Check if the dic_simulated_data is in the state
|
103
|
+
dic_simulated_data = current_state.values["dic_simulated_data"]
|
104
|
+
# Check if the dic_simulated_data is a list
|
105
|
+
assert isinstance(dic_simulated_data, list)
|
106
|
+
# Check if the length of the dic_simulated_data is 1
|
107
|
+
assert len(dic_simulated_data) == 1
|
108
|
+
# Check if the source of the model is 64
|
109
|
+
assert dic_simulated_data[0]['source'] == 64
|
110
|
+
# Check if the data of the model contains
|
111
|
+
# '1,3-bisphosphoglycerate'
|
112
|
+
assert '1,3-bisphosphoglycerate' in dic_simulated_data[0]['data']
|
@@ -7,7 +7,6 @@ This is the agent file for the Talk2BioModels agent.
|
|
7
7
|
import logging
|
8
8
|
from typing import Annotated
|
9
9
|
import hydra
|
10
|
-
from langchain_openai import ChatOpenAI
|
11
10
|
from langchain_core.language_models.chat_models import BaseChatModel
|
12
11
|
from langgraph.checkpoint.memory import MemorySaver
|
13
12
|
from langgraph.graph import START, StateGraph
|
@@ -28,7 +27,7 @@ logging.basicConfig(level=logging.INFO)
|
|
28
27
|
logger = logging.getLogger(__name__)
|
29
28
|
|
30
29
|
def get_app(uniq_id,
|
31
|
-
llm_model: BaseChatModel
|
30
|
+
llm_model: BaseChatModel):
|
32
31
|
'''
|
33
32
|
This function returns the langraph app.
|
34
33
|
'''
|
@@ -65,7 +64,8 @@ def get_app(uniq_id,
|
|
65
64
|
llm_model,
|
66
65
|
tools=tools,
|
67
66
|
state_schema=Talk2Biomodels,
|
68
|
-
|
67
|
+
prompt=cfg.state_modifier,
|
68
|
+
version='v2',
|
69
69
|
checkpointer=MemorySaver()
|
70
70
|
)
|
71
71
|
|
@@ -11,7 +11,7 @@ def test_ask_question_tool():
|
|
11
11
|
Test the ask_question tool without the simulation results.
|
12
12
|
'''
|
13
13
|
unique_id = 12345
|
14
|
-
app = get_app(unique_id)
|
14
|
+
app = get_app(unique_id, llm_model=ChatOpenAI(model='gpt-4o-mini', temperature=0))
|
15
15
|
config = {"configurable": {"thread_id": unique_id}}
|
16
16
|
|
17
17
|
##########################################
|
@@ -20,9 +20,6 @@ def test_ask_question_tool():
|
|
20
20
|
# simulation has not been run. In this
|
21
21
|
# case, the tool should return an error
|
22
22
|
##########################################
|
23
|
-
# Update state
|
24
|
-
app.update_state(config,
|
25
|
-
{"llm_model": ChatOpenAI(model='gpt-4o-mini', temperature=0)})
|
26
23
|
# Define the prompt
|
27
24
|
prompt = "Call the ask_question tool to answer the "
|
28
25
|
prompt += "question: What is the concentration of CRP "
|
@@ -9,17 +9,20 @@ from langchain_openai import ChatOpenAI
|
|
9
9
|
from ..agents.t2b_agent import get_app
|
10
10
|
from ..tools.get_annotation import prepare_content_msg
|
11
11
|
|
12
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini', temperature=0)
|
13
|
+
|
12
14
|
@pytest.fixture(name="make_graph")
|
13
15
|
def make_graph_fixture():
|
14
16
|
'''
|
15
17
|
Create an instance of the talk2biomodels agent.
|
16
18
|
'''
|
17
19
|
unique_id = random.randint(1000, 9999)
|
18
|
-
graph = get_app(unique_id)
|
20
|
+
graph = get_app(unique_id, llm_model=LLM_MODEL)
|
19
21
|
config = {"configurable": {"thread_id": unique_id}}
|
20
|
-
graph.update_state(
|
21
|
-
|
22
|
-
|
22
|
+
graph.update_state(
|
23
|
+
config,
|
24
|
+
{"llm_model": LLM_MODEL}
|
25
|
+
)
|
23
26
|
return graph, config
|
24
27
|
|
25
28
|
def test_no_model_provided(make_graph):
|
@@ -3,14 +3,17 @@ Test cases for Talk2Biomodels get_modelinfo tool.
|
|
3
3
|
'''
|
4
4
|
|
5
5
|
from langchain_core.messages import HumanMessage, ToolMessage
|
6
|
+
from langchain_openai import ChatOpenAI
|
6
7
|
from ..agents.t2b_agent import get_app
|
7
8
|
|
9
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini',temperature=0)
|
10
|
+
|
8
11
|
def test_get_modelinfo_tool():
|
9
12
|
'''
|
10
13
|
Test the get_modelinfo tool.
|
11
14
|
'''
|
12
15
|
unique_id = 12345
|
13
|
-
app = get_app(unique_id)
|
16
|
+
app = get_app(unique_id, LLM_MODEL)
|
14
17
|
config = {"configurable": {"thread_id": unique_id}}
|
15
18
|
# Update state
|
16
19
|
app.update_state(config,
|
@@ -33,7 +36,7 @@ def test_model_with_no_species():
|
|
33
36
|
This should raise a tool error.
|
34
37
|
'''
|
35
38
|
unique_id = 12345
|
36
|
-
app = get_app(unique_id)
|
39
|
+
app = get_app(unique_id, LLM_MODEL)
|
37
40
|
config = {"configurable": {"thread_id": unique_id}}
|
38
41
|
prompt = "Extract all species from model 20"
|
39
42
|
# Test the tool get_modelinfo
|
@@ -64,7 +67,7 @@ def test_model_with_no_parameters():
|
|
64
67
|
This should raise a tool error.
|
65
68
|
'''
|
66
69
|
unique_id = 12345
|
67
|
-
app = get_app(unique_id)
|
70
|
+
app = get_app(unique_id, LLM_MODEL)
|
68
71
|
config = {"configurable": {"thread_id": unique_id}}
|
69
72
|
prompt = "Extract all parameters from model 10"
|
70
73
|
# Test the tool get_modelinfo
|
@@ -14,9 +14,8 @@ def test_integration():
|
|
14
14
|
Test the integration of the tools.
|
15
15
|
'''
|
16
16
|
unique_id = 1234567
|
17
|
-
app = get_app(unique_id)
|
17
|
+
app = get_app(unique_id, llm_model=LLM_MODEL)
|
18
18
|
config = {"configurable": {"thread_id": unique_id}}
|
19
|
-
app.update_state(config, {"llm_model": LLM_MODEL})
|
20
19
|
# ##########################################
|
21
20
|
# ## Test simulate_model tool
|
22
21
|
# ##########################################
|
@@ -4,8 +4,11 @@ Test cases for Talk2Biomodels parameter scan tool.
|
|
4
4
|
|
5
5
|
import pandas as pd
|
6
6
|
from langchain_core.messages import HumanMessage, ToolMessage
|
7
|
+
from langchain_openai import ChatOpenAI
|
7
8
|
from ..agents.t2b_agent import get_app
|
8
9
|
|
10
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini', temperature=0)
|
11
|
+
|
9
12
|
def test_param_scan_tool():
|
10
13
|
'''
|
11
14
|
In this test, we will test the parameter_scan tool.
|
@@ -27,9 +30,8 @@ def test_param_scan_tool():
|
|
27
30
|
|
28
31
|
'''
|
29
32
|
unique_id = 1234
|
30
|
-
app = get_app(unique_id)
|
33
|
+
app = get_app(unique_id, llm_model=LLM_MODEL)
|
31
34
|
config = {"configurable": {"thread_id": unique_id}}
|
32
|
-
app.update_state(config, {"llm_model": "gpt-4o-mini"})
|
33
35
|
prompt = """How will the value of Ab in serum in model 537 change
|
34
36
|
if the param kIL6Rbind is varied from 1 to 100 in steps of 10?
|
35
37
|
Set the initial `DoseQ2W` concentration to 300. Assume
|
@@ -8,6 +8,8 @@ from langchain_openai import ChatOpenAI
|
|
8
8
|
from langchain_nvidia_ai_endpoints import NVIDIAEmbeddings
|
9
9
|
from ..agents.t2b_agent import get_app
|
10
10
|
|
11
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini', temperature=0)
|
12
|
+
|
11
13
|
class Article(BaseModel):
|
12
14
|
'''
|
13
15
|
Article schema.
|
@@ -19,7 +21,7 @@ def test_query_article_with_an_article():
|
|
19
21
|
Test the query_article tool by providing an article.
|
20
22
|
'''
|
21
23
|
unique_id = 12345
|
22
|
-
app = get_app(unique_id)
|
24
|
+
app = get_app(unique_id, llm_model=LLM_MODEL)
|
23
25
|
config = {"configurable": {"thread_id": unique_id}}
|
24
26
|
# Update state by providing the pdf file name
|
25
27
|
# and the text embedding model
|
@@ -35,7 +37,7 @@ def test_query_article_with_an_article():
|
|
35
37
|
# Get the response from the tool
|
36
38
|
assistant_msg = response["messages"][-1].content
|
37
39
|
# Prepare a LLM that can be used as a judge
|
38
|
-
llm =
|
40
|
+
llm = LLM_MODEL
|
39
41
|
# Make it return a structured output
|
40
42
|
structured_llm = llm.with_structured_output(Article)
|
41
43
|
# Prepare a prompt for the judge
|
@@ -55,7 +57,7 @@ def test_query_article_without_an_article():
|
|
55
57
|
The status of the tool should be error.
|
56
58
|
'''
|
57
59
|
unique_id = 12345
|
58
|
-
app = get_app(unique_id)
|
60
|
+
app = get_app(unique_id, llm_model=LLM_MODEL)
|
59
61
|
config = {"configurable": {"thread_id": unique_id}}
|
60
62
|
prompt = "What is the title of the uploaded article?"
|
61
63
|
# Update state by providing the text embedding model
|
@@ -3,20 +3,23 @@ Test cases for Talk2Biomodels search models tool.
|
|
3
3
|
'''
|
4
4
|
|
5
5
|
from langchain_core.messages import HumanMessage, ToolMessage
|
6
|
-
from
|
6
|
+
from langchain_openai import ChatOpenAI
|
7
7
|
from ..agents.t2b_agent import get_app
|
8
8
|
|
9
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini', temperature=0)
|
10
|
+
|
9
11
|
def test_search_models_tool():
|
10
12
|
'''
|
11
13
|
Test the search_models tool.
|
12
14
|
'''
|
13
15
|
unique_id = 12345
|
14
|
-
app = get_app(unique_id)
|
16
|
+
app = get_app(unique_id, llm_model=LLM_MODEL)
|
15
17
|
config = {"configurable": {"thread_id": unique_id}}
|
16
|
-
# Update state
|
17
|
-
app.update_state(config,
|
18
|
-
{"llm_model": ChatNVIDIA(model="meta/llama-3.3-70b-instruct")})
|
19
18
|
prompt = "Search for models on Crohn's disease."
|
19
|
+
app.update_state(
|
20
|
+
config,
|
21
|
+
{"llm_model": LLM_MODEL}
|
22
|
+
)
|
20
23
|
# Test the tool get_modelinfo
|
21
24
|
response = app.invoke(
|
22
25
|
{"messages": [HumanMessage(content=prompt)]},
|
@@ -3,17 +3,19 @@ Test cases for Talk2Biomodels.
|
|
3
3
|
'''
|
4
4
|
|
5
5
|
from langchain_core.messages import HumanMessage
|
6
|
+
from langchain_openai import ChatOpenAI
|
6
7
|
from ..agents.t2b_agent import get_app
|
7
8
|
|
9
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini', temperature=0)
|
10
|
+
|
8
11
|
def test_simulate_model_tool():
|
9
12
|
'''
|
10
13
|
Test the simulate_model tool when simulating
|
11
14
|
multiple models.
|
12
15
|
'''
|
13
16
|
unique_id = 123
|
14
|
-
app = get_app(unique_id)
|
17
|
+
app = get_app(unique_id, llm_model=LLM_MODEL)
|
15
18
|
config = {"configurable": {"thread_id": unique_id}}
|
16
|
-
app.update_state(config, {"llm_model": "gpt-4o-mini"})
|
17
19
|
# Upload a model to the state
|
18
20
|
app.update_state(config,
|
19
21
|
{"sbml_file_path": ["aiagents4pharma/talk2biomodels/tests/BIOMD0000000449_url.xml"]})
|
@@ -13,9 +13,12 @@ def test_steady_state_tool():
|
|
13
13
|
Test the steady_state tool.
|
14
14
|
'''
|
15
15
|
unique_id = 123
|
16
|
-
app = get_app(unique_id)
|
16
|
+
app = get_app(unique_id, llm_model=LLM_MODEL)
|
17
17
|
config = {"configurable": {"thread_id": unique_id}}
|
18
|
-
app.update_state(
|
18
|
+
app.update_state(
|
19
|
+
config,
|
20
|
+
{"llm_model": LLM_MODEL}
|
21
|
+
)
|
19
22
|
#########################################################
|
20
23
|
# In this case, we will test if the tool returns an error
|
21
24
|
# when the model does not achieve a steady state. The tool
|
@@ -5,7 +5,6 @@ This is the agent file for the Talk2KnowledgeGraphs agent.
|
|
5
5
|
import logging
|
6
6
|
from typing import Annotated
|
7
7
|
import hydra
|
8
|
-
from langchain_ollama import ChatOllama
|
9
8
|
from langchain_core.language_models.chat_models import BaseChatModel
|
10
9
|
from langgraph.checkpoint.memory import MemorySaver
|
11
10
|
from langgraph.graph import START, StateGraph
|
@@ -19,7 +18,7 @@ from ..states.state_talk2knowledgegraphs import Talk2KnowledgeGraphs
|
|
19
18
|
logging.basicConfig(level=logging.INFO)
|
20
19
|
logger = logging.getLogger(__name__)
|
21
20
|
|
22
|
-
def get_app(uniq_id, llm_model: BaseChatModel
|
21
|
+
def get_app(uniq_id, llm_model: BaseChatModel):
|
23
22
|
'''
|
24
23
|
This function returns the langraph app.
|
25
24
|
'''
|
@@ -54,7 +53,8 @@ def get_app(uniq_id, llm_model: BaseChatModel=ChatOllama(model='llama3.2:1b', te
|
|
54
53
|
llm_model,
|
55
54
|
tools=tools,
|
56
55
|
state_schema=Talk2KnowledgeGraphs,
|
57
|
-
|
56
|
+
prompt=cfg.state_modifier,
|
57
|
+
version='v2',
|
58
58
|
checkpointer=MemorySaver()
|
59
59
|
)
|
60
60
|
|
@@ -14,7 +14,6 @@ from pydantic import BaseModel
|
|
14
14
|
import hydra
|
15
15
|
from langchain_core.language_models.chat_models import BaseChatModel
|
16
16
|
from langchain_core.messages import SystemMessage, HumanMessage, AIMessage
|
17
|
-
from langchain_openai import ChatOpenAI
|
18
17
|
from langgraph.checkpoint.memory import MemorySaver
|
19
18
|
from langgraph.graph import END, START, StateGraph
|
20
19
|
from langgraph.types import Command
|
@@ -119,7 +118,7 @@ def make_supervisor_node(llm_model: BaseChatModel, thread_id: str) -> Callable:
|
|
119
118
|
|
120
119
|
def get_app(
|
121
120
|
thread_id: str,
|
122
|
-
llm_model: BaseChatModel
|
121
|
+
llm_model: BaseChatModel
|
123
122
|
):
|
124
123
|
"""
|
125
124
|
Initializes and returns the LangGraph-based hierarchical agent system.
|
@@ -7,7 +7,6 @@ Agent for interacting with Semantic Scholar
|
|
7
7
|
import logging
|
8
8
|
from typing import Any, Dict
|
9
9
|
import hydra
|
10
|
-
from langchain_openai import ChatOpenAI
|
11
10
|
from langchain_core.language_models.chat_models import BaseChatModel
|
12
11
|
from langgraph.graph import START, StateGraph
|
13
12
|
from langgraph.prebuilt import create_react_agent, ToolNode
|
@@ -30,7 +29,7 @@ logger = logging.getLogger(__name__)
|
|
30
29
|
|
31
30
|
|
32
31
|
def get_app(
|
33
|
-
uniq_id, llm_model: BaseChatModel
|
32
|
+
uniq_id, llm_model: BaseChatModel
|
34
33
|
):
|
35
34
|
"""
|
36
35
|
Initializes and returns the LangGraph application for the Semantic Scholar (S2) agent.
|
@@ -7,7 +7,7 @@ Agent for interacting with Zotero
|
|
7
7
|
import logging
|
8
8
|
from typing import Any, Dict
|
9
9
|
import hydra
|
10
|
-
|
10
|
+
|
11
11
|
from langchain_core.language_models.chat_models import BaseChatModel
|
12
12
|
from langgraph.graph import START, StateGraph
|
13
13
|
from langgraph.prebuilt import create_react_agent, ToolNode
|
@@ -26,7 +26,7 @@ logger = logging.getLogger(__name__)
|
|
26
26
|
|
27
27
|
|
28
28
|
def get_app(
|
29
|
-
uniq_id, llm_model: BaseChatModel
|
29
|
+
uniq_id, llm_model: BaseChatModel
|
30
30
|
):
|
31
31
|
"""
|
32
32
|
Initializes and returns the LangGraph application for the Zotero agent.
|
@@ -7,11 +7,12 @@ import pytest
|
|
7
7
|
from langgraph.types import Command
|
8
8
|
from langgraph.graph import END
|
9
9
|
from langchain_core.messages import HumanMessage, AIMessage
|
10
|
+
from langchain_openai import ChatOpenAI
|
10
11
|
from aiagents4pharma.talk2scholars.agents.main_agent import get_app
|
11
12
|
from aiagents4pharma.talk2scholars.state.state_talk2scholars import Talk2Scholars
|
12
13
|
|
13
14
|
# pylint: disable=redefined-outer-name
|
14
|
-
|
15
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini', temperature=0)
|
15
16
|
|
16
17
|
@pytest.fixture
|
17
18
|
def mock_state():
|
@@ -68,7 +69,7 @@ def test_call_s2_agent(mock_state, mock_s2_agent, mock_supervisor, monkeypatch):
|
|
68
69
|
)
|
69
70
|
|
70
71
|
# Initialize the LangGraph application
|
71
|
-
app = get_app(thread_id="test_thread")
|
72
|
+
app = get_app(thread_id="test_thread", llm_model=LLM_MODEL)
|
72
73
|
|
73
74
|
# Simulate running the workflow and provide required `configurable` parameters
|
74
75
|
result = app.invoke(
|
@@ -7,11 +7,12 @@ import pytest
|
|
7
7
|
from langgraph.types import Command
|
8
8
|
from langgraph.graph import END
|
9
9
|
from langchain_core.messages import HumanMessage, AIMessage
|
10
|
+
from langchain_openai import ChatOpenAI
|
10
11
|
from aiagents4pharma.talk2scholars.agents.main_agent import get_app
|
11
12
|
from aiagents4pharma.talk2scholars.state.state_talk2scholars import Talk2Scholars
|
12
13
|
|
13
14
|
# pylint: disable=redefined-outer-name
|
14
|
-
|
15
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini', temperature=0)
|
15
16
|
|
16
17
|
@pytest.fixture
|
17
18
|
def test_state():
|
@@ -68,7 +69,7 @@ def test_zotero_integration(
|
|
68
69
|
)
|
69
70
|
|
70
71
|
# Initialize the LangGraph application
|
71
|
-
app = get_app(thread_id="test_thread")
|
72
|
+
app = get_app(thread_id="test_thread", llm_model=LLM_MODEL)
|
72
73
|
|
73
74
|
# Run the full workflow (mocked Zotero agent is called)
|
74
75
|
result = app.invoke(
|
@@ -63,9 +63,10 @@ def test_get_hydra_config():
|
|
63
63
|
def test_hydra_failure():
|
64
64
|
"""Test exception handling when Hydra fails to load config."""
|
65
65
|
thread_id = "test_thread"
|
66
|
+
llm_mock = Mock()
|
66
67
|
with patch("hydra.initialize", side_effect=Exception("Hydra error")):
|
67
68
|
with pytest.raises(Exception) as exc_info:
|
68
|
-
get_app(thread_id)
|
69
|
+
get_app(thread_id, llm_model=llm_mock)
|
69
70
|
assert "Hydra error" in str(exc_info.value)
|
70
71
|
|
71
72
|
|
@@ -6,9 +6,11 @@ Updated Unit Tests for the S2 agent (Semantic Scholar sub-agent).
|
|
6
6
|
from unittest import mock
|
7
7
|
import pytest
|
8
8
|
from langchain_core.messages import HumanMessage, AIMessage
|
9
|
+
from langchain_openai import ChatOpenAI
|
9
10
|
from ..agents.s2_agent import get_app
|
10
11
|
from ..state.state_talk2scholars import Talk2Scholars
|
11
12
|
|
13
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini', temperature=0)
|
12
14
|
|
13
15
|
@pytest.fixture(autouse=True)
|
14
16
|
def mock_hydra_fixture():
|
@@ -71,7 +73,7 @@ def test_s2_agent_initialization():
|
|
71
73
|
"aiagents4pharma.talk2scholars.agents.s2_agent.create_react_agent"
|
72
74
|
) as mock_create:
|
73
75
|
mock_create.return_value = mock.Mock()
|
74
|
-
app = get_app(thread_id)
|
76
|
+
app = get_app(thread_id, llm_model=LLM_MODEL)
|
75
77
|
assert app is not None
|
76
78
|
assert mock_create.called
|
77
79
|
|
@@ -89,7 +91,7 @@ def test_s2_agent_invocation():
|
|
89
91
|
"messages": [AIMessage(content="Here are some AI papers")],
|
90
92
|
"papers": {"id123": "AI Research Paper"},
|
91
93
|
}
|
92
|
-
app = get_app(thread_id)
|
94
|
+
app = get_app(thread_id, llm_model=LLM_MODEL)
|
93
95
|
result = app.invoke(
|
94
96
|
mock_state,
|
95
97
|
config={
|
@@ -122,7 +124,7 @@ def test_s2_agent_tools_assignment(request):
|
|
122
124
|
mock_tool_instance = mock.Mock()
|
123
125
|
mock_tool_instance.tools = mock_tools
|
124
126
|
mock_toolnode.return_value = mock_tool_instance
|
125
|
-
get_app(thread_id)
|
127
|
+
get_app(thread_id, llm_model=LLM_MODEL)
|
126
128
|
assert mock_toolnode.called
|
127
129
|
assert len(mock_tool_instance.tools) == 6
|
128
130
|
|
@@ -146,7 +148,7 @@ def test_s2_query_results_tool():
|
|
146
148
|
}, # Ensure the expected key is inside 'papers'
|
147
149
|
"multi_papers": {},
|
148
150
|
}
|
149
|
-
app = get_app(thread_id)
|
151
|
+
app = get_app(thread_id, llm_model=LLM_MODEL)
|
150
152
|
result = app.invoke(
|
151
153
|
mock_state,
|
152
154
|
config={
|
@@ -180,7 +182,7 @@ def test_s2_retrieve_id_tool():
|
|
180
182
|
}, # Ensure 'paper_id' is inside 'papers'
|
181
183
|
"multi_papers": {},
|
182
184
|
}
|
183
|
-
app = get_app(thread_id)
|
185
|
+
app = get_app(thread_id, llm_model=LLM_MODEL)
|
184
186
|
result = app.invoke(
|
185
187
|
mock_state,
|
186
188
|
config={
|
@@ -200,5 +202,5 @@ def test_s2_agent_hydra_failure():
|
|
200
202
|
thread_id = "test_thread"
|
201
203
|
with mock.patch("hydra.initialize", side_effect=Exception("Hydra error")):
|
202
204
|
with pytest.raises(Exception) as exc_info:
|
203
|
-
get_app(thread_id)
|
205
|
+
get_app(thread_id, llm_model=LLM_MODEL)
|
204
206
|
assert "Hydra error" in str(exc_info.value)
|
@@ -6,9 +6,11 @@ Updated Unit Tests for the Zotero agent (Zotero Library Managent sub-agent).
|
|
6
6
|
from unittest import mock
|
7
7
|
import pytest
|
8
8
|
from langchain_core.messages import HumanMessage, AIMessage
|
9
|
+
from langchain_openai import ChatOpenAI
|
9
10
|
from ..agents.zotero_agent import get_app
|
10
11
|
from ..state.state_talk2scholars import Talk2Scholars
|
11
12
|
|
13
|
+
LLM_MODEL = ChatOpenAI(model='gpt-4o-mini', temperature=0)
|
12
14
|
|
13
15
|
@pytest.fixture(autouse=True)
|
14
16
|
def mock_hydra_fixture():
|
@@ -61,7 +63,7 @@ def test_zotero_agent_initialization():
|
|
61
63
|
"aiagents4pharma.talk2scholars.agents.zotero_agent.create_react_agent"
|
62
64
|
) as mock_create:
|
63
65
|
mock_create.return_value = mock.Mock()
|
64
|
-
app = get_app(thread_id)
|
66
|
+
app = get_app(thread_id, llm_model=LLM_MODEL)
|
65
67
|
assert app is not None
|
66
68
|
assert mock_create.called
|
67
69
|
|
@@ -79,7 +81,7 @@ def test_zotero_agent_invocation():
|
|
79
81
|
"messages": [AIMessage(content="Here are some AI papers")],
|
80
82
|
"papers": {"id123": "AI Research Paper"},
|
81
83
|
}
|
82
|
-
app = get_app(thread_id)
|
84
|
+
app = get_app(thread_id, llm_model=LLM_MODEL)
|
83
85
|
result = app.invoke(
|
84
86
|
mock_state,
|
85
87
|
config={
|
@@ -112,7 +114,7 @@ def test_zotero_agent_tools_assignment(request):
|
|
112
114
|
mock_tool_instance = mock.Mock()
|
113
115
|
mock_tool_instance.tools = mock_tools
|
114
116
|
mock_toolnode.return_value = mock_tool_instance
|
115
|
-
get_app(thread_id)
|
117
|
+
get_app(thread_id, llm_model=LLM_MODEL)
|
116
118
|
assert mock_toolnode.called
|
117
119
|
assert len(mock_tool_instance.tools) == 4
|
118
120
|
|
@@ -136,7 +138,7 @@ def test_s2_query_results_tool():
|
|
136
138
|
}, # Ensure the expected key is inside 'papers'
|
137
139
|
"multi_papers": {},
|
138
140
|
}
|
139
|
-
app = get_app(thread_id)
|
141
|
+
app = get_app(thread_id, llm_model=LLM_MODEL)
|
140
142
|
result = app.invoke(
|
141
143
|
mock_state,
|
142
144
|
config={
|
@@ -156,5 +158,5 @@ def test_zotero_agent_hydra_failure():
|
|
156
158
|
thread_id = "test_thread"
|
157
159
|
with mock.patch("hydra.initialize", side_effect=Exception("Hydra error")):
|
158
160
|
with pytest.raises(Exception) as exc_info:
|
159
|
-
get_app(thread_id)
|
161
|
+
get_app(thread_id, llm_model=LLM_MODEL)
|
160
162
|
assert "Hydra error" in str(exc_info.value)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: aiagents4pharma
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.25.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
|
@@ -42,7 +42,6 @@ Requires-Dist: sentence_transformers==3.3.1
|
|
42
42
|
Requires-Dist: tabulate==0.9.0
|
43
43
|
Requires-Dist: torch==2.2.2
|
44
44
|
Requires-Dist: torch_geometric==2.6.1
|
45
|
-
Requires-Dist: tqdm==4.66.6
|
46
45
|
Requires-Dist: transformers==4.48.0
|
47
46
|
Requires-Dist: mkdocs==1.6.1
|
48
47
|
Requires-Dist: mkdocs-jupyter==0.25.1
|
@@ -56,7 +55,6 @@ Requires-Dist: h5py==3.13.0
|
|
56
55
|
Requires-Dist: igraph==0.11.8
|
57
56
|
Requires-Dist: ipykernel==6.29.5
|
58
57
|
Requires-Dist: ipython==8.32.0
|
59
|
-
Requires-Dist: numpy==2.1.3
|
60
58
|
Requires-Dist: nbformat==5.10.4
|
61
59
|
Requires-Dist: scipy==1.15.2
|
62
60
|
Requires-Dist: tqdm==4.67.1
|
@@ -83,6 +81,7 @@ Our toolkit currently consists of the following agents:
|
|
83
81
|
- **Talk2KnowledgeGraphs** _(v1 in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
84
82
|
- **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).
|
85
83
|
- **Talk2Cells** _(v1 in progress)_: Query and analyze sequencing data with ease.
|
84
|
+
- **Talk2AIAgents4Pharma** _(v1 in progress)_: Converse with all the agents above (currently supports T2B and T2KG)
|
86
85
|
|
87
86
|

|
88
87
|
|
@@ -104,49 +103,47 @@ Check out the tutorials on each agent for detailed instrcutions.
|
|
104
103
|
|
105
104
|
_Both `Talk2Biomodels` and `Talk2Scholars` are now available on Docker Hub._
|
106
105
|
|
107
|
-
|
106
|
+
1. **Pull the Docker images**
|
108
107
|
|
109
|
-
1. **Pull the Docker image**
|
110
108
|
```bash
|
111
109
|
docker pull virtualpatientengine/talk2biomodels
|
112
110
|
```
|
113
|
-
|
111
|
+
|
112
|
+
```bash
|
113
|
+
docker pull virtualpatientengine/talk2scholars
|
114
|
+
```
|
115
|
+
|
116
|
+
2. **Run the containers**
|
117
|
+
|
114
118
|
```bash
|
115
119
|
docker run -d \
|
120
|
+
--name talk2biomodels \
|
116
121
|
-e OPENAI_API_KEY=<your_openai_api_key> \
|
117
122
|
-e NVIDIA_API_KEY=<your_nvidia_api_key> \
|
118
123
|
-p 8501:8501 \
|
119
124
|
virtualpatientengine/talk2biomodels
|
120
125
|
```
|
121
|
-
3. **Access the Web App**
|
122
|
-
Open your browser and go to:
|
123
|
-
```
|
124
|
-
http://localhost:8501
|
125
|
-
```
|
126
|
-
_You can create a free account at NVIDIA and apply for their
|
127
|
-
free credits [here](https://build.nvidia.com/explore/discover)._
|
128
126
|
|
129
|
-
#### **Running Talk2Scholars**
|
130
|
-
|
131
|
-
1. **Pull the Docker image**
|
132
|
-
```bash
|
133
|
-
docker pull virtualpatientengine/talk2scholars
|
134
|
-
```
|
135
|
-
2. **Run the container**
|
136
127
|
```bash
|
137
128
|
docker run -d \
|
129
|
+
--name talk2scholars \
|
138
130
|
-e OPENAI_API_KEY=<your_openai_api_key> \
|
139
131
|
-e ZOTERO_API_KEY=<your_zotero_api_key> \
|
140
132
|
-e ZOTERO_USER_ID=<your_zotero_user_id> \
|
141
133
|
-p 8501:8501 \
|
142
134
|
virtualpatientengine/talk2scholars
|
143
135
|
```
|
144
|
-
|
145
|
-
|
136
|
+
|
137
|
+
3. **Access the Web App**
|
138
|
+
Open your browser and go to:
|
139
|
+
|
146
140
|
```
|
147
141
|
http://localhost:8501
|
148
142
|
```
|
149
143
|
|
144
|
+
_You can create a free account at NVIDIA and apply for their
|
145
|
+
free credits [here](https://build.nvidia.com/explore/discover)._
|
146
|
+
|
150
147
|
#### **Notes**
|
151
148
|
|
152
149
|
- Ensure you **replace `<your_openai_api_key>`, `<your_nvidia_api_key>`, `<your_zotero_api_key>`, and `<your_zotero_user_id>`** with your actual credentials.
|
@@ -167,6 +164,33 @@ _Both `Talk2Biomodels` and `Talk2Scholars` are now available on Docker Hub._
|
|
167
164
|
```bash
|
168
165
|
pip install -r requirements.txt
|
169
166
|
```
|
167
|
+
The current version of T2KG requires additional Ollama library to be installed.
|
168
|
+
|
169
|
+
Ollama can be easily downloaded and installed from the following link: [https://ollama.com/download](https://ollama.com/download)
|
170
|
+
|
171
|
+
As an alternative, use the following commands to install the library using terminal and to pull necessary model:
|
172
|
+
|
173
|
+
- Ubuntu:
|
174
|
+
```
|
175
|
+
curl -fsSL https://ollama.com/install.sh | sh
|
176
|
+
ollama pull nomic-embed-text
|
177
|
+
```
|
178
|
+
- Windows:
|
179
|
+
```
|
180
|
+
curl -L https://ollama.com/download/ollama-windows-amd64.zip -o ollama-windows-amd64.zip
|
181
|
+
tar -xzf .\ollama-windows-amd64.zip
|
182
|
+
start ollama serve
|
183
|
+
ollama pull nomic-embed-text
|
184
|
+
```
|
185
|
+
- macOS:
|
186
|
+
```
|
187
|
+
brew install ollama
|
188
|
+
ollama pull nomic-embed-text
|
189
|
+
```
|
190
|
+
A list of pulled Ollama models can be checked using the following command:
|
191
|
+
```
|
192
|
+
ollama list
|
193
|
+
```
|
170
194
|
3. **Initialize OPENAI_API_KEY and NVIDIA_API_KEY**
|
171
195
|
|
172
196
|
```bash
|
@@ -192,10 +216,10 @@ _Both `Talk2Biomodels` and `Talk2Scholars` are now available on Docker Hub._
|
|
192
216
|
```
|
193
217
|
|
194
218
|
_Please note that this will create a new tracing project in your Langsmith
|
195
|
-
account with the name `T2X-xxxx`, where `X` can be `
|
196
|
-
`KG` (KnowledgeGraphs), or `C` (Cells).
|
197
|
-
|
198
|
-
session._
|
219
|
+
account with the name `T2X-xxxx`, where `X` can be `AA4P` (Main Agent),
|
220
|
+
`B` (Biomodels), `S` (Scholars), `KG` (KnowledgeGraphs), or `C` (Cells).
|
221
|
+
If you skip the previous step, it will default to the name `default`.
|
222
|
+
`xxxx` will be the 4-digit ID created for the session._
|
199
223
|
|
200
224
|
6. **Launch the app:**
|
201
225
|
```bash
|
@@ -1,7 +1,18 @@
|
|
1
|
-
aiagents4pharma/__init__.py,sha256=
|
1
|
+
aiagents4pharma/__init__.py,sha256=7xnvthMuxYurECWvyb0_yaPJ18SsqvmkKPTCxgbQlNQ,186
|
2
|
+
aiagents4pharma/talk2aiagents4pharma/__init__.py,sha256=KOPe8cZ-ROQ6EGn8FeejRFUPokayKRMTgiXFyOpZGoA,122
|
3
|
+
aiagents4pharma/talk2aiagents4pharma/agents/__init__.py,sha256=Cc1RitlLGzJ5d_dCSUdguZH417nlJux1qVCVS2M9t30,129
|
4
|
+
aiagents4pharma/talk2aiagents4pharma/agents/main_agent.py,sha256=s0mrOk4DuAg7IkzB1YGyl_8wjxF2T_ReZENZirvjr94,2810
|
5
|
+
aiagents4pharma/talk2aiagents4pharma/configs/__init__.py,sha256=5ah__-8XyRblwT0U1ByRigNjt_GyCheu7zce4aM-eZE,68
|
6
|
+
aiagents4pharma/talk2aiagents4pharma/configs/config.yaml,sha256=VnbMbVSYfCh68cHZ0JLu00UjOUmapejN3EsN3lnBXtU,51
|
7
|
+
aiagents4pharma/talk2aiagents4pharma/configs/agents/__init__.py,sha256=zrJcq-4m0YUKfSlRGC8KzBmEooaASKuL_Y75yDp-ZoA,72
|
8
|
+
aiagents4pharma/talk2aiagents4pharma/configs/agents/main_agent/default.yaml,sha256=CRi4t2VGYfDouDYb6id5_qLm-6hLkp5WHCZJwsJlYM0,455
|
9
|
+
aiagents4pharma/talk2aiagents4pharma/states/__init__.py,sha256=3wSvCpM29oqvVjhbhabm7FNm9Zt0rHO5tEn63YW6doc,108
|
10
|
+
aiagents4pharma/talk2aiagents4pharma/states/state_talk2aiagents4pharma.py,sha256=NxujEBDKubvpV9UG7ERTDRB6psr0XnObCNHyztLAhgo,485
|
11
|
+
aiagents4pharma/talk2aiagents4pharma/tests/__init__.py,sha256=Jbw5tJxSrjGoaK5IX3pJWDCNzhrVQ10lkYq2oQ_KQD8,45
|
12
|
+
aiagents4pharma/talk2aiagents4pharma/tests/test_main_agent.py,sha256=ndHQT4ycWy-uKRAND7JmX_SuNg4g9hJw4UCW0CbKSp0,4165
|
2
13
|
aiagents4pharma/talk2biomodels/__init__.py,sha256=1cq1HX2xoi_a0nDPuXYoSTrnL26OHQBW3zXNwwwjFO0,181
|
3
14
|
aiagents4pharma/talk2biomodels/agents/__init__.py,sha256=sn5-fREjMdEvb-OUan3iOqrgYGjplNx3J8hYOaW0Po8,128
|
4
|
-
aiagents4pharma/talk2biomodels/agents/t2b_agent.py,sha256=
|
15
|
+
aiagents4pharma/talk2biomodels/agents/t2b_agent.py,sha256=g0DIW5P-dtJoVyG4weFdDgTrJPL_Dx1MMbTWextJDZ4,3455
|
5
16
|
aiagents4pharma/talk2biomodels/api/__init__.py,sha256=_GmDQqDLYpsUPUeE1nBNlT5AI9oTXIcqgOfNfvmonqA,123
|
6
17
|
aiagents4pharma/talk2biomodels/api/kegg.py,sha256=QzYDAfJ16E7tbHGxP8ZNWRizMkMRS_HJuucueXEC1Gg,2943
|
7
18
|
aiagents4pharma/talk2biomodels/api/ols.py,sha256=qq0Qy-gJDxanQW-HfCChDsTQsY1M41ua8hMlTnfuzrA,2202
|
@@ -25,17 +36,17 @@ aiagents4pharma/talk2biomodels/states/__init__.py,sha256=YLg1-N0D9qyRRLRqwqfLCLA
|
|
25
36
|
aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py,sha256=S1UtXvocWR8Y9OVUp6pIDFnmaCcjbwmUbW8u79TuGcg,1508
|
26
37
|
aiagents4pharma/talk2biomodels/tests/__init__.py,sha256=Jbw5tJxSrjGoaK5IX3pJWDCNzhrVQ10lkYq2oQ_KQD8,45
|
27
38
|
aiagents4pharma/talk2biomodels/tests/test_api.py,sha256=7Kz2r5F5tjmn3F0LoM33oP-21W633936YHiyf5toGg0,1716
|
28
|
-
aiagents4pharma/talk2biomodels/tests/test_ask_question.py,sha256=
|
39
|
+
aiagents4pharma/talk2biomodels/tests/test_ask_question.py,sha256=jrv0MUERirSjFz7gWwpZMMR0IqRgIMu0YMw4_LyECco,1555
|
29
40
|
aiagents4pharma/talk2biomodels/tests/test_basico_model.py,sha256=-2g7HGHXsJeaE06FUI380Br3uh1Wb-JV51mgqcb3GJw,2423
|
30
|
-
aiagents4pharma/talk2biomodels/tests/test_get_annotation.py,sha256=
|
31
|
-
aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py,sha256=
|
32
|
-
aiagents4pharma/talk2biomodels/tests/test_integration.py,sha256=
|
41
|
+
aiagents4pharma/talk2biomodels/tests/test_get_annotation.py,sha256=UGuLWhueSunZyg7vDTcKGMLNMfyg6UlAAUMG4j9o-fk,8282
|
42
|
+
aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py,sha256=FtxdLZVC1iiFXfgbeaDhbvf-Pobmrn3OiVbHpjHxLTA,3338
|
43
|
+
aiagents4pharma/talk2biomodels/tests/test_integration.py,sha256=ioeE1laUZDleRPc8AQKNeC8Q4Id5dWOA4dobiNEsCno,5159
|
33
44
|
aiagents4pharma/talk2biomodels/tests/test_load_biomodel.py,sha256=Th5EVlfowwoM0tAu1R2oPISqW7SFduC-TYa3jIqIvC0,892
|
34
|
-
aiagents4pharma/talk2biomodels/tests/test_param_scan.py,sha256=
|
35
|
-
aiagents4pharma/talk2biomodels/tests/test_query_article.py,sha256=
|
36
|
-
aiagents4pharma/talk2biomodels/tests/test_search_models.py,sha256=
|
37
|
-
aiagents4pharma/talk2biomodels/tests/test_simulate_model.py,sha256=
|
38
|
-
aiagents4pharma/talk2biomodels/tests/test_steady_state.py,sha256=
|
45
|
+
aiagents4pharma/talk2biomodels/tests/test_param_scan.py,sha256=qnhDRlKLIPZbWHJdsxIYCUuM7CmfCGXIQ6_1NxKCHIE,2710
|
46
|
+
aiagents4pharma/talk2biomodels/tests/test_query_article.py,sha256=6rB99N6wuh4P551Bdcj1M1VuaSoTbon358Yb-4nW3IQ,3250
|
47
|
+
aiagents4pharma/talk2biomodels/tests/test_search_models.py,sha256=b7wU1cDPA_gvJ2eGouGD7r1RlWMQagn72E4ZzeoAkmE,1303
|
48
|
+
aiagents4pharma/talk2biomodels/tests/test_simulate_model.py,sha256=BS6aNrjDCz5eSBj7xKOrljOydIJSvTxJ08hYG2y87J0,1549
|
49
|
+
aiagents4pharma/talk2biomodels/tests/test_steady_state.py,sha256=_6oJAJn-8aP8glTANEBub0_Hnp--Yg9DlN0_8srVIxI,3611
|
39
50
|
aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py,sha256=HSmBBViMi0jYf4gWX21IbppAfDzG0nr_S3KtKS9fZVQ,2165
|
40
51
|
aiagents4pharma/talk2biomodels/tools/__init__.py,sha256=6H2HWv5Q4NZYEmw-Ti5KZnJlEqhaC2HXSDZa6kiSl-U,350
|
41
52
|
aiagents4pharma/talk2biomodels/tools/ask_question.py,sha256=NZwKT7DHc4TW9e8LOkHaRG_nqUs_lEandvi89DTXilQ,4640
|
@@ -62,7 +73,7 @@ aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py,sha256=6q59gh_NQai
|
|
62
73
|
aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py,sha256=MLe-twtFnOu-P8P9diYq7jvHBHbWFRRCZLcfpUzqPMg,2806
|
63
74
|
aiagents4pharma/talk2knowledgegraphs/__init__.py,sha256=Z0Eo7LTiKk0STsr8VI7wkCLq7PHrK1vYlH4I1hSNLiA,165
|
64
75
|
aiagents4pharma/talk2knowledgegraphs/agents/__init__.py,sha256=iOAzuy_8A03tQDFtSBhC9dldUo62z5gfxcVtXAdLOJs,92
|
65
|
-
aiagents4pharma/talk2knowledgegraphs/agents/t2kg_agent.py,sha256=
|
76
|
+
aiagents4pharma/talk2knowledgegraphs/agents/t2kg_agent.py,sha256=IcXSZ2qQA1m-gS-o0Pj_g1oar8uPdhsbaovloUFka3Q,3058
|
66
77
|
aiagents4pharma/talk2knowledgegraphs/configs/__init__.py,sha256=4_DVdpahaJ55yPl0aZotlFA_MYWLFF2cubWyKtBVI_Q,126
|
67
78
|
aiagents4pharma/talk2knowledgegraphs/configs/config.yaml,sha256=bag4w3JCSqaojG37MTksy3ZehAPe3qoVzjIN2uh3nrc,229
|
68
79
|
aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent/__init__.py,sha256=-fAORvyFmG2iSvFOFDixmt9OTQRR58y89uhhu2EgbA8,46
|
@@ -125,9 +136,9 @@ aiagents4pharma/talk2knowledgegraphs/utils/extractions/__init__.py,sha256=7gwwtf
|
|
125
136
|
aiagents4pharma/talk2knowledgegraphs/utils/extractions/pcst.py,sha256=m5p0yoJb7I19ua5yeQfXPf7c4r6S1XPwttsrM7Qoy94,9336
|
126
137
|
aiagents4pharma/talk2scholars/__init__.py,sha256=gphERyVKZHvOnMQsml7TIHlaIshHJ75R1J3FKExkfuY,120
|
127
138
|
aiagents4pharma/talk2scholars/agents/__init__.py,sha256=WxEauzCzLEGyhdIRkxSBpNW5c_Uzf7iJUdM57IQkXH8,144
|
128
|
-
aiagents4pharma/talk2scholars/agents/main_agent.py,sha256=
|
129
|
-
aiagents4pharma/talk2scholars/agents/s2_agent.py,sha256=
|
130
|
-
aiagents4pharma/talk2scholars/agents/zotero_agent.py,sha256=
|
139
|
+
aiagents4pharma/talk2scholars/agents/main_agent.py,sha256=nZIhOyEUSHECM4-wEHbDrfHRLkqoxW0H4fy6-MpA6N8,9397
|
140
|
+
aiagents4pharma/talk2scholars/agents/s2_agent.py,sha256=ZiXtQVX2UbIyMOSXajuloWepEm7DKs6ZpPS0HgHzw0g,4492
|
141
|
+
aiagents4pharma/talk2scholars/agents/zotero_agent.py,sha256=flIvg1ORaMiQpGEbsRM4zJHRNXi6UUv7emHDjH5HVY4,3961
|
131
142
|
aiagents4pharma/talk2scholars/configs/__init__.py,sha256=tf2gz8n7M4ko6xLdX_C925ELVIxoP6SgkPcbeh59ad4,151
|
132
143
|
aiagents4pharma/talk2scholars/configs/config.yaml,sha256=IBrHX_mACNb7R4rrI_zbWgscAMUdIAkOg9LDgLN1o28,386
|
133
144
|
aiagents4pharma/talk2scholars/configs/agents/__init__.py,sha256=yyh7PB2oY_JulnpSQCWS4wwCH_uzIdt47O2Ay48x_oU,75
|
@@ -155,15 +166,15 @@ aiagents4pharma/talk2scholars/configs/tools/zotero_read/default.yaml,sha256=iILs
|
|
155
166
|
aiagents4pharma/talk2scholars/state/__init__.py,sha256=S6SxlszIMZSIMJehjevPF9sKyR-PAwWb5TEdo6xWXE8,103
|
156
167
|
aiagents4pharma/talk2scholars/state/state_talk2scholars.py,sha256=DoCtKP2qd69mXPwfOb-aYw9Hq2fYmx6b76S-HlsVSNo,2382
|
157
168
|
aiagents4pharma/talk2scholars/tests/__init__.py,sha256=U3PsTiUZaUBD1IZanFGkDIOdFieDVJtGKQ5-woYUo8c,45
|
158
|
-
aiagents4pharma/talk2scholars/tests/test_call_s2.py,sha256=
|
159
|
-
aiagents4pharma/talk2scholars/tests/test_call_zotero.py,sha256=
|
169
|
+
aiagents4pharma/talk2scholars/tests/test_call_s2.py,sha256=ZL5HmnYNVyaBJgPGQi9JnbD1d1rtWnWusVxVRVW3aHc,3375
|
170
|
+
aiagents4pharma/talk2scholars/tests/test_call_zotero.py,sha256=N4g6Pt2vuaxIhHQbIqlMaDUF4O7vIvRqa7pPIkpL8FI,3314
|
160
171
|
aiagents4pharma/talk2scholars/tests/test_llm_main_integration.py,sha256=SAMG-Kb2S9sei8Us5vUWCUJikTKXPZVKQ6aJJPEhJsc,1880
|
161
|
-
aiagents4pharma/talk2scholars/tests/test_main_agent.py,sha256=
|
172
|
+
aiagents4pharma/talk2scholars/tests/test_main_agent.py,sha256=8FKujCVhkurCe5IE6OGPTmz1p4eH1CDi467vM6VtM5A,4318
|
162
173
|
aiagents4pharma/talk2scholars/tests/test_routing_logic.py,sha256=AZrvaEBDk51KL6edrZY3GpQ_N6VbrlADqXFeg_jxDoQ,2284
|
163
|
-
aiagents4pharma/talk2scholars/tests/test_s2_agent.py,sha256
|
174
|
+
aiagents4pharma/talk2scholars/tests/test_s2_agent.py,sha256=BhW1wGc-wUPS4fwNBQRtBXJaJ_i7L6t_G9Bq57fK7rI,7784
|
164
175
|
aiagents4pharma/talk2scholars/tests/test_s2_tools.py,sha256=QEwraJk9_Kp6ZSGYyYDXWH62wIjSwi1Pptwwbx1fuG0,13176
|
165
176
|
aiagents4pharma/talk2scholars/tests/test_state.py,sha256=_iHXvoZnU_eruf8l1sQKBSCIVnxNkH_9VzkVtZZA6bY,384
|
166
|
-
aiagents4pharma/talk2scholars/tests/test_zotero_agent.py,sha256=
|
177
|
+
aiagents4pharma/talk2scholars/tests/test_zotero_agent.py,sha256=3TKz6yjNfYulaQv-MBv1zXCmR9xh9g3ju4Ge5HDdt1o,6136
|
167
178
|
aiagents4pharma/talk2scholars/tests/test_zotero_tool.py,sha256=LI7KBTxPga7E-841pugjpNqtWgoIz0mDIJEZzdIL9eI,5759
|
168
179
|
aiagents4pharma/talk2scholars/tools/__init__.py,sha256=-9iXVIGzFLak6a14Ib8yDg1bfiHgJz2nAhwWEk1jhOk,89
|
169
180
|
aiagents4pharma/talk2scholars/tools/s2/__init__.py,sha256=wytqCmGm8Fbl8y5qLdIkxhhG8VHLYMifCGjbH_LK2Fc,258
|
@@ -175,8 +186,8 @@ aiagents4pharma/talk2scholars/tools/s2/search.py,sha256=i5KMFJWK31CjYtVT1McJpLzg
|
|
175
186
|
aiagents4pharma/talk2scholars/tools/s2/single_paper_rec.py,sha256=7PoZfcstxDThWX6NYOgxN_9M_nwgMPAALch8OmjraVY,5568
|
176
187
|
aiagents4pharma/talk2scholars/tools/zotero/__init__.py,sha256=1UW4r5ECvAwYpo1Fjf7lQPO--M8I85baYCHocFOAq4M,53
|
177
188
|
aiagents4pharma/talk2scholars/tools/zotero/zotero_read.py,sha256=NJ65fAJ4u2Zq15uvEajVOhI4QnNvyqA6FHPaEDqvMw0,4321
|
178
|
-
aiagents4pharma-1.
|
179
|
-
aiagents4pharma-1.
|
180
|
-
aiagents4pharma-1.
|
181
|
-
aiagents4pharma-1.
|
182
|
-
aiagents4pharma-1.
|
189
|
+
aiagents4pharma-1.25.1.dist-info/LICENSE,sha256=IcIbyB1Hyk5ZDah03VNQvJkbNk2hkBCDqQ8qtnCvB4Q,1077
|
190
|
+
aiagents4pharma-1.25.1.dist-info/METADATA,sha256=b6pqbn3KJ-oCdO-rupWLZegRk594gIE-tfA9BnFnBCg,10297
|
191
|
+
aiagents4pharma-1.25.1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
192
|
+
aiagents4pharma-1.25.1.dist-info/top_level.txt,sha256=-AH8rMmrSnJtq7HaAObS78UU-cTCwvX660dSxeM7a0A,16
|
193
|
+
aiagents4pharma-1.25.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|