This skill provides a lightweight implementation of the ChemCrow agent concept. It exposes a set of tools for chemical analysis, safety checks, and property calculation. It is designed to work with rdkit if available, but gracefully degrades to a "Mock Mode" for demonstration purposes if libraries are missing.
- Molecular Weight Calculator: Uses
rdkit.Chem.Descriptors(or estimates in mock mode). - Safety Checker: Heuristic detection of common structural alerts (Nitro groups, Heavy metals).
- Validity Checker: Verifies SMILES string format.
- Extensible Tool Interface: Designed to be easily wrapped by an LLM (LangChain/AutoGPT).
For full functionality:
pip install rdkit1. Demo Mode (Runs through test cases):
python chem_tools.py2. CLI Mode:
# Calculate Molecular Weight
python chem_tools.py MolWeight "CC(=O)Nc1ccc(O)cc1"
# Check Safety
python chem_tools.py Safety "Cc1c(N(=O)=O)cc(N(=O)=O)cc1N(=O)=O"To use this with an LLM:
- Import
ChemCrowAgent. - Expose
agent.toolsto your LLM's function calling capabilities. - The LLM can then request "MolWeight" for a generated molecule to verify its properties.