Feat/sdk modulector - #104
Open
TheSinnerAR wants to merge 2 commits into
Open
Conversation
Replaced direct Modulector HTTP calls with modulector-sdk wrappers in `MRNAService` and updated all related consumers (`api_service`, `biomarkers`, `molecules_details`, and assistant tools). Added dedicated SDK-backed methods for miRNA/methylation lookup, interactions, diseases, drugs, and code/site search, plus paginated response normalization and safer fallbacks. Also introduced `MODULECTOR_BASE_URL` settings, added `modulector-sdk` dependency, updated MCP server command args for BioMCP, and fixed a null-response edge case in biomarker gene lookup.
Enable a dedicated `modulector` MCP server in `mcp_servers.json` and remove the in-process miRNA helper tools from `tools.py` (search/details/targets/diseases/drugs), along with their registration. This centralizes miRNA and related biological lookups through the external Modulector MCP integration instead of local assistant wrappers.
Genarito
requested changes
Aug 1, 2026
| @@ -168,6 +168,8 @@ def find_genes_from_request(request: Request) -> List[Dict]: | |||
| """ | |||
| genes_found = global_mrna_service.get_bioapi_service_content('gene-symbols-finder', | |||
| return '&'.join([f'{key}={value}' for (key, value) in get_request.items()]) | ||
|
|
||
| def __get_service_content( | ||
| def __get_bioapi_content( |
| return self.__get_service_content(service_name, request_params, is_paginated, self.url_modulector_prefix, | ||
| method, append_slash=True) | ||
|
|
||
| def get_bioapi_service_content( |
Member
There was a problem hiding this comment.
Borrar, no debería usarse más ahora que tenemos la SDK
| def find_methylation_sites(self, query: str, limit: Optional[int] = None) -> List[str]: | ||
| """Search methylation site identifiers via Modulector SDK.""" | ||
| try: | ||
| kwargs: Dict[str, Any] = {'query': query, 'base_url': self._modulector_base_url} |
Member
There was a problem hiding this comment.
Simplificar, en vez de hacer un diccionario y después desconstruir:
return modulector.find_methylation_sites(query=query, limit=limit)Aplica esta mejora a todas las funciones de este archivo
| 'port': os.getenv('MODULECTOR_PORT', 443), | ||
| 'protocol': os.getenv('BIOAPI_PROTOCOL', 'https') | ||
| } | ||
| _modulector_protocol = os.getenv('MODULECTOR_PROTOCOL', os.getenv('BIOAPI_PROTOCOL', 'https')) |
Member
There was a problem hiding this comment.
Tipar, en caso el caso del puerto, hacer un int() para que, en caso de configurarlo mal, salte el error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.