Skip to content

Feat/sdk modulector - #104

Open
TheSinnerAR wants to merge 2 commits into
devfrom
feat/sdk-modulector
Open

Feat/sdk modulector#104
TheSinnerAR wants to merge 2 commits into
devfrom
feat/sdk-modulector

Conversation

@TheSinnerAR

Copy link
Copy Markdown
Collaborator

No description provided.

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.
Comment thread src/biomarkers/views.py
@@ -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',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reemplazar por la SDK

return '&'.join([f'{key}={value}' for (key, value) in get_request.items()])

def __get_service_content(
def __get_bioapi_content(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Borrar, no debería usarse más

return self.__get_service_content(service_name, request_params, is_paginated, self.url_modulector_prefix,
method, append_slash=True)

def get_bioapi_service_content(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tipar, en caso el caso del puerto, hacer un int() para que, en caso de configurarlo mal, salte el error

@Genarito Genarito left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolver comentarios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants