Skip to content

Conversation

@loadchange
Copy link

@loadchange loadchange commented Sep 2, 2025

Description

Enhanced the assign_code_list_to_evo method to support both string and dictionary types for code implementations. The method now properly handles:

  • String type: New implementations that are injected as factor.py
  • Dictionary type: Existing implementations from knowledge base that are injected as complete file dictionaries
  • Added type validation with descriptive error messages for unsupported types

Motivation and Context

The original implementation only supported string-type code, which limited the flexibility of code injection. This enhancement allows the method to work with existing implementations from the knowledge base (dict format) as well as new implementations (string format), improving the system's ability to reuse and manage code implementations.

How Has This Been Tested?

  • If you are adding a new feature, test on your own test scripts.

The enhanced method now properly handles both data types while maintaining backward compatibility with existing string-based implementations.

Screenshots of Test Results (if appropriate):

  1. Your own tests:
    No screenshots needed as this is a code enhancement that extends existing functionality.

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

📚 Documentation preview 📚: https://RDAgent--1222.org.readthedocs.build/en/1222/

@SunsetWolf
Copy link
Collaborator

Hi, @loadchange
Thank you for your interest and contribution to RD-Agent. Your contribution makes RD-Agent more generic. But there is a little problem:
If you can judge whether the key is a "factor.py" after judging it as a dict, it will avoid problems and will be more rigorous.

@loadchange loadchange force-pushed the feat/dict-code-support branch from 828a26f to d0a41b5 Compare September 11, 2025 06:28
@loadchange loadchange closed this Sep 11, 2025
@loadchange loadchange force-pushed the feat/dict-code-support branch from d0a41b5 to fb628e3 Compare September 11, 2025 06:29
@loadchange loadchange reopened this Sep 11, 2025
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