Skip to content

Missing method implementations in RefinementAgent #1

Open

Description

@ASIWU

Hi! Thank you for developing and maintaining CellForge - it's a really impressive project. I found 3 undefined methods being called in the RefinementAgent class:

  • _format_dataset_refinement_prompt() - called at line 385 in _refine_dataset_analysis()
  • _format_problem_refinement_prompt() - called at line 400 in _refine_problem_investigation()
  • _format_baseline_refinement_prompt() - called at line 416 in _refine_baseline_assessment()

The refinement loop in refine_analysis() will fail with AttributeError when calling these methods.

Are these methods missing from the repository, or should they be implemented following the pattern of other _format_*_prompt() methods in the class? Could you please provide these implementations or guidance on how they should be structured?

Thank you for your time and for sharing this valuable work with the community!

Activity

  1. Carringbrinks commented on Aug 28, 2025

    @Carringbrinks

    @ASIWU Hi, how did you solve this problem? I also encountered the same problem as you.

  2. mhSepehri commented on Sep 2, 2025

    @mhSepehri

    Hi, I encountered the same problem during Task Analysis. Did you find any manual fix to this problem?

  3. ASIWU commented on Sep 4, 2025

    @ASIWU
    Author

    @Carringbrinks @mhSepehri Sorry, I haven't found a solution yet.

  4. Amazingren commented on Sep 5, 2025

    @Amazingren

    Dear all @Carringbrinks @ASIWU @mhSepehri @Jiahao-Gao @tangxiangru ,

    I also encountered the same problem during reproduction. Are there any solutions you guys have already found or suggested?

    Best regards and many thx,

  5. mhSepehri commented on Sep 5, 2025

    @mhSepehri

    @Amazingren @ASIWU @Carringbrinks

    You can add blocks of code like these inside RefinementAgent class of cellforge/Task_Analysis/refinement_agent.py and temporarily fix the AttributeError.

     def _format_dataset_refinement_prompt(self, dataset_info: dict, context: dict) -> str:
            """
            Format a prompt for refining dataset descriptions.
            """
            return (
                "You are an expert bioinformatics assistant. Refine the following dataset "
                "description so that it is concise, standardized, and ready for analysis. "
                "Preserve important details such as organism, tissue, assay, technology, "
                "and sample size.\n\n"
                f"DATASET INFO:\n{dataset_info}\n\n"
                f"CONTEXT:\n{context}\n\n"
                "REFINED DESCRIPTION:"
            )
    
        def _format_problem_refinement_prompt(self, problem_statement: str, context: dict) -> str:
            """
            Format a prompt for refining problem statements.
            """
            return (
                "You are an expert research planner. Refine the following research problem "
                "statement to be clear, precise, and suitable for inclusion in a research "
                "plan. Keep the scientific intent intact.\n\n"
                f"PROBLEM STATEMENT:\n{problem_statement}\n\n"
                f"CONTEXT:\n{context}\n\n"
                "REFINED PROBLEM:"
            )
    
        def _format_baseline_refinement_prompt(self, baseline_info: str, context: dict) -> str:
            """
            Format a prompt for refining baseline assessments.
            """
            return (
                "You are an expert reviewer. Refine the following baseline assessment so that "
                "it is clear, concise, and captures the key findings. Ensure terminology is "
                "consistent with standard biomedical reporting.\n\n"
                f"BASELINE INFO:\n{baseline_info}\n\n"
                f"CONTEXT:\n{context}\n\n"
                "REFINED BASELINE ASSESSMENT:"
            )
    
  6. Amazingren commented on Sep 5, 2025

    @Amazingren

    @Amazingren @ASIWU @Carringbrinks

    You can add a blocks of code like this inside RefinementAgent class of cellforge/Task_Analysis/refinement_agent.py and temporarily fix the AttributeError.

     def _format_dataset_refinement_prompt(self, dataset_info: dict, context: dict) -> str:
            """
            Format a prompt for refining dataset descriptions.
            """
            return (
                "You are an expert bioinformatics assistant. Refine the following dataset "
                "description so that it is concise, standardized, and ready for analysis. "
                "Preserve important details such as organism, tissue, assay, technology, "
                "and sample size.\n\n"
                f"DATASET INFO:\n{dataset_info}\n\n"
                f"CONTEXT:\n{context}\n\n"
                "REFINED DESCRIPTION:"
            )
    
        def _format_problem_refinement_prompt(self, problem_statement: str, context: dict) -> str:
            """
            Format a prompt for refining problem statements.
            """
            return (
                "You are an expert research planner. Refine the following research problem "
                "statement to be clear, precise, and suitable for inclusion in a research "
                "plan. Keep the scientific intent intact.\n\n"
                f"PROBLEM STATEMENT:\n{problem_statement}\n\n"
                f"CONTEXT:\n{context}\n\n"
                "REFINED PROBLEM:"
            )
    
        def _format_baseline_refinement_prompt(self, baseline_info: str, context: dict) -> str:
            """
            Format a prompt for refining baseline assessments.
            """
            return (
                "You are an expert reviewer. Refine the following baseline assessment so that "
                "it is clear, concise, and captures the key findings. Ensure terminology is "
                "consistent with standard biomedical reporting.\n\n"
                f"BASELINE INFO:\n{baseline_info}\n\n"
                f"CONTEXT:\n{context}\n\n"
                "REFINED BASELINE ASSESSMENT:"
            )
    

    Great! Thx for sharing this experience!

    Bests,

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions