Basic Tools for Alhazen
Available Tools:
Building, Describing, and Deleting Collections:
- AddCollectionFromEPMCTool: Execute a query against the European PMC, creating a collection, downloading available full-text papers and saving expressions, items, and fragments to the database to denote that publication.
- DescribeCollectionCompositionTool: Describe the composition of a collection in the database.
- DeleteCollectionTool: Delete a collection from the database.
Searching for papers in collections:
- **List__Paged_Expressions_CollectionCTool**: Delete a collection from the database.
Tools under development:
- Develop queries across external data sources
- Extract information from a collection using an LLM-based analysis to create Notes
- Filter a collection by an LLM-based analysis by tagging fragments with Notes
- Report on the state of the database in terms of numbers of collections, expressions, items, and fragments
- Prepare a report over a core research question by collecting a number of notes and synthesizing them into a report
IntrospectionToolMixin
IntrospectionToolMixin (agent:Optional[langchain.agents.agent.RunnableAg ent]=None)
Base class for providing information about Alhazen’s capabilities.
AlhazenToolMixin
AlhazenToolMixin (db:alhazen.utils.ceifns_db.Ceifns_LiteratureDb, llm:Opt ional[langchain_core.language_models.chat_models.BaseCh atModel]=None, slm:Optional[langchain_core.language_mod els.chat_models.BaseChatModel]=None)
Base tool for interacting with an Alhazen CEIFNS (pron. ‘SAI-FiNS’) database (CEIFNS = Collection-Expression-Item-Fragment-Note-Summary).
IntrospectionTool
IntrospectionTool (name:str='introspect', description:str='This tool permits Alhazen to answer questions how its agent would plan to answer specific questions.', args_schema :Type[__main__.IntrospectionToolSchema]=<class '__main__.IntrospectionToolSchema'>, return_direct:bool=False, verbose:bool=False, callback s:Union[List[langchain_core.callbacks.base.BaseCallbac kHandler],langchain_core.callbacks.base.BaseCallbackMa nager,NoneType]=None, callback_manager:Optional[langch ain_core.callbacks.base.BaseCallbackManager]=None, tags:Optional[List[str]]=None, metadata:Optional[Dict[str,Any]]=None, handle_tool_err or:Union[bool,str,Callable[[langchain_core.tools.ToolE xception],str],NoneType]=False, handle_validation_erro r:Union[bool,str,Callable[[pydantic.v1.error_wrappers. ValidationError],str],NoneType]=False, agent:Optional[ langchain.agents.agent.RunnableAgent]=None)
Base class for providing information about Alhazen’s capabilities.
IntrospectionToolSchema
IntrospectionToolSchema (input:str)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
AddCollectionFromEPMCTool
AddCollectionFromEPMCTool (name:str='add_collection_from_epmc_query', description:str='This tool constructs a collection in the database from an external source based on a search query .', args_schema :Type[__main__.AddCollectionFromEPMCToolSchema ]=<class '__main__.AddCollectionFromEPMCToolSchema'>, return_direct:bool=True, verbose:bool=False, c allbacks:Union[List[langchain_core.callbacks.b ase.BaseCallbackHandler],langchain_core.callba cks.base.BaseCallbackManager,NoneType]=None, c allback_manager:Optional[langchain_core.callba cks.base.BaseCallbackManager]=None, tags:Optional[List[str]]=None, metadata:Optional[Dict[str,Any]]=None, handle_ tool_error:Union[bool,str,Callable[[langchain_ core.tools.ToolException],str],NoneType]=False , handle_validation_error:Union[bool,str,Calla ble[[pydantic.v1.error_wrappers.ValidationErro r],str],NoneType]=False, db:alhazen.utils.ceif ns_db.Ceifns_LiteratureDb, llm:Optional[langch ain_core.language_models.chat_models.BaseChatM odel]=None, slm:Optional[langchain_core.langua ge_models.chat_models.BaseChatModel]=None)
Base tool for interacting with an Alhazen CEIFNS (pron. ‘SAI-FiNS’) database (CEIFNS = Collection-Expression-Item-Fragment-Note-Summary).
AddCollectionFromEPMCToolSchema
AddCollectionFromEPMCToolSchema (id:str, name:str, query:str)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
ListCollectionsTool
ListCollectionsTool (name:str='list_collections', description:str='This tool lists available collections in the database.', args_schema:Type[__main__.ListCollectionsToolSchema] =<class '__main__.ListCollectionsToolSchema'>, return_direct:bool=True, verbose:bool=False, callbac ks:Union[List[langchain_core.callbacks.base.BaseCall backHandler],langchain_core.callbacks.base.BaseCallb ackManager,NoneType]=None, callback_manager:Optional [langchain_core.callbacks.base.BaseCallbackManager]= None, tags:Optional[List[str]]=None, metadata:Optional[Dict[str,Any]]=None, handle_tool_e rror:Union[bool,str,Callable[[langchain_core.tools.T oolException],str],NoneType]=False, handle_validatio n_error:Union[bool,str,Callable[[pydantic.v1.error_w rappers.ValidationError],str],NoneType]=False, db:alhazen.utils.ceifns_db.Ceifns_LiteratureDb, llm: Optional[langchain_core.language_models.chat_models. BaseChatModel]=None, slm:Optional[langchain_core.lan guage_models.chat_models.BaseChatModel]=None)
Base tool for interacting with an Alhazen CEIFNS (pron. ‘SAI-FiNS’) database (CEIFNS = Collection-Expression-Item-Fragment-Note-Summary).
ListCollectionsToolSchema
ListCollectionsToolSchema (name_filter:str)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
AddCollectionFromOpenAlexTool
AddCollectionFromOpenAlexTool (name:str='add_collection_from_openalex_do is', description:str='This tool constructs a collection in the database from an external source based on a list of dois.', args_schema:Type[__main__.AddCollectionFro mOpenAlexToolSchema]=<class '__main__.AddC ollectionFromOpenAlexToolSchema'>, return_direct:bool=True, verbose:bool=False, callbacks:Union[List[l angchain_core.callbacks.base.BaseCallbackH andler],langchain_core.callbacks.base.Base CallbackManager,NoneType]=None, callback_m anager:Optional[langchain_core.callbacks.b ase.BaseCallbackManager]=None, tags:Optional[List[str]]=None, metadata:Optional[Dict[str,Any]]=None, han dle_tool_error:Union[bool,str,Callable[[la ngchain_core.tools.ToolException],str],Non eType]=False, handle_validation_error:Unio n[bool,str,Callable[[pydantic.v1.error_wra ppers.ValidationError],str],NoneType]=Fals e, db:alhazen.utils.ceifns_db.Ceifns_Liter atureDb, llm:Optional[langchain_core.langu age_models.chat_models.BaseChatModel]=None , slm:Optional[langchain_core.language_mod els.chat_models.BaseChatModel]=None)
Base tool for interacting with an Alhazen CEIFNS (pron. ‘SAI-FiNS’) database (CEIFNS = Collection-Expression-Item-Fragment-Note-Summary).
AddCollectionFromOpenAlexToolSchema
AddCollectionFromOpenAlexToolSchema (id:str, name:str, dois:List[str])
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
CheckExpressionTool
CheckExpressionTool (name:str='describe_expression_in_local_database', description:str='This tool searches for a paper in the database and reports if we have full text version of it.', args_schema:Type[__main__.CheckExpr essionToolSchema]=<class '__main__.CheckExpressionToolSchema'>, return_direct:bool=True, verbose:bool=False, callbac ks:Union[List[langchain_core.callbacks.base.BaseCall backHandler],langchain_core.callbacks.base.BaseCallb ackManager,NoneType]=None, callback_manager:Optional [langchain_core.callbacks.base.BaseCallbackManager]= None, tags:Optional[List[str]]=None, metadata:Optional[Dict[str,Any]]=None, handle_tool_e rror:Union[bool,str,Callable[[langchain_core.tools.T oolException],str],NoneType]=False, handle_validatio n_error:Union[bool,str,Callable[[pydantic.v1.error_w rappers.ValidationError],str],NoneType]=False, db:alhazen.utils.ceifns_db.Ceifns_LiteratureDb, llm: Optional[langchain_core.language_models.chat_models. BaseChatModel]=None, slm:Optional[langchain_core.lan guage_models.chat_models.BaseChatModel]=None)
Base tool for interacting with an Alhazen CEIFNS (pron. ‘SAI-FiNS’) database (CEIFNS = Collection-Expression-Item-Fragment-Note-Summary).
CheckExpressionToolSchema
CheckExpressionToolSchema (query:str)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
DescribeCollectionCompositionTool
DescribeCollectionCompositionTool (name:str='describe_collection_in_loca l_database', description:str='This tool describes the contents of a Collection, in terms of counts of papers', args_schema:Type[__main__.Des cribeCollectionCompositionToolSchema]= <class '__main__.DescribeCollectionCom positionToolSchema'>, return_direct:bool=True, verbose:bool=False, callbacks:Union[Li st[langchain_core.callbacks.base.BaseC allbackHandler],langchain_core.callbac ks.base.BaseCallbackManager,NoneType]= None, callback_manager:Optional[langch ain_core.callbacks.base.BaseCallbackMa nager]=None, tags:Optional[List[str]]=None, metadata:Optional[Dict[str,Any]]=None, handle_tool_error:Union[bool,str,Calla ble[[langchain_core.tools.ToolExceptio n],str],NoneType]=False, handle_valida tion_error:Union[bool,str,Callable[[py dantic.v1.error_wrappers.ValidationErr or],str],NoneType]=False, db:alhazen.u tils.ceifns_db.Ceifns_LiteratureDb, ll m:Optional[langchain_core.language_mod els.chat_models.BaseChatModel]=None, s lm:Optional[langchain_core.language_mo dels.chat_models.BaseChatModel]=None)
Base tool for interacting with an Alhazen CEIFNS (pron. ‘SAI-FiNS’) database (CEIFNS = Collection-Expression-Item-Fragment-Note-Summary).
DescribeCollectionCompositionToolSchema
DescribeCollectionCompositionToolSchema (id:str)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
DeleteCollectionTool
DeleteCollectionTool (name:str='delete_collection', description:str='This deletes a collection from the database based on an collection_id value.', args_schema:Type[__main__.De leteCollectionToolSchema]=<class '__main__.DeleteCollectionToolSchema'>, return_direct:bool=True, verbose:bool=False, callba cks:Union[List[langchain_core.callbacks.base.BaseCa llbackHandler],langchain_core.callbacks.base.BaseCa llbackManager,NoneType]=None, callback_manager:Opti onal[langchain_core.callbacks.base.BaseCallbackMana ger]=None, tags:Optional[List[str]]=None, metadata:Optional[Dict[str,Any]]=None, handle_tool_ error:Union[bool,str,Callable[[langchain_core.tools .ToolException],str],NoneType]=False, handle_valida tion_error:Union[bool,str,Callable[[pydantic.v1.err or_wrappers.ValidationError],str],NoneType]=False, db:alhazen.utils.ceifns_db.Ceifns_LiteratureDb, llm :Optional[langchain_core.language_models.chat_model s.BaseChatModel]=None, slm:Optional[langchain_core. language_models.chat_models.BaseChatModel]=None)
Base tool for interacting with an Alhazen CEIFNS (pron. ‘SAI-FiNS’) database (CEIFNS = Collection-Expression-Item-Fragment-Note-Summary).
DeleteCollectionToolSchema
DeleteCollectionToolSchema (collection_id:str)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
RetrieveFullTextToolForACollection
RetrieveFullTextToolForACollection (name:str='retrieve_full_text_for_pap ers_in_collection', description:str='This retrieves all full text papers in a given collection.', args_schema:Type[__main __.RetrieveFullTextToolForACollection Schema]=<class '__main__.RetrieveFull TextToolForACollectionSchema'>, return_direct:bool=True, verbose:bool=False, callbacks:Union[L ist[langchain_core.callbacks.base.Bas eCallbackHandler],langchain_core.call backs.base.BaseCallbackManager,NoneTy pe]=None, callback_manager:Optional[l angchain_core.callbacks.base.BaseCall backManager]=None, tags:Optional[List[str]]=None, metada ta:Optional[Dict[str,Any]]=None, hand le_tool_error:Union[bool,str,Callable [[langchain_core.tools.ToolException] ,str],NoneType]=False, handle_validat ion_error:Union[bool,str,Callable[[py dantic.v1.error_wrappers.ValidationEr ror],str],NoneType]=False, db:alhazen .utils.ceifns_db.Ceifns_LiteratureDb, llm:Optional[langchain_core.language_ models.chat_models.BaseChatModel]=Non e, slm:Optional[langchain_core.langua ge_models.chat_models.BaseChatModel]= None)
Base tool for interacting with an Alhazen CEIFNS (pron. ‘SAI-FiNS’) database (CEIFNS = Collection-Expression-Item-Fragment-Note-Summary).
RetrieveFullTextToolForACollectionSchema
RetrieveFullTextToolForACollectionSchema (collection_id:str)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
RetrieveFullTextTool
RetrieveFullTextTool (name:str='retrieve_full_text_for_paper_id', description:str='This retrieves a full text paper based on its doi, copies it to local disk, and adds it the database.', args_schema:Type[__main__.Retrie veFullTextToolSchema]=<class '__main__.RetrieveFullTextToolSchema'>, return_direct:bool=True, verbose:bool=False, callba cks:Union[List[langchain_core.callbacks.base.BaseCa llbackHandler],langchain_core.callbacks.base.BaseCa llbackManager,NoneType]=None, callback_manager:Opti onal[langchain_core.callbacks.base.BaseCallbackMana ger]=None, tags:Optional[List[str]]=None, metadata:Optional[Dict[str,Any]]=None, handle_tool_ error:Union[bool,str,Callable[[langchain_core.tools .ToolException],str],NoneType]=False, handle_valida tion_error:Union[bool,str,Callable[[pydantic.v1.err or_wrappers.ValidationError],str],NoneType]=False, db:alhazen.utils.ceifns_db.Ceifns_LiteratureDb, llm :Optional[langchain_core.language_models.chat_model s.BaseChatModel]=None, slm:Optional[langchain_core. language_models.chat_models.BaseChatModel]=None)
Base tool for interacting with an Alhazen CEIFNS (pron. ‘SAI-FiNS’) database (CEIFNS = Collection-Expression-Item-Fragment-Note-Summary).
RetrieveFullTextToolSchema
RetrieveFullTextToolSchema (paper_id:str)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.