Skip to content

Conversation

@tdadela
Copy link
Collaborator

@tdadela tdadela commented Jun 8, 2025

  • Added PubChemPy library for accessing PubChem chemical data.
  • Registered new tools in main_agent.py for chemical name/SMILES conversion and info retrieval using PubChemPy.
  • Updated instructions.txt to document these new functionalities and their usage.
  • The agent can now convert between chemical names and SMILES, and fetch detailed compound info, all using authoritative PubChem data.

@tdadela tdadela requested a review from Copilot June 8, 2025 22:43

This comment was marked as outdated.

@tdadela tdadela requested a review from Copilot June 8, 2025 23:18

This comment was marked as outdated.

@tdadela tdadela requested review from Kowalski1024 and Copilot June 9, 2025 00:15

This comment was marked as outdated.

Repository owner deleted a comment from Copilot AI Jun 9, 2025
@tdadela tdadela requested a review from Copilot June 9, 2025 01:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates PubChemPy into ReAgentAI to enable chemical name/SMILES conversions and detailed compound information retrieval via the PubChem database.

  • Adds pubchempy dependency and implements three new tools (get_smiles_from_name, get_compound_info, get_name_from_smiles) in tools/pubchem.py.
  • Registers these tools in the main agent and updates UI, examples, and constants to surface the new functionality.
  • Updates documentation (instructions.txt, README.md) to describe usage of the PubChem-based features.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/reagentai/ui/app.py Removed duplicate gr.Examples block and reordered imports
src/reagentai/tools/pubchem.py New PubChem integration functions for SMILES/name conversions and info retrieval
src/reagentai/constants.py Extended example prompts to showcase name/SMILES conversion and compound info
src/reagentai/agents/main/main_agent.py Registered the three new PubChem tools in the agent’s tool list
src/reagentai/agents/main/instructions.txt Documented how to use each new PubChem tool
pyproject.toml Added pubchempy>=1.0.4 dependency
README.md Updated feature list and setup notes for PubChem integration
Comments suppressed due to low confidence (3)

src/reagentai/tools/pubchem.py:142

  • Consider returning molecular_weight as a numeric value instead of a string to maintain consistent data types and simplify downstream processing. If string format is required, document this clearly in the signature and return-type annotation.
"molecular_weight": str(getattr(compound, \"molecular_weight\", None))

src/reagentai/tools/pubchem.py:91

  • The return type annotation uses a bare list for synonyms; consider specifying list[str] for clarity. Also, use Optional[...] from typing for readability, e.g., dict[str, Optional[Union[str, List[str]]]].
def get_compound_info(compound_name: str) -> dict[str, str | list | None]:

src/reagentai/tools/pubchem.py:1

  • The new PubChem integration functions currently lack unit tests. Add tests for get_smiles_from_name, get_compound_info, and get_name_from_smiles to verify correct outputs, error handling for invalid inputs, and network-failure scenarios.
import logging

@Kowalski1024 Kowalski1024 merged commit 52a447c into main Jun 9, 2025
1 check passed
@Kowalski1024 Kowalski1024 deleted the pubchempy branch June 9, 2025 07:41
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.

3 participants