Skip to content

Commit 1a824c8

Browse files
Feat: add fetch_publications tool definition and execution logic to retrieve publication data from VCell database
1 parent 32d0377 commit 1a824c8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

backend/app/utils/tools_utils.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
fetch_biomodels,
44
fetch_simulation_details,
55
get_vcml_file,
6+
fetch_publications,
67
)
78
from app.services.knowledge_base_service import get_similar_chunks
89
from app.schemas.vcelldb_schema import BiomodelRequestParams, SimulationRequestParams
@@ -162,12 +163,28 @@
162163
),
163164
)
164165

166+
fetch_publications_tool = ToolDefinition(
167+
type="function",
168+
function=FunctionDefinition(
169+
name="fetch_publications",
170+
description="Retrieves a list of publications from the VCell database. This function fetches all available publications including their metadata, status information, and associated data. Publications represent research papers, models, and other scientific content available in the VCell system. If asked for publications, research papers, pubmed articles, etc. use this tool. Retrieve publications then use what you need on the user's query.",
171+
parameters=ParameterSchema(
172+
type="object",
173+
properties={},
174+
required=[],
175+
additionalProperties=False,
176+
),
177+
strict=True,
178+
),
179+
)
180+
165181
# List of all tool definitions
166182
ToolsDefinitions = [
167183
fetch_biomodels_tool,
168184
fetch_simulation_details_tool,
169185
get_vcml_file_tool,
170186
search_vcell_knowledge_base_tool,
187+
fetch_publications_tool,
171188
]
172189

173190

@@ -206,6 +223,9 @@ async def execute_tool(name, args):
206223
logger.info(f"Executing tool: {name} with query {query}")
207224
return get_similar_chunks(query=query, limit=limit)
208225

226+
elif name == "fetch_publications":
227+
return await fetch_publications()
228+
209229
else:
210230
return {}
211231

0 commit comments

Comments
 (0)